pike.git / lib / modules / Search.pmod / Utils.pmod

version» Context lines:

pike.git/lib/modules/Search.pmod/Utils.pmod:1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Utils.pmod,v 1.9 2001/07/05 02:14:15 nilsson Exp $ + // $Id: Utils.pmod,v 1.10 2001/07/05 18:55:37 nilsson Exp $      public array(string) tokenize_and_normalize( string what )   //! This can be optimized quite significantly when compared to   //! tokenize( normalize( x ) ) in the future, currently it's not all   //! that much faster, but still faster.   {    return Unicode.split_words_and_normalize( lower_case(what) );   }      public array(string) tokenize(string in)
pike.git/lib/modules/Search.pmod/Utils.pmod:87:       void log_notice( int code, void|string extra ) {    log_event( code, "notice", extra );    }       private mapping codes = ([    100 : "Started %s with %s",    101 : "Exiting %s due to signal",    102 : "Connecting %s to %s",    103 : "%s failed to set up pipe", +  104 : "Fetched %s",    404 : "File %s not found",    ]);       array(array(string|int)) get_log( int profile, array(string) types,    int from, int to ) {       string sql = ""; - #define SQLADD(X) do{sizeof(sql)?(sql=" WHERE "+(X)):(sql+=" AND "+(X));}while(0) + #define SQLADD(X) do{sizeof(sql)?(sql+=" AND "+(X)):(sql=" WHERE "+(X));}while(0)    if(profile)    SQLADD("profile=" + profile);    if(!sizeof(types))    return ({});    if(sizeof(types)!=3)    SQLADD("(type='" + (types*"' OR type='") + "')");    if(from)    SQLADD("at>" + from);    if(to)    SQLADD("to<" + to);