|
|
| version 1.149, 2003/01/10 16:52:25 | version 1.155, 2003/04/11 15:00:05 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: globals. | 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 <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| Line 74 String *sql_offset_name; | Line 74 String *sql_offset_name; |
| String *sql_default_name; | String *sql_default_name; |
| String *sql_distinct_name; | String *sql_distinct_name; |
| String *table_reverse_name; | |
| String *charset_UTF8_name; | String *charset_UTF8_name; |
| String *hash_default_element_name; | String *hash_default_element_name; |
| Line 81 String *hash_default_element_name; | Line 83 String *hash_default_element_name; |
| String *http_method_name; | String *http_method_name; |
| String *http_timeout_name; | String *http_timeout_name; |
| String *http_headers_name; | String *http_headers_name; |
| String *http_any_status_name; | |
| String *file_status_name; | String *file_status_name; |
| Line 247 xmlFileOpenLocalhost (const char *filena | Line 250 xmlFileOpenLocalhost (const char *filena |
| return((void *) fd); | 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 | #endif |
| void pa_globals_destroy(void *) { | void pa_globals_destroy(void *) { |
| Line 323 void pa_globals_init(Pool& pool) { | Line 352 void pa_globals_init(Pool& pool) { |
| sql_default_name=NEW String(pool, SQL_DEFAULT_NAME); | sql_default_name=NEW String(pool, SQL_DEFAULT_NAME); |
| sql_distinct_name=NEW String(pool, SQL_DISTINCT_NAME); | sql_distinct_name=NEW String(pool, SQL_DISTINCT_NAME); |
| // table | |
| table_reverse_name=NEW String(pool, TABLE_REVERSE_NAME); | |
| // charsets | // charsets |
| charset_UTF8_name=NEW String(pool, CHARSET_UTF8_NAME); | charset_UTF8_name=NEW String(pool, CHARSET_UTF8_NAME); |
| Line 333 void pa_globals_init(Pool& pool) { | Line 365 void pa_globals_init(Pool& pool) { |
| http_method_name=NEW String(pool, HTTP_METHOD_NAME); | http_method_name=NEW String(pool, HTTP_METHOD_NAME); |
| http_timeout_name=NEW String(pool, HTTP_TIMEOUT_NAME); | http_timeout_name=NEW String(pool, HTTP_TIMEOUT_NAME); |
| http_headers_name=NEW String(pool, HTTP_HEADERS_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); | file_status_name=NEW String(pool, FILE_STATUS_NAME); |
| Line 358 void pa_globals_init(Pool& pool) { | Line 391 void pa_globals_init(Pool& pool) { |
| exif_tag_value2name=NEW Hash(pool); | exif_tag_value2name=NEW Hash(pool); |
| #define EXIF_TAG(tag, name) \ | #define EXIF_TAG(tag, name) \ |
| { \ | { \ |
| char *buf=(char *)malloc(MAX_NUMBER); \ | char *buf=(char *)pool.malloc(MAX_NUMBER); \ |
| snprintf(buf, MAX_NUMBER, "%u", tag); \ | snprintf(buf, MAX_NUMBER, "%u", tag); \ |
| exif_tag_value2name->put(*NEW String(pool, buf), (void *)#name); \ | exif_tag_value2name->put(*NEW String(pool, buf), (void *)#name); \ |
| } | } |
| Line 547 void pa_globals_init(Pool& pool) { | Line 580 void pa_globals_init(Pool& pool) { |
| // http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc | // http://localhost/abc -> $ENV{DOCUMENT_ROOT}/abc | ./abc |
| xmlRegisterInputCallbacks( | xmlRegisterInputCallbacks( |
| xmlFileMatchLocalhost, xmlFileOpenLocalhost, | xmlFileMatchLocalhost, xmlFileOpenLocalhost, |
| xmlFileRead, xmlFileClose); | pa_xmlFileRead, pa_xmlFileClose); |
| // XSLT stylesheet manager | // XSLT stylesheet manager |
| cache_managers->put(*NEW String(pool, "stylesheet"), | cache_managers->put(*NEW String(pool, "stylesheet"), |
| Line 556 void pa_globals_init(Pool& pool) { | Line 589 void pa_globals_init(Pool& pool) { |
| } | } |
| #if defined(XML) && defined(_MSC_VER) | #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") | # pragma comment(lib, GNOME_LIBS "/glib/lib/libglib-1.3-11.lib") |
| # ifdef _DEBUG | # ifdef _DEBUG |
| # pragma comment(lib, GNOME_LIBS "/libxml2-x.x.x/win32/dsp/libxml2_so_debug/libxml2.lib") | # pragma comment(lib, GNOME_LIBS "/libxml2-x.x.x/win32/dsp/libxml2_so_debug/libxml2.lib") |