OSSP CVS Repository

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

Check-in Number: 2240
Date: 2002-Jul-05 16:10:24 (local)
2002-Jul-05 14:10:24 (UTC)
User:ms
Branch:
Comment: Prepare for config defaults through addition of the config visitor object.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.c      1.37 -> 1.38     12 inserted, 12 deleted
ossp-pkg/rc/rc_config.c      1.21 -> 1.22     6 inserted, 1 deleted

ossp-pkg/rc/rc.c 1.37 -> 1.38

--- rc.c 2002/07/01 15:03:32     1.37
+++ rc.c 2002/07/05 14:10:24     1.38
@@ -68,23 +68,23 @@
 {
     ex_t Except;
 
-    try {                       /* Configuration block                      */
-        configNew();            /* Construct a new configuration            */
-        configLoad(argc, (const char **)argv);   /* Load cli, env, and conf */
-        configVerify();         /* Test for usage, help and version options */
+    try {                       /* Configuration block                        */
+        configNew();            /* Construct a new config, add default values */
+        configLoad(argc, (const char **)argv);   /* Load cli, env, and conf   */
+        configVerify();         /* Test for usage, help and version options   */
     }
-    catch(Except)               /* Exceptions of the configuration block    */
+    catch(Except)               /* Exceptions of the configuration block      */
         rcError(Except);
 
-    try {                       /* Main processing block, script built here */
+    try {                       /* Main processing block, script 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                */
+        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                  */
     }
-    catch(Except)               /* Exception thrown while script processing */
+    catch(Except)               /* Exception thrown while script processing   */
         rcError(Except);
 
     exit(0);                    /* Return success */


ossp-pkg/rc/rc_config.c 1.21 -> 1.22

--- rc_config.c  2002/07/05 13:27:22     1.21
+++ rc_config.c  2002/07/05 14:10:24     1.22
@@ -55,9 +55,14 @@
     }
     m_nLocks++;                             /* FIXME not threadsafe     */
 
+/* Warn: Experimental design pattern code abstracts operations from config */
+/*    configVisit(pfnSetdefaults);
+    configVisit(pfnGetoptinfo);*/
+
     return(RC_THROW(RC_OK));
 }
 
+/* FIXME: Make into configVisit, using callbacks to get and set option info */
 /***************************************
 * configInfo(void)                     *
 * Print the configuration information  *
@@ -66,7 +71,7 @@
 {
     ex_t Except;
     int i = 0;
-    char **pszTemp = NULL;  /* For holding the section string vector        */
+    char **pszTemp = NULL;  /* For holding the section string vector */
 
     try {
         fprintf(stderr, "Run command file: %s\n", configGetrcfile());

CVSTrac 2.0.1