--- parser3/src/main/pa_globals.C 2005/12/08 10:02:45 1.178.2.1 +++ parser3/src/main/pa_globals.C 2009/10/13 06:31:59 1.184 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_GLOBALS_C="$Date: 2005/12/08 10:02:45 $"; +static const char * const IDENT_GLOBALS_C="$Date: 2009/10/13 06:31:59 $"; #include "pa_config_includes.h" @@ -18,8 +18,6 @@ extern "C" { }; #endif -#include "pcre.h" - #include "pa_globals.h" #include "pa_string.h" #include "pa_sapi.h" @@ -29,6 +27,8 @@ extern "C" { #include "pa_cache_managers.h" +#include "pcre.h" + // defines //#define PA_DEBUG_XML_GC_MEMORY @@ -43,10 +43,6 @@ extern "C" { short hex_value[0x100]; -#ifdef XML -GdomeDOMImplementation *domimpl; -#endif - static void setup_hex_value() { memset(hex_value, 0, sizeof(hex_value)); hex_value['0'] = 0; @@ -151,15 +147,14 @@ const char* xmlGenericErrors() { #endif void pa_globals_destroy(void *) { +/* try { #ifdef XML - GdomeException exc; - gdome_di_unref (domimpl, &exc); - // uncomment SAPI::abort below if adding potential-throw code here #endif - } catch(.../*const Exception& e*/) { + } catch(.../*const Exception& e* /) { // SAPI::abort("pa_globals_destroy failed: %s", e.comment()); } +*/ } @@ -172,7 +167,7 @@ static char *pa_GC_strdup(const char *s) size_t size=strlen(s)+1; char *result=(char *)GC_MALLOC_ATOMIC(size); if(!result) - SAPI::abort("out of memory (while duplicating XML string [size=%d])", size); + pa_fail_alloc("duplicate XML string",size); memcpy(result, s, size); #ifdef PA_DEBUG_XML_GC_MEMORY @@ -239,22 +234,22 @@ static void pa_gc_free_log(void *p){ inline void *check(void *result, const char *where, size_t size) { if(!result) - SAPI::abort("out of memory (while %s [size=%d])", where, size); + pa_fail_alloc(where, size); return result; } static void* pa_gc_malloc_nonull(size_t size) { - return check(pa_gc_malloc(size), "allocating XML compsite memory", size); + return check(pa_gc_malloc(size), "allocate XML compsite memory", size); } static void* pa_gc_malloc_atomic_nonull(size_t size) { #ifdef PA_WORKAROUND_BUGGY_MALLOCATOMIC_IN_LIBXML_GC_MEMORY - return check(pa_gc_malloc(size), "allocating XML composite memory (asked atomic)", size); + return check(pa_gc_malloc(size), "allocate XML composite memory (asked atomic)", size); #else - return check(pa_gc_malloc_atomic(size), "allocating XML atomic memory", size); + return check(pa_gc_malloc_atomic(size), "allocate XML atomic memory", size); #endif } static void* pa_gc_realloc_nonull(void* ptr, size_t size) { - return check(pa_gc_realloc(ptr, size), "reallocating XML memory", size); + return check(pa_gc_realloc(ptr, size), "reallocate XML memory", size); } static void pa_gc_free_maybeignore( @@ -272,7 +267,7 @@ static void pa_gc_free_maybeignore( #endif void pa_CORD_oom_fn(void) { - SAPI::abort("out of memory (while expanding string)"); + pa_fail_alloc("expand string", 0); } /** @@ -335,8 +330,6 @@ void pa_globals_init() { #ifdef XML // initializing xml libs - /* First get a DOMImplementation reference */ - domimpl = gdome_di_mkref (); /* * Register the EXSLT extensions and the test module */ @@ -401,9 +394,13 @@ void pa_globals_done() { #endif -#ifdef XML -# define GNOME_LIBS "../../../../win32/gnome" +#define GNOME_LIBS "../../../../win32/gnome" + +#ifdef WITH_MAILRECEIVE # pragma comment(lib, GNOME_LIBS "/glib/lib/libglib-1.3-11.lib") +#endif + +#ifdef XML # ifdef _DEBUG # ifdef LIBXML_STATIC @@ -423,12 +420,6 @@ void pa_globals_done() { # pragma comment(lib, GNOME_LIBS "/libxslt-x.x.x/win32/debug/lib/libexslt.lib") # endif -# ifdef LIBGDOME_STATIC -# pragma comment(lib, GNOME_LIBS "/gdome2-x.x.x/win32/DebugStatic/libgdome.lib") -# else -# pragma comment(lib, GNOME_LIBS "/gdome2-x.x.x/win32/DebugDynamic/libgdome.lib") -# endif - #else # ifdef LIBXML_STATIC @@ -448,12 +439,6 @@ void pa_globals_done() { # pragma comment(lib, GNOME_LIBS "/libxslt-x.x.x/win32/release/lib/libexslt.lib") # endif -# ifdef LIBGDOME_STATIC -# pragma comment(lib, GNOME_LIBS "/gdome2-x.x.x/win32/ReleaseStatic/libgdome.lib") -# else -# pragma comment(lib, GNOME_LIBS "/gdome2-x.x.x/win32/ReleaseDynamic/libgdome.lib") -# endif - # endif #endif