--- parser3/src/main/pa_globals.C 2003/01/10 16:52:25 1.149 +++ parser3/src/main/pa_globals.C 2003/01/15 10:34:51 1.150 @@ -5,7 +5,7 @@ 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/01/15 10:34:51 $"; #include "pa_config_includes.h" @@ -247,6 +247,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 *) { @@ -547,7 +573,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"),