--- parser3/src/classes/file.C 2008/07/03 09:18:52 1.172 +++ parser3/src/classes/file.C 2008/07/23 14:07:43 1.174 @@ -5,12 +5,10 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_FILE_C="$Date: 2008/07/03 09:18:52 $"; +static const char * const IDENT_FILE_C="$Date: 2008/07/23 14:07:43 $"; #include "pa_config_includes.h" -#include "pcre.h" - #include "classes.h" #include "pa_vmethod_frame.h" @@ -610,7 +608,7 @@ static void _list(Request& r, MethodPara Value& relative_path=params.as_no_junction(0, "path must not be code"); const String* regexp; - pcre *regexp_code; + PCRE::pcre *regexp_code; const int ovecsize=(1/*match*/)*3; int ovector[ovecsize]; if(params.count()>1) { @@ -619,7 +617,7 @@ static void _list(Request& r, MethodPara const char* pattern=regexp->cstr(); const char* errptr; int erroffset; - regexp_code=pcre_compile(pattern, PCRE_EXTRA | PCRE_DOTALL, + regexp_code=PCRE::pcre_compile(pattern, PCRE_EXTRA | PCRE_DOTALL, &errptr, &erroffset, r.charsets.source().pcre_tables); @@ -644,14 +642,14 @@ static void _list(Request& r, MethodPara size_t file_name_size=strlen(file_name_cstr); bool suits=true; if(regexp_code) { - int exec_result=pcre_exec(regexp_code, 0, + int exec_result=PCRE::pcre_exec(regexp_code, 0, ffblk.ff_name, file_name_size, 0, 0, ovector, ovecsize); if(exec_result==PCRE_ERROR_NOMATCH) suits=false; else if(exec_result<0) { - (*pcre_free)(regexp_code); + (*PCRE::pcre_free)(regexp_code); throw Exception(0, regexp, "regular expression execute (%d)", @@ -667,7 +665,7 @@ static void _list(Request& r, MethodPara ); if(regexp_code) - pcre_free(regexp_code); + PCRE::pcre_free(regexp_code); // write out result r.write_no_lang(*new VTable(&table)); @@ -872,6 +870,7 @@ static void _sql(Request& r, MethodParam statement_string.cstr(String::L_UNSPECIFIED, r.connection()); File_sql_event_handlers handlers(statement_string, statement_cstr); + ulong limit=SQL_NO_LIMIT; ulong offset=0; if(params.count()>1) @@ -885,6 +884,10 @@ static void _sql(Request& r, MethodParam valid_options++; handlers.user_content_type=&vcontent_type->as_string(); } + if(Value* vlimit=options->get(sql_limit_name)) { + valid_options++; + limit=(ulong)r.process_to_value(*vlimit).as_double(); + } if(Value* voffset=options->get(sql_offset_name)) { valid_options++; offset=(ulong)r.process_to_value(*voffset).as_double(); @@ -899,7 +902,7 @@ static void _sql(Request& r, MethodParam r.connection()->query( statement_cstr, 0, 0, - offset, 1/*limit*/, + offset, limit, handlers, statement_string);