OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc.c versions 1.11 and 1.12
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/rc/rc.c 1.11 -> 1.12

--- rc.c 2002/02/07 15:37:54     1.11
+++ rc.c 2002/02/08 18:36:40     1.12
@@ -31,37 +31,30 @@
 #include <stdlib.h>
 
 #include "rc.h"
-
-#ifdef HAVE_CONFIG_H
-#include "rc_config.h"
-#endif
-
-/* Third party headers for libraries linked in       */
-#include "ex.h"         /* OSSP ex exception library */
+#include "rc_private.h"
 
 
 int main(int argc, char *argv[])
 {
     ex_t Except;
     int bCaught = 0;
+    rc_config_t *pConf = NULL;
 
     ex_try {
-        parseopts(argc, argv);
+        configInit(&pConf);
+        configFill(pConf, argc, argv);
     }
     ex_catch(Except) {
-        if ((rc_return_t)Except.ex_value != RC_ERR_USE)
-            fprintf(stderr, "Nonusage exception: %d\n",\
-                (rc_return_t)Except.ex_value);
         bCaught = 1;
+        fprintf(stderr, "Class '%s' threw exception %s in %s:%s():%d.\n",\
+               (char *)Except.ex_class, *(int *)Except.ex_value,\
+               Except.ex_file, Except.ex_func, Except.ex_line);
+        exit(1);    /* Failure */
     }
-    if (!bCaught) {
-        fprintf(stderr, "No exceptions caught.\n");
-        exit(0); /* Success */
-    }
-    else
-        fprintf(stderr, "Class '%s' threw exception %d in %s:%s():%d.\n",\
-                (char *)Except.ex_class, *(int *)Except.ex_value,\
-                Except.ex_file, Except.ex_func, Except.ex_line);
+    if (!bCaught)
+        fprintf(stderr, "main: No exceptions caught.\n");
 
-    exit(1); /* Failure */
+    if (pConf)      /* If a configuration exists, then burn it */
+        configDestruct(pConf);
+    exit(0);        /* Success */
 }

CVSTrac 2.0.1