OSSP CVS Repository

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

ossp-pkg/rc/rc.c 1.26 -> 1.27

--- rc.c 2002/05/22 09:47:27     1.26
+++ rc.c 2002/05/22 13:29:40     1.27
@@ -45,18 +45,18 @@
 
     ex_try { /* Configuration and abstract analysis block */
         configNew();            /* Construct a new configuration              */
-        configLoad(argc, argv); /* Read configuration from cli, env, and conf */
+        configLoad(argc, (const char **)argv); /* Load cli, env, and conf     */
         configDebug();          /* FIXME Remove FIXME */
         configVerify();         /* Test for usage, help, and version options  */
 
-        pAnal = analNew();      /* Construct a new analyzer                   */
-        analParse(pAnal);       /* Preprocess the analyzed configuration      */
+/*        pAnal = analNew();*/      /* Construct a new analyzer                   */
+/*        analParse(pAnal);*/       /* Preprocess the analyzed configuration      */
     }
     ex_catch(Except) { /* Exceptions thrown during configuration and analysis */
         if ((rc_return_t)Except.ex_value == RC_ERR_USE) {
             clioptPrintusage();
         }
-        else
+        else if (FAILED((rc_return_t)Except.ex_value))
             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);
@@ -64,33 +64,37 @@
     }
 
     ex_try { /* Main script building and processing block */
-        rc_script_t *pScript = NULL;
+/*        rc_script_t *pScript = NULL;*/
         rc_proc_t *pProc     = NULL;
 
-        pScript = scriptNew(pAnal); /* Construct a new script           */
-        scriptBuild(pScript);
+/*        pScript = scriptNew(pAnal);*/ /* Construct a new script           */
+/*        scriptBuild(pScript);*/
 
-        pProc = procNew(pScript);   /* Construct a new processor        */
-        procRun(pProc);             /* [Execute|Evaluate|Print] script  */
-        procDelete(pProc);          /* Destroy the processor            */
-        scriptDelete(pScript);      /* Destroy the script               */
-    }
-    ex_catch(Except) {  /* Exceptions thrown during script processing   */
-        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);
-        exit(1);        /* Return failure */
+/*        pProc = procNew(pScript);*/   /* Construct a new processor        */
+/*        procRun(pProc);*/             /* [Execute|Evaluate|Print] script  */
+/*        procDelete(pProc);*/          /* Destroy the processor            */
+/*        scriptDelete(pScript);*/      /* Destroy the script               */
+    }
+    ex_catch(Except) {  /* Error exceptions thrown during script processing */
+        if (FAILED((rc_return_t)Except.ex_value)) {
+            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);
+            exit(1); /* Return failure */
+        }
     }
 
     ex_try { /* Start shutdown of main program */
-        analDelete(pAnal);          /* Destroy the analyzer             */
+/*        analDelete(pAnal);*/          /* Destroy the analyzer             */
         configDelete();             /* Destroy the configuration        */
     }
-    ex_catch(Except) { /* Exceptions thrown during program shutdown     */
-        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);
-        exit(1);    /* Return failure */
+    ex_catch(Except) { /* Error exceptions thrown during program shutdown */
+        if (FAILED((rc_return_t)Except.ex_value)) {
+            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);
+            exit(1); /* Return failure */
+        }
     }
 
     exit(0);        /* Return success */

CVSTrac 2.0.1