--- parser3/src/targets/cgi/parser3.C 2001/03/20 18:55:44 1.26.2.3 +++ parser3/src/targets/cgi/parser3.C 2001/03/21 15:53:28 1.28 @@ -1,9 +1,11 @@ -/* - Parser +/** @file + Parser: scripting and CGI main. + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) - $Id: parser3.C,v 1.26.2.3 2001/03/20 18:55:44 paf Exp $ + $Id: parser3.C,v 1.28 2001/03/21 15:53:28 paf Exp $ */ #ifdef HAVE_CONFIG_H @@ -32,8 +34,8 @@ #include "pa_globals.h" #include "pa_request.h" -Pool pool; // global pool -bool cgi; +Pool pool; ///< global pool +bool cgi; ///< we were started as CGI? #ifdef WIN32 # if _MSC_VER @@ -67,14 +69,19 @@ LONG WINAPI TopLevelExceptionFilter ( //\if void fix_slashes(char *s) { - for(; *s; s++) - if(*s=='\\') - *s='/'; + if(s) + for(; *s; s++) + if(*s=='\\') + *s='/'; } //\endif // service funcs +const char *get_env(Pool& pool, const char *name) { + return getenv(name); +} + int read_post(char *buf, int max_bytes) { int read_size=0; do { @@ -111,6 +118,7 @@ int main(int argc, char *argv[]) { //\#endif // Service funcs + service_funcs.get_env=get_env; service_funcs.read_post=read_post; service_funcs.output_header_attribute=output_header_attribute; service_funcs.output_body=output_body;