OSSP CVS Repository

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

Check-in Number: 2148
Date: 2002-May-22 18:01:49 (local)
2002-May-22 16:01:49 (UTC)
User:ms
Branch:
Comment: Addition of configuration analyiser and related adjustments to other sources.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.c      1.28 -> 1.29     11 inserted, 11 deleted
ossp-pkg/rc/rc.h      1.26 -> 1.27     10 inserted, 0 deleted
ossp-pkg/rc/rc_anal.c      added-> 1.1
ossp-pkg/rc/rc_private.h      1.12 -> 1.13     2 inserted, 2 deleted

ossp-pkg/rc/rc.c 1.28 -> 1.29

--- rc.c 2002/05/22 14:32:20     1.28
+++ rc.c 2002/05/22 16:01:49     1.29
@@ -41,16 +41,16 @@
     ex_t Except;
     rc_anal_t *pAnal = NULL;    /* Holds preprocessed configuration       */
 
-    ex_try {            /* Configuration and abstract analysis block      */
-        configNew();    /* Construct a new 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      */
+        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 configuration analyser     */
+        analParse(pAnal);   /* Preprocess the analysed configuration      */
     }
-    ex_catch(Except) { /* Exceptions thrown during configuration and analysis */
+    ex_catch(Except) {      /* Exceptions during configuration and analysis */
         if ((rc_return_t)Except.ex_value == RC_ERR_USE)
             clioptPrintusage();
         else
@@ -63,7 +63,7 @@
 
     ex_try { /* Main script building and processing block */
 /*        rc_script_t *pScript = NULL;*/
-        rc_proc_t *pProc     = NULL;
+/*        rc_proc_t *pProc     = NULL;*/
 
 /*        pScript = scriptNew(pAnal);*/ /* Construct a new script           */
 /*        scriptBuild(pScript);*/
@@ -81,9 +81,9 @@
             exit(1); /* Report failure and exit the program */
     }
 
-    ex_try { /* Start shutdown of main program */
-/*        analDelete(pAnal);*/          /* Destroy the analyzer             */
-        configDelete();             /* Destroy the configuration        */
+    ex_try {           /* Start shutdown of main program */
+        analDelete(pAnal);  /* Destroy the analyser      */
+        configDelete();     /* Destroy the configuration */
     }
     ex_catch(Except) { /* Error exceptions thrown during program shutdown */
         if (FAILED((rc_return_t)Except.ex_value)) {


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

--- rc.h 2002/05/22 13:29:40     1.26
+++ rc.h 2002/05/22 16:01:49     1.27
@@ -93,6 +93,16 @@
 rc_return_t clioptSetrcfile(const char *);
 rc_return_t clioptSetsecs(const char **);
 
+/* Analyser function prototypes */
+rc_anal_t *analNew(void);
+rc_return_t analDelete(rc_anal_t *);
+rc_return_t analRcs(rc_anal_t *, const char *);
+rc_return_t analTmp(rc_anal_t *, const char *);
+rc_return_t analFuncs(rc_anal_t *, const char *);
+rc_return_t analLocs(rc_anal_t *, const char *);
+rc_return_t analSecs(rc_anal_t *, const char **);
+rc_return_t analParse(rc_anal_t *);
+
 /* Processor function prototypes */
 rc_proc_t *procNew(void);
 rc_return_t procDelete(rc_proc_t *);


ossp-pkg/rc/rc_anal.c -> 1.1

*** /dev/null    Sat Nov 23 01:32:35 2024
--- -    Sat Nov 23 01:32:35 2024
***************
*** 0 ****
--- 1,130 ----
+ /*  OSSP rc - Run-command processor
+ **  Copyright (c) 2002 Ralf S. Engelschall
+ **  Copyright (c) 2002 Cable & Wireless Deutschland GmbH
+ **  Copyright (c) 2002 The OSSP Project <http://www.ossp.org/>
+ **
+ **  This file is part of OSSP rc, a portable Run-command processor
+ **  which can be found at http://www.ossp.org/pkg/lib/rc/
+ **
+ **  Permission to use, copy, modify, and distribute this software for
+ **  any purpose with or without fee is hereby granted, provided that
+ **  the above copyright notice and this permission notice appear in all
+ **  copies.
+ **
+ **  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ **  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ **  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ **  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+ **  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ **  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ **  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ **  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ **  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ **  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ **  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ **  SUCH DAMAGE.
+ **
+ **  rc_anal.c: Run-command processor ISO C source file
+ */
+ 
+ #include <stdlib.h>
+ 
+ #include "rc.h"         /* Public interfaces        */
+ #include "rc_config.h"  /* Configuration interface  */
+ 
+ 
+ /************************************************
+ * analNew(void)                                 *
+ * Construct a new analyser                      *
+ ************************************************/
+ rc_anal_t *analNew(void)
+ {
+     rc_anal_t *pNew = NULL;
+ 
+     pNew = malloc(sizeof(rc_anal_t));
+     return(pNew);
+ }
+ 
+ /************************************************
+ * private analRcs(rc_anal_t *, const char *)    *
+ * Read a rc file identifier to analyse          *
+ ************************************************/
+ rc_return_t analRcs(rc_anal_t *pInst, const char *kszName)
+ {
+     TRACE(kszName);
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * private analTmp(rc_anal_t *, const char *)    *
+ * Read a temp file to use for analysis          *
+ ************************************************/
+ rc_return_t analTmp(rc_anal_t *pInst, const char *kszName)
+ {
+     TRACE(kszName);
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * private analFuncs(rc_anal_t *, const char *)  *
+ * Read a functions file to analyse              *
+ ************************************************/
+ rc_return_t analFuncs(rc_anal_t *pInst, const char *kszName)
+ {
+     TRACE(kszName);
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * private analLocs(rc_anal_t *, const char *)   *
+ * Read a location path expression to analyse    *
+ ************************************************/
+ rc_return_t analLocs(rc_anal_t *pInst, const char *kszPathexpr)
+ {
+     TRACE(kszPathexpr);
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * private analSecs(rc_anal_t *, const char **)  *
+ * Read a sections vector to analyse             *
+ ************************************************/
+ rc_return_t analSecs(rc_anal_t *pInst, const char **pkszVector)
+ {
+     TRACE("Variable pkszVector is not an ANSI string.");
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * analParse(rc_anal_t *)                        *
+ * Parse the analyzed configuration data         *
+ ************************************************/
+ rc_return_t analParse(rc_anal_t *pInst)
+ {
+     ex_t Except;
+ 
+     assert(pInst); /* Verify sanity */
+     ex_try { /* Read in data from the main configuration */
+         analRcs  (pInst, configGetrcfile());
+         analTmp  (pInst, configGetval(RC_TMP_VAL));
+         analFuncs(pInst, configGetval(RC_FNC_VAL));
+         analLocs (pInst, configGetval(RC_LOC_VAL));
+         analSecs (pInst, configGetsecs());
+     }
+     ex_catch(Except) {
+         rethrow;
+     }
+ 
+     return(RC_THROW(RC_OK));
+ }
+ 
+ /************************************************
+ * analDelete(rc_anal_t *)                       *
+ * Destruct an analyser                          *
+ ************************************************/
+ rc_return_t analDelete(rc_anal_t *pInst)
+ {
+     free(pInst);
+ 
+     return(RC_THROW(RC_OK));
+ }


ossp-pkg/rc/rc_private.h 1.12 -> 1.13

--- rc_private.h 2002/05/22 13:29:40     1.12
+++ rc_private.h 2002/05/22 16:01:49     1.13
@@ -41,8 +41,8 @@
 #define TRACE(str)  ((void)0)
 #define TRACEL(num) ((void)0)
 #else
-#define TRACE(str)  fprintf(stderr, "%s:%d: %s", __FILE__, __LINE__, str)
-#define TRACEL(num) fprintf(stderr, "%s:%d: %ld", __FILE__, __LINE__, (long int)num)
+#define TRACE(str)  fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, str)
+#define TRACEL(num) fprintf(stderr, "%s:%d: %ld\n", __FILE__, __LINE__, (long int)num)
 #endif
 
 /* The GUID for OSSP rc */

CVSTrac 2.0.1