diff --git a/src/util/Platforms/AIX/AIXPlatformUtils.cpp b/src/util/Platforms/AIX/AIXPlatformUtils.cpp index 7e1f46883399c1a4147ca34173a247701b67dd21..9bbc56b89c46a2dc684f521afea022cfdf59ede0 100644 --- a/src/util/Platforms/AIX/AIXPlatformUtils.cpp +++ b/src/util/Platforms/AIX/AIXPlatformUtils.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.10 2000/01/25 22:32:17 aruna1 + * Updated panic information + * * Revision 1.9 2000/01/20 19:37:36 aruna1 * fgLibLocation and writeTo functions eliminated * @@ -220,26 +223,23 @@ XMLMsgLoader* XMLPlatformUtils::loadAMsgSet(const XMLCh* const msgDomain) // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { -// - // We just print a message and exit - // - - fprintf(stderr, - "The Xerces-C system could not be initialized.\n"); - fprintf(stderr, - "If you are using ICU, then the most likely reason for this failure\n"); - fprintf(stderr, - "is the inability to find the ICU coverter files. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the Xerces-C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); exit(-1); } diff --git a/src/util/Platforms/HPUX/HPPlatformUtils.cpp b/src/util/Platforms/HPUX/HPPlatformUtils.cpp index 4b777f9efd94605a5cdc83c5478c18f764397ff7..8d7b00f6e2b0d7d70b3470cc0b1104a302266ca8 100644 --- a/src/util/Platforms/HPUX/HPPlatformUtils.cpp +++ b/src/util/Platforms/HPUX/HPPlatformUtils.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.6 2000/01/25 22:32:45 aruna1 + * Updated panic information + * * Revision 1.5 2000/01/20 20:37:55 abagchi * Removed fgLibLocation and cleaned up ICU path related stuff * @@ -255,27 +258,24 @@ XMLTransService* XMLPlatformUtils::makeTransService() // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { - // - // We just print a message and exit - // - - fprintf(stderr, - "The Xerces-C system could not be initialized.\n"); - fprintf(stderr, - "If you are using ICU, then the most likely reason for this failure\n"); - fprintf(stderr, - "is the inability to find the ICU coverter files. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the Xerces-C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); - + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); + exit(-1); } diff --git a/src/util/Platforms/IRIX/IRIXPlatformUtils.cpp b/src/util/Platforms/IRIX/IRIXPlatformUtils.cpp index 686af2f352423b6bdf6e327fe7d18b601b335fda..936f02b8987dc650fc13b12b0c32a29103c43f08 100644 --- a/src/util/Platforms/IRIX/IRIXPlatformUtils.cpp +++ b/src/util/Platforms/IRIX/IRIXPlatformUtils.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.4 2000/01/25 22:32:35 aruna1 + * Updated panic information + * * Revision 1.3 1999/12/18 00:54:43 rahulj * Merged in changes for IRIX submitted by Marc Stuessel * @@ -366,26 +369,23 @@ XMLTransService* XMLPlatformUtils::makeTransService() // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { - // - // We just print a message and exit - // - - fprintf(stderr, - "The Xerces-C system could not be initialized.\n"); - fprintf(stderr, - "If you are using ICU, then the most likely reason for this failure\n"); - fprintf(stderr, - "is the inability to find the ICU coverter files. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the Xerces-C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); exit(-1); } diff --git a/src/util/Platforms/Linux/LinuxPlatformUtils.cpp b/src/util/Platforms/Linux/LinuxPlatformUtils.cpp index dafe8ea59d9fdd4d57598975d923a8f48bc88fd5..a09ce87e4ba0315617c7d4d9a552a49d52f808f4 100644 --- a/src/util/Platforms/Linux/LinuxPlatformUtils.cpp +++ b/src/util/Platforms/Linux/LinuxPlatformUtils.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.8 2000/01/25 22:32:56 aruna1 + * Updated panic information + * * Revision 1.7 2000/01/19 23:21:37 abagchi * Made this file compatible with ICU 1.4 * @@ -356,26 +359,23 @@ XMLTransService* XMLPlatformUtils::makeTransService() // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { - // - // We just print a message and exit - // - - fprintf(stderr, - "The Xerces-C system could not be initialized.\n"); - fprintf(stderr, - "If you are using ICU, then the most likely reason for this failure\n"); - fprintf(stderr, - "is the inability to find the ICU coverter files. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the Xerces-C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); exit(-1); } diff --git a/src/util/Platforms/Solaris/SolarisPlatformUtils.cpp b/src/util/Platforms/Solaris/SolarisPlatformUtils.cpp index 7320a03ced58963da901e9f8e2eda0355576da95..ebbf9c29fa3e762090231b377b49f140d0e871e6 100644 --- a/src/util/Platforms/Solaris/SolarisPlatformUtils.cpp +++ b/src/util/Platforms/Solaris/SolarisPlatformUtils.cpp @@ -56,8 +56,8 @@ /** * $Log$ - * Revision 1.8 2000/01/25 22:08:27 aruna1 - * Updated panic calls for synchronization and initialization + * Revision 1.9 2000/01/25 22:33:05 aruna1 + * Updated panic information * * Revision 1.7 2000/01/21 20:04:00 abagchi * Removed the code for loadAMsgSet() when invoked with ICU @@ -252,26 +252,24 @@ XMLTransService* XMLPlatformUtils::makeTransService() // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { - // - // We just print a message and exit - // - fprintf(stderr, - "The XML4C system could not be initialized.\n"); - fprintf(stderr, - "The most likely reason for this failure is the inability to find\n"); - fprintf(stderr, - "the ICU coverter files, if you are using ICU. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the XML4C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); exit(-1); } diff --git a/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp b/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp index 9ed75ecce460497a092ac61f8db737c9c525ce4d..343e3862df90e219cca0b540f404da6065b0f49c 100644 --- a/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp +++ b/src/util/Platforms/UnixWare/UnixWarePlatformUtils.cpp @@ -56,6 +56,9 @@ /** * $Log$ + * Revision 1.2 2000/01/25 22:33:13 aruna1 + * Updated panic information + * * Revision 1.1 1999/12/17 22:24:03 rahulj * Added missing UnixWare files to the repository. * @@ -242,11 +245,7 @@ XMLTransService* XMLPlatformUtils::makeTransService() handle = dlopen(libName, RTLD_LAZY); if (!handle) { - char errorBuffer[1024]; - sprintf(errorBuffer, - "Fatal error: Could not open library '%s'", libName); - perror (errorBuffer); - panic(XMLPlatformUtils::Panic_NoTransService); + panic(XMLPlatformUtils::Panic_CantFindLib); } int ret = 0; @@ -277,15 +276,6 @@ XMLTransService* XMLPlatformUtils::makeTransService() if (fgIntlPath == NULL) { - fprintf(stderr, - "Fatal error: Could not find /icu/data relative to %s \n", - libName); - fprintf(stderr, - " while trying to auto detect the location "); - fprintf(stderr, "of the converter files.\n"); - fprintf(stderr, - " And the environment variable 'ICU_DATA' is "); - fprintf(stderr, "not defined.\n"); panic(XMLPlatformUtils::Panic_NoTransService); } @@ -305,26 +295,23 @@ XMLTransService* XMLPlatformUtils::makeTransService() // --------------------------------------------------------------------------- void XMLPlatformUtils::panic(const PanicReasons reason) { - // - // We just print a message and exit - // - - fprintf(stderr, - "The XML4C system could not be initialized.\n"); - fprintf(stderr, - "The most likely reason for this failure is the inability to find\n"); - fprintf(stderr, - "the ICU coverter files, if you are using ICU. The converter files\n"); - fprintf(stderr, - "have the extension .cnv and exist in a directory 'icu/data' relative\n"); - fprintf(stderr, - "to the XML4C shared library. If you have installed the converter files\n"); - fprintf(stderr, - "in a different location, you need to set up the environment variable\n"); - fprintf(stderr, - "'ICU_DATA' to point directly to the directory containing the\n"); - fprintf(stderr, - "converter files.\n"); + const char* reasonStr = "Unknown reason"; + if (reason == Panic_NoTransService) + reasonStr = "Could not load a transcoding service"; + else if (reason == Panic_NoDefTranscoder) + reasonStr = "Could not load a local code page transcoder"; + else if (reason == Panic_CantFindLib) + reasonStr = "Could not find the xerces-c DLL"; + else if (reason == Panic_UnknownMsgDomain) + reasonStr = "Unknown message domain"; + else if (reason == Panic_CantLoadMsgDomain) + reasonStr = "Cannot load message domain"; + else if (reason == Panic_SynchronizationErr) + reasonStr = "Cannot synchronize system or mutex"; + else if (reason == Panic_SystemInit) + reasonStr = "Cannot initialize the system or mutex"; + + fprintf(stderr, "%s\n", reasonStr); exit(-1); }