--- rc.c 2002/06/05 16:24:20 1.31
+++ rc.c 2002/06/26 14:11:16 1.32
@@ -39,19 +39,15 @@
int main(int argc, char *argv[])
{
ex_t Except;
- rc_anal_t *pAnal = NULL; /* Holds preprocessed configuration */
- ex_try { /* Configuration and abstract analysis block */
+ ex_try { /* Configuration 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 configuration analyser */
- analParse(pAnal); /* Preprocess the analysed configuration */
}
- ex_catch(Except) { /* Exceptions during configuration and analysis */
- TRACE("Hopla, in config and anal exception block");
+ ex_catch(Except) { /* Exceptions of the configuration block */
+ TRACE("Hopla, in config exception block");
if ((rc_return_t)Except.ex_value == RC_ERR_USE) {
clioptPrintusage();
}
@@ -60,44 +56,28 @@
(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 */
- }
- else {
- }
- }
-
- ex_try { /* Main script building and processing block */
-/* rc_script_t *pScript = NULL;*/
-/* rc_proc_t *pProc = NULL;*/
-
-/* 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) { /* Error 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);
if (FAILED((rc_return_t)Except.ex_value)) /* NOP on warnings */
exit(1); /* Report failure and exit the program */
}
- ex_try { /* Shutdown of main program */
- analDelete(pAnal); /* Destroy the analyser */
- configDelete(); /* Destroy the configuration */
+ ex_try { /* Main processing block, the script is built here */
+ rc_proc_t *pProc = NULL;
+ pProc = procNew(); /* Construct a new processor, build script */
+ procPopulate(pProc); /* Populate with run commands */
+ procRun(pProc); /* [Execute|Evaluate|Print] script */
+ procDelete(pProc); /* Destroy the processor */
+ configDelete(); /* Destroy the configuration */
}
- ex_catch(Except) { /* Error exceptions thrown during program shutdown */
+ ex_catch(Except) { /* Error exceptions thrown during script processing */
+ TRACE("Also, exception dans le processor bloque");
if (FAILED((rc_return_t)Except.ex_value)) { /* NOP on warnings */
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 */
}
+ else
+ RC_NOP; /* No operation on warnings */
}
exit(0); /* Return success */
|