--- parser3/src/main/pa_globals.C 2003/01/10 16:52:25 1.149 +++ parser3/src/main/pa_globals.C 2003/04/04 08:16:20 1.153 @@ -1,11 +1,11 @@ /** @file Parser: globals. - Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_GLOBALS_C="$Date: 2003/01/10 16:52:25 $"; +static const char* IDENT_GLOBALS_C="$Date: 2003/04/04 08:16:20 $"; #include "pa_config_includes.h" @@ -81,6 +81,7 @@ String *hash_default_element_name; String *http_method_name; String *http_timeout_name; String *http_headers_name; +String *http_any_status_name; String *file_status_name; @@ -247,6 +248,32 @@ xmlFileOpenLocalhost (const char *filena return((void *) fd); } +/** + * xmlFileRead: + * @context: the I/O context + * @buffer: where to drop data + * @len: number of bytes to write + * + * Read @len bytes to @buffer from the I/O channel. + * + * Returns the number of bytes written + */ +static int +pa_xmlFileRead (void * context, char * buffer, int len) { + return(fread(&buffer[0], 1, len, (FILE *) context)); +} + +/** + * xmlFileClose: + * @context: the I/O context + * + * Close an I/O channel + */ +static int +pa_xmlFileClose (void * context) { + return ( ( fclose((FILE *) context) == EOF ) ? -1 : 0 ); +} + #endif void pa_globals_destroy(void *) { @@ -333,6 +360,7 @@ void pa_globals_init(Pool& pool) { http_method_name=NEW String(pool, HTTP_METHOD_NAME); http_timeout_name=NEW String(pool, HTTP_TIMEOUT_NAME); http_headers_name=NEW String(pool, HTTP_HEADERS_NAME); + http_any_status_name=NEW String(pool, HTTP_ANY_STATUS_NAME); file_status_name=NEW String(pool, FILE_STATUS_NAME); @@ -547,7 +575,7 @@ void pa_globals_init(Pool& pool) { // http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc xmlRegisterInputCallbacks( xmlFileMatchLocalhost, xmlFileOpenLocalhost, - xmlFileRead, xmlFileClose); + pa_xmlFileRead, pa_xmlFileClose); // XSLT stylesheet manager cache_managers->put(*NEW String(pool, "stylesheet"), @@ -556,7 +584,7 @@ void pa_globals_init(Pool& pool) { } #if defined(XML) && defined(_MSC_VER) -# define GNOME_LIBS "/parser3project/win32xml/win32/gnome" +# define GNOME_LIBS "../../../../win32xml/win32/gnome" # pragma comment(lib, GNOME_LIBS "/glib/lib/libglib-1.3-11.lib") # ifdef _DEBUG # pragma comment(lib, GNOME_LIBS "/libxml2-x.x.x/win32/dsp/libxml2_so_debug/libxml2.lib")