From d6a432800ee89f942ee268834835ea6c98363fac Mon Sep 17 00:00:00 2001
From: "Unknown (aruna1)" <dev-null@apache.org>
Date: Tue, 25 Jan 2000 22:33:13 +0000
Subject: [PATCH] Updated panic information

git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@171657 13f79535-47bb-0310-9956-ffa450edef68
---
 src/util/Platforms/AIX/AIXPlatformUtils.cpp   | 40 +++++++-------
 src/util/Platforms/HPUX/HPPlatformUtils.cpp   | 42 +++++++-------
 src/util/Platforms/IRIX/IRIXPlatformUtils.cpp | 40 +++++++-------
 .../Platforms/Linux/LinuxPlatformUtils.cpp    | 40 +++++++-------
 .../Solaris/SolarisPlatformUtils.cpp          | 40 +++++++-------
 .../UnixWare/UnixWarePlatformUtils.cpp        | 55 +++++++------------
 6 files changed, 121 insertions(+), 136 deletions(-)

diff --git a/src/util/Platforms/AIX/AIXPlatformUtils.cpp b/src/util/Platforms/AIX/AIXPlatformUtils.cpp
index 7e1f46883..9bbc56b89 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 4b777f9ef..8d7b00f6e 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 686af2f35..936f02b89 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 dafe8ea59..a09ce87e4 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 7320a03ce..ebbf9c29f 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 9ed75ecce..343e3862d 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);
 }
-- 
GitLab