OSSP CVS Repository

ossp - Check-in [3451]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3451
Date: 2003-Jun-23 18:09:47 (local)
2003-Jun-23 16:09:47 (UTC)
User:ms
Branch:
Comment: Complete error handling method according to all defined error values.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.h      1.49 -> 1.50     4 inserted, 3 deleted
ossp-pkg/rc/rc_const.h      1.27 -> 1.28     1 inserted, 0 deleted
ossp-pkg/rc/rc_error.c      1.1 -> 1.2     12 inserted, 0 deleted
ossp-pkg/rc/rc_util.c      1.9 -> 1.10     1 inserted, 0 deleted

ossp-pkg/rc/rc.h 1.49 -> 1.50

--- rc.h 2003/06/18 14:35:29     1.49
+++ rc.h 2003/06/23 16:09:47     1.50
@@ -63,9 +63,10 @@
     RC_ERR_DIR = 9,  /* Location dir not found   */
     RC_ERR_RCF = 10, /* Rc file not found        */
     RC_ERR_TRM = 11, /* Request to terminate app */
-    RC_WRN_0   = 12, /* Warning base             */
-    RC_WRN_OWR = 13, /* Overwrite warning        */
-    RC_WRN_NUL = 14  /* NULL pointer warning     */
+    RC_ERR_CFG = 12, /* Config or option failure */
+    RC_WRN_0   = 13, /* Warning base             */
+    RC_WRN_OWR = 14, /* Overwrite warning        */
+    RC_WRN_NUL = 15  /* NULL pointer warning     */
 } rc_return_t;
 
 /* Config function prototypes */


ossp-pkg/rc/rc_const.h 1.27 -> 1.28

--- rc_const.h   2003/06/23 14:43:48     1.27
+++ rc_const.h   2003/06/23 16:09:47     1.28
@@ -129,6 +129,7 @@
 #define RC_ERRSTR_DIR "Location"
 #define RC_ERRSTR_RCF "Rcfile"
 #define RC_ERRSTR_TRM "Terminate"
+#define RC_ERRSTR_CFG "Config/Options"
 #define RC_ERRSTR_UNK "Unrecognized"
 #define RC_WRNSTR_OWR "Overwrite"
 #define RC_WRNSTR_NUL "NULLPointer"


ossp-pkg/rc/rc_error.c 1.1 -> 1.2

--- rc_error.c   2002/07/10 19:02:24     1.1
+++ rc_error.c   2003/06/23 16:09:47     1.2
@@ -40,12 +40,24 @@
     if (FAILED((rc_return_t)Localerr.ex_value)) { /* Error condition */
         if ((rc_return_t)Localerr.ex_value == RC_ERR_TRM)
             exit(0);
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_USE)
+            fprintf(stderr, "    Error condition, API usage is wrong.\n");
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_MEM)
+            fprintf(stderr, "    Error condition, memory allocation failure.\n");
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_SYS)
+            fprintf(stderr, "    Error condition, underlying system failure.\n");
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_IO)
+            fprintf(stderr, "    Error condition, input output failure.\n");
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_INT)
+            fprintf(stderr, "    Error condition, internal failure.\n");
         else if ((rc_return_t)Localerr.ex_value == RC_ERR_FNC)
             fprintf(stderr, "    Error condition, function file could not be opened.\n");
         else if ((rc_return_t)Localerr.ex_value == RC_ERR_DIR)
             fprintf(stderr, "    Error condition, location dir could not be opened.\n");
         else if ((rc_return_t)Localerr.ex_value == RC_ERR_RCF)
             fprintf(stderr, "    Error condition, rc file could not be opened.\n");
+        else if ((rc_return_t)Localerr.ex_value == RC_ERR_CFG)
+            fprintf(stderr, "    Error condition, configuration and options failure.\n");
         else
             fprintf(stderr, "    Error condition of class '%s',\n    exception %d in %s:%s():%d.\n", (char *)Localerr.ex_class, (int)Localerr.ex_value, Localerr.ex_file, Localerr.ex_func, Localerr.ex_line);
         exit(1); /* Return failure */


ossp-pkg/rc/rc_util.c 1.9 -> 1.10

--- rc_util.c    2003/05/27 14:51:38     1.9
+++ rc_util.c    2003/06/23 16:09:47     1.10
@@ -47,6 +47,7 @@
     else if (rv == RC_ERR_DIR) return RC_ERRSTR_DIR;
     else if (rv == RC_ERR_RCF) return RC_ERRSTR_RCF;
     else if (rv == RC_ERR_TRM) return RC_ERRSTR_TRM;
+    else if (rv == RC_ERR_CFG) return RC_ERRSTR_CFG;
     else if (rv == RC_WRN_OWR) return RC_WRNSTR_OWR;
     else if (rv == RC_WRN_NUL) return RC_WRNSTR_NUL;
     else                       return RC_ERRSTR_UNK;

CVSTrac 2.0.1