--- rc.c 2002/05/22 13:29:40 1.27
+++ rc.c 2002/05/22 14:32:20 1.28
@@ -29,9 +29,7 @@
#include <stdlib.h>
-#include "rc.h" /* Public interfaces */
-#include "rc_const.h" /* Englisch string constants */
-#include "rc_config.h" /* For RC_XXX_VAL definitions */
+#include "rc.h" /* Public interfaces */
/************************************************
@@ -41,26 +39,26 @@
int main(int argc, char *argv[])
{
ex_t Except;
- rc_anal_t *pAnal = NULL; /* Holds preprocessed configuration */
+ rc_anal_t *pAnal = NULL; /* Holds preprocessed configuration */
- ex_try { /* Configuration and abstract analysis block */
- configNew(); /* Construct a new configuration */
- configLoad(argc, (const char **)argv); /* Load cli, env, and conf */
- configDebug(); /* FIXME Remove FIXME */
- configVerify(); /* Test for usage, help, and version options */
+ ex_try { /* Configuration and abstract analysis block */
+ configNew(); /* Construct a new configuration */
+ 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 */
}
ex_catch(Except) { /* Exceptions thrown during configuration and analysis */
- if ((rc_return_t)Except.ex_value == RC_ERR_USE) {
+ if ((rc_return_t)Except.ex_value == RC_ERR_USE)
clioptPrintusage();
- }
- else if (FAILED((rc_return_t)Except.ex_value))
+ 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);
- exit(1); /* Report failure and exit the program */
+ (char *)Except.ex_class, (int)Except.ex_value,\
+ Except.ex_file, Except.ex_func, Except.ex_line);
+ if (FAILED((rc_return_t)Except.ex_value)) /* NOP on warnings */
+ exit(1); /* Report failure and exit the program */
}
ex_try { /* Main script building and processing block */
@@ -76,12 +74,11 @@
/* 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 */
- }
+ 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 (FAILED((rc_return_t)Except.ex_value)) /* NOP on warnings */
+ exit(1); /* Report failure and exit the program */
}
ex_try { /* Start shutdown of main program */
|