OSSP CVS Repository

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

Check-in Number: 2066
Date: 2002-Apr-12 21:15:12 (local)
2002-Apr-12 19:15:12 (UTC)
User:ms
Branch:
Comment: Flush configuration and parsing work.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc.c      1.18 -> 1.19     30 inserted, 3 deleted
ossp-pkg/rc/rc.h      1.17 -> 1.18     2 inserted, 1 deleted
ossp-pkg/rc/rc_cliopt.c      1.2 -> 1.3     144 inserted, 150 deleted
ossp-pkg/rc/rc_config.c      1.9 -> 1.10     31 inserted, 9 deleted
ossp-pkg/rc/rc_private.h      1.10 -> 1.11     2 inserted, 2 deleted
ossp-pkg/rc/rc_test.sh      1.7 -> 1.8     14 inserted, 5 deleted

ossp-pkg/rc/rc.c 1.18 -> 1.19

--- rc.c 2002/04/11 16:52:45     1.18
+++ rc.c 2002/04/12 19:15:12     1.19
@@ -34,6 +34,10 @@
 #include "rc_const.h"
 #include "rc_private.h"
 
+/* FIXME BEGIN DEBUG */
+#include "rc_config.h"
+#include <string.h>
+/* FIXME END DEBUG */
 
 int main(int argc, char *argv[])
 {
@@ -47,8 +51,8 @@
         procConf(szEnvass, szSecdef, szSecref, szSecparm);
         procParse();
         procSec(szUmask, szUser, szGroup);
-        procEval(szSection1, szSection2, ...);*/
-        configDestruct();
+        procEval(szSection1, szSection2, ...);
+        configDestruct();*/
     }
     ex_catch(Except) {
         if ((int)Except.ex_value == RC_CNF_VRS)
@@ -60,6 +64,29 @@
         exit(1);        /* Failure */
     }
 
-TRACE("No exceptions caught");
+/* FIXME BEGIN DEBUG */
+{
+int i = 0;
+int bCaught = FALSE;
+while (!bCaught) {
+    ex_try {
+        if (configGetval(i)) {
+            fprintf(stderr, "D Option %s: ", configGetname(i));
+            if (!(strcmp(configGetval(i), "1")))
+                fprintf(stderr, "on\n");
+            else
+                fprintf(stderr, "%s\n", configGetval(i));
+        }
+    }
+    ex_catch(Except) {
+        bCaught = TRUE;
+    }
+    i++;
+}
+}
+/* FIXME END DEBUG */
+
+configDestruct();/* FIXME Remove, allow first scope */
+TRACE("No exceptions caught\n");
     exit(0);            /* Success */
 }


ossp-pkg/rc/rc.h 1.17 -> 1.18

--- rc.h 2002/04/11 16:52:45     1.17
+++ rc.h 2002/04/12 19:15:12     1.18
@@ -66,7 +66,8 @@
 rc_return_t configDestruct(void);
 
 /* Config accessor prototypes */
-const char *configGetoptval(rc_opt_t);
+const char *configGetval(rc_opt_t);
+const char *configGetname(rc_opt_t);
 
 /* Command line function prototypes */
 rc_return_t clioptConstruct(void);


ossp-pkg/rc/rc_cliopt.c 1.2 -> 1.3

--- rc_cliopt.c  2002/04/11 16:52:45     1.2
+++ rc_cliopt.c  2002/04/12 19:15:12     1.3
@@ -36,46 +36,7 @@
 #include "rc_config.h"
 #include "popt.h"       /* OSSP popt options library    */
 
-static char *s_szOptuples[RC_NUMOPTS];  /* Option name value tuples */
-static struct popt_option optionsTable[] = {
-    /* Long options with short keys but no arguments */
-    { RC_USE_NAME, '?', POPT_ARG_NONE,   0, RC_USE_VAL, RC_USE_DESC, NULL },
-    { RC_DBG_NAME, 'd', POPT_ARG_NONE,   0, RC_DBG_VAL, RC_DBG_DESC, NULL },
-    { RC_VER_NAME, 'V', POPT_ARG_NONE,   0, RC_VER_VAL, RC_VER_DESC, NULL },
-    { RC_EVL_NAME, 'e', POPT_ARG_NONE,   0, RC_EVL_VAL, RC_EVL_DESC, NULL },
-    { RC_HLP_NAME, 'h', POPT_ARG_NONE,   0, RC_HLP_VAL, RC_HLP_DESC, NULL },
-    { RC_INF_NAME, 'i', POPT_ARG_NONE,   0, RC_INF_VAL, RC_INF_DESC, NULL },
-    { RC_LBL_NAME, 'l', POPT_ARG_NONE,   0, RC_LBL_VAL, RC_LBL_DESC, NULL },
-    { RC_PRN_NAME, 'p', POPT_ARG_NONE,   0, RC_PRN_VAL, RC_PRN_DESC, NULL },
-    { RC_SIL_NAME, 's', POPT_ARG_NONE,   0, RC_SIL_VAL, RC_SIL_DESC, NULL },
-    { RC_RAW_NAME, 'r', POPT_ARG_NONE,   0, RC_RAW_VAL, RC_RAW_DESC, NULL },
-    { RC_VRB_NAME, 'v', POPT_ARG_NONE,   0, RC_VRB_VAL, RC_VRB_DESC, NULL },
-    { RC_EXC_NAME, 'x', POPT_ARG_NONE,   0, RC_EXC_VAL, RC_EXC_DESC, NULL },
-                                          
-    /* Single argument long options with short keys */
-    {RC_LOC_NAME, 'L', POPT_ARG_STRING, 0, RC_LOC_VAL, RC_LOC_DESC, "regx"},
-    {RC_CNF_NAME, 'c', POPT_ARG_STRING, 0, RC_CNF_VAL, RC_CNF_DESC, "path"},
-    {RC_FNC_NAME, 'f', POPT_ARG_STRING, 0, RC_FNC_VAL, RC_FNC_DESC, "path"},
-    {RC_QRY_NAME, 'q', POPT_ARG_STRING, 0, RC_QRY_VAL, RC_QRY_DESC, "varx"},
-    {RC_TMP_NAME, 't', POPT_ARG_STRING, 0, RC_TMP_VAL, RC_TMP_DESC, "path"},
-
-    /* Single argument long options without short keys */
-    { RC_OWN_NAME, 0, POPT_ARG_STRING, 0, RC_OWN_VAL, RC_OWN_DESC, "user" },
-    { RC_GRP_NAME, 0, POPT_ARG_STRING, 0, RC_GRP_VAL, RC_GRP_DESC, "group"},
-    { RC_MSK_NAME, 0, POPT_ARG_INT,    0, RC_MSK_VAL, RC_MSK_DESC, "umask"},
-    { RC_ASS_NAME, 0, POPT_ARG_STRING, 0, RC_ASS_VAL, RC_ASS_DESC, "regx" },
-    { RC_DEF_NAME, 0, POPT_ARG_STRING, 0, RC_DEF_VAL, RC_DEF_DESC, "regx" },
-    { RC_REF_NAME, 0, POPT_ARG_STRING, 0, RC_REF_VAL, RC_REF_DESC, "regx" },
-    { RC_PRM_NAME, 0, POPT_ARG_STRING, 0, RC_PRM_VAL, RC_PRM_DESC, "regx" },
-    { RC_TRM_NAME, 0, POPT_ARG_STRING, 0, RC_TRM_VAL, RC_TRM_DESC, "regx" },
-    { RC_NCF_NAME, 0, POPT_ARG_STRING, 0, RC_NCF_VAL, RC_NCF_DESC, "name" },
-    { RC_CMN_NAME, 0, POPT_ARG_STRING, 0, RC_CMN_VAL, RC_CMN_DESC, "name" },
-    { RC_DFL_NAME, 0, POPT_ARG_STRING, 0, RC_DFL_VAL, RC_DFL_DESC, "name" },
-    { RC_ERR_NAME, 0, POPT_ARG_STRING, 0, RC_ERR_VAL, RC_ERR_DESC, "name" },
-
-    POPT_AUTOHELP
-    { NULL, 0, 0, NULL, 0 }
-};
+static char *m_szOptuples[RC_NUMOPTS];  /* Option name value tuples */
 
 
 /***************************************
@@ -94,9 +55,9 @@
 /*    s_pBintab->pOptlist->pvData = NULL;
     s_pBintab->pOptlist->pvNext = NULL;*/
 
-    memset(s_szOptuples, NULL, sizeof(s_szOptuples));
+    memset(m_szOptuples, NULL, sizeof(m_szOptuples));
 
-TRACE("cliopt constructed.");
+TRACE("cliopt constructed.\n");
     return(RC_THROW(RC_OK));
 }
 
@@ -106,16 +67,10 @@
 ***************************************/
 const char *clioptGetval(rc_opt_t Optname)
 {
-    ex_t Except;
+    if (!(Optname < RC_NUMOPTS))    /* Validate option range    */
+        RC_THROW(RC_ERR_USE);
 
-    assert(Optname < RC_NUMOPTS);   /* Invalidate if nonexistent option */
-    ex_try {
-        return((const char *)s_szOptuples[Optname]);
-    }
-    ex_catch(Except) {
-        rethrow;
-    }
-    return (NULL);  /* Not reached  */
+    return((const char *)m_szOptuples[Optname]);
 }
 
 /***************************************
@@ -136,95 +91,95 @@
 rc_return_t clioptProcess(int cliOption)
 {
     switch (cliOption) {
-    case RC_USE_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_DBG_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_VER_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_EVL_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_HLP_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_INF_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_LBL_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_PRN_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_SIL_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_RAW_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_VRB_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_EXC_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_LOC_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_CNF_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_FNC_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_QRY_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_TMP_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_OWN_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_GRP_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_MSK_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_ASS_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_DEF_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_REF_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_PRM_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_TRM_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_NCF_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_CMN_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_DFL_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    case RC_ERR_VAL:
-        s_szOptuples[cliOption] = strdup("1");
-        break;
-    default :
-        break;
+        case RC_USE_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_DBG_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_VER_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_EVL_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_HLP_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_INF_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_LBL_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_PRN_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_SIL_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_RAW_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_VRB_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_EXC_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_LOC_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_CNF_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_FNC_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_QRY_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_TMP_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_OWN_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_GRP_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_MSK_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_ASS_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_DEF_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_REF_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_PRM_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_TRM_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_NCF_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_CMN_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_DFL_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        case RC_ERR_VAL:
+            m_szOptuples[cliOption] = strdup("1");
+            break;
+        default :
+            break;
     }
 
     return(RC_THROW(RC_OK));
@@ -236,6 +191,47 @@
 ***************************************/
 rc_return_t clioptParse(int argc, char *argv[])
 {
+    static struct popt_option optionsTable[] = {
+        /* Long options with short keys but no arguments */
+        { RC_USE_NAME, '?', POPT_ARG_NONE,   0, RC_USE_VAL, RC_USE_DESC, NULL },
+        { RC_DBG_NAME, 'd', POPT_ARG_NONE,   0, RC_DBG_VAL, RC_DBG_DESC, NULL },
+        { RC_VER_NAME, 'V', POPT_ARG_NONE,   0, RC_VER_VAL, RC_VER_DESC, NULL },
+        { RC_EVL_NAME, 'e', POPT_ARG_NONE,   0, RC_EVL_VAL, RC_EVL_DESC, NULL },
+        { RC_HLP_NAME, 'h', POPT_ARG_NONE,   0, RC_HLP_VAL, RC_HLP_DESC, NULL },
+        { RC_INF_NAME, 'i', POPT_ARG_NONE,   0, RC_INF_VAL, RC_INF_DESC, NULL },
+        { RC_LBL_NAME, 'l', POPT_ARG_NONE,   0, RC_LBL_VAL, RC_LBL_DESC, NULL },
+        { RC_PRN_NAME, 'p', POPT_ARG_NONE,   0, RC_PRN_VAL, RC_PRN_DESC, NULL },
+        { RC_SIL_NAME, 's', POPT_ARG_NONE,   0, RC_SIL_VAL, RC_SIL_DESC, NULL },
+        { RC_RAW_NAME, 'r', POPT_ARG_NONE,   0, RC_RAW_VAL, RC_RAW_DESC, NULL },
+        { RC_VRB_NAME, 'v', POPT_ARG_NONE,   0, RC_VRB_VAL, RC_VRB_DESC, NULL },
+        { RC_EXC_NAME, 'x', POPT_ARG_NONE,   0, RC_EXC_VAL, RC_EXC_DESC, NULL },
+                                              
+        /* Single argument long options with short keys */
+        {RC_LOC_NAME, 'L', POPT_ARG_STRING, 0, RC_LOC_VAL, RC_LOC_DESC, "regx"},
+        {RC_CNF_NAME, 'c', POPT_ARG_STRING, 0, RC_CNF_VAL, RC_CNF_DESC, "path"},
+        {RC_FNC_NAME, 'f', POPT_ARG_STRING, 0, RC_FNC_VAL, RC_FNC_DESC, "path"},
+        {RC_QRY_NAME, 'q', POPT_ARG_STRING, 0, RC_QRY_VAL, RC_QRY_DESC, "varx"},
+        {RC_TMP_NAME, 't', POPT_ARG_STRING, 0, RC_TMP_VAL, RC_TMP_DESC, "path"},
+
+        /* Single argument long options without short keys */
+        { RC_OWN_NAME, 0, POPT_ARG_STRING, 0, RC_OWN_VAL, RC_OWN_DESC, "user" },
+        { RC_GRP_NAME, 0, POPT_ARG_STRING, 0, RC_GRP_VAL, RC_GRP_DESC, "group"},
+        { RC_MSK_NAME, 0, POPT_ARG_INT,    0, RC_MSK_VAL, RC_MSK_DESC, "umask"},
+        { RC_ASS_NAME, 0, POPT_ARG_STRING, 0, RC_ASS_VAL, RC_ASS_DESC, "regx" },
+        { RC_DEF_NAME, 0, POPT_ARG_STRING, 0, RC_DEF_VAL, RC_DEF_DESC, "regx" },
+        { RC_REF_NAME, 0, POPT_ARG_STRING, 0, RC_REF_VAL, RC_REF_DESC, "regx" },
+        { RC_PRM_NAME, 0, POPT_ARG_STRING, 0, RC_PRM_VAL, RC_PRM_DESC, "regx" },
+        { RC_TRM_NAME, 0, POPT_ARG_STRING, 0, RC_TRM_VAL, RC_TRM_DESC, "regx" },
+        { RC_NCF_NAME, 0, POPT_ARG_STRING, 0, RC_NCF_VAL, RC_NCF_DESC, "name" },
+        { RC_CMN_NAME, 0, POPT_ARG_STRING, 0, RC_CMN_VAL, RC_CMN_DESC, "name" },
+        { RC_DFL_NAME, 0, POPT_ARG_STRING, 0, RC_DFL_VAL, RC_DFL_DESC, "name" },
+        { RC_ERR_NAME, 0, POPT_ARG_STRING, 0, RC_ERR_VAL, RC_ERR_DESC, "name" },
+
+        /* Special stuff    */
+        POPT_AUTOHELP
+        { NULL, 0, 0, NULL, 0 }
+    };
+
     ex_t Except;
     char cliOpt = 0;            /* For argument parsing           */
     char *szCLIBuf = NULL;
@@ -304,19 +300,17 @@
         rethrow;
     }*/
 
-for (i = 0; i < RC_NUMOPTS; i++)
-    if (s_szOptuples[i])
-        TRACEL(i);
-
-    for (i = 0; i < RC_NUMOPTS; i++)                    /* Free the tuple */
-        s_szOptuples[i] ? free(s_szOptuples[i]) : RC_NOP; /* or do nothing  */
+    for (i = 0; i < RC_NUMOPTS; i++)                      /* Free the tuple */
+        m_szOptuples[i] ? free(m_szOptuples[i]) : RC_NOP; /* or do nothing  */
 
-    memset(s_szOptuples, NULL, sizeof(s_szOptuples));     /* Clear tuples   */
+    memset(m_szOptuples, NULL, sizeof(m_szOptuples));     /* Clear tuples   */
 
+/* FIXME BEGIN DEBUG */
 for (i = 0; i < RC_NUMOPTS; i++)
-    if (s_szOptuples[i])
-        TRACE("Problem! Destructor failed!");
-TRACE("cliopt destructed.");
+    if (m_szOptuples[i])
+        TRACE("Problem! Destructor failed!\n");
+TRACE("cliopt destructed.\n");
+/* FIXME END DEBUG */
 
     return(RC_THROW(RC_OK));
 }


ossp-pkg/rc/rc_config.c 1.9 -> 1.10

--- rc_config.c  2002/04/11 16:52:45     1.9
+++ rc_config.c  2002/04/12 19:15:12     1.10
@@ -33,7 +33,7 @@
 #include "rc.h"
 #include "rc_const.h"               /* String constants                 */
 
-static int s_nLocks = 0;            /* Server locks, not thread-safe FIXME  */
+static int m_nLocks = 0;            /* Server locks, not thread-safe FIXME  */
 
 
 /***************************************
@@ -44,7 +44,7 @@
 {
     ex_t Except;
 
-    if (s_nLocks == 0) {                    /* If we don't have one yet */
+    if (m_nLocks == 0) {                    /* If we don't have one yet */
         ex_try {                            /* then construct a new one */
             clioptConstruct();              /* Member cliopt instance   */
         }
@@ -52,21 +52,21 @@
             rethrow;
         }
     }
-    s_nLocks++;                             /* FIXME not threadsafe     */
+    m_nLocks++;                             /* FIXME not threadsafe     */
 
     return(RC_THROW(RC_OK));
 }
 
 /***************************************
-* configGetoptval(rc_opt_t)            *
+* configGetXXX(rc_opt_t)               *
 * Configuration accessors              *
 ***************************************/
-const char *configGetoptval(rc_opt_t Optname)
+const char *configGetval(rc_opt_t Optname)
 {
     ex_t Except;
     char *szTemp = NULL;
 
-    if (s_nLocks) {                         /* Make sure config exists      */
+    if (m_nLocks) {                         /* Make sure config exists      */
         ex_try {
             if ((szTemp = (char *)clioptGetval(Optname)))
                 return((const char *)szTemp);
@@ -87,6 +87,28 @@
     return(NULL);   /* Not reached  */
 }
 
+const char *configGetname(rc_opt_t Optname)
+{
+    static char *s_szOptnametab[] = {
+        RC_USE_NAME, RC_DBG_NAME, RC_VER_NAME, RC_EVL_NAME,
+        RC_HLP_NAME, RC_INF_NAME, RC_LBL_NAME, RC_PRN_NAME,
+        RC_SIL_NAME, RC_RAW_NAME, RC_VRB_NAME, RC_EXC_NAME,
+        RC_LOC_NAME, RC_CNF_NAME, RC_FNC_NAME, RC_QRY_NAME,
+        RC_TMP_NAME, RC_OWN_NAME, RC_GRP_NAME, RC_MSK_NAME,
+        RC_ASS_NAME, RC_DEF_NAME, RC_REF_NAME, RC_PRM_NAME,
+        RC_TRM_NAME, RC_NCF_NAME, RC_CMN_NAME, RC_DFL_NAME,
+        RC_ERR_NAME
+    };
+
+    if (m_nLocks) { /* Make sure config exists  */
+        return((const char *)s_szOptnametab[Optname]);
+    }
+    else {
+        RC_THROW(RC_ERR_USE);
+    }
+    return(NULL);   /* Not reached  */
+}
+
 /************************************************
 * configLoad(int, char **)                      *
 * Load a configuration                          *
@@ -97,8 +119,8 @@
 
     ex_try {    /* Parse option groups in order of priority     */
         clioptParse(argc, argv);        /* Command line options */
-/*        envoptParse(s_nLocks->pOpt);*/    /* Environment options  */
-/*        cnfoptParse(s_nLocks->pOpt);*/    /* Configfile options   */
+/*        envoptParse(m_nLocks->pOpt);*/    /* Environment options  */
+/*        cnfoptParse(m_nLocks->pOpt);*/    /* Configfile options   */
     }
     ex_catch(Except) {
         rethrow;
@@ -121,7 +143,7 @@
 {
     ex_t Except;
 
-    if (--s_nLocks == 0) {          /* If m_nLocks is 0, deallocate */
+    if (--m_nLocks == 0) {          /* If m_nLocks is 0, deallocate */
         ex_try {                    /* FIXME, not thread-safe       */
             clioptDestruct();
         }


ossp-pkg/rc/rc_private.h 1.10 -> 1.11

--- rc_private.h 2002/04/11 16:52:45     1.10
+++ rc_private.h 2002/04/12 19:15:12     1.11
@@ -41,8 +41,8 @@
 #define TRACE(str)  ((void)0)
 #define TRACEL(num) ((void)0)
 #else
-#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)
+#define TRACE(str)  fprintf(stderr, "%s:%d: %s", __FILE__, __LINE__, str)
+#define TRACEL(num) fprintf(stderr, "%s:%d: %ld", __FILE__, __LINE__, (long int)num)
 #endif
 
 /* The GUID for OSSP rc */


ossp-pkg/rc/rc_test.sh 1.7 -> 1.8

--- rc_test.sh   2002/04/11 16:52:45     1.7
+++ rc_test.sh   2002/04/12 19:15:12     1.8
@@ -29,34 +29,43 @@
 
 # Test short options, should fail for false combination usage
 ./rc -dVehilpsrvxLcfqt samba start sleep=2 restart
+echo "./rc -dVehilpsrvxLcfqt samba start sleep=2 restart"
 
 # Test short options, should succeed
 ./rc -derv -L /sfw/etc/rc.d/rc.%{RCFILE:s/^all$/*/} -c /sfw/etc/rc.conf -f /sfw/etc/rc.func -t /tmp openssh stop sleep=4 start daily minsize=2097152
+echo; echo "./rc -derv -L /sfw/etc/rc.d/rc.%{RCFILE:s/^all$/*/} -c /sfw/etc/rc.conf -f /sfw/etc/rc.func -t /tmp openssh stop sleep=4 start daily minsize=2097152"
 
 # Test some long options, should fail for false combination usage
 ./rc --verbose --silent uucp stop sleep=6 start
+echo; echo "./rc --verbose --silent uucp stop sleep=6 start"
 ./rc --query --silent zebra bing bang
+echo; echo "./rc --query --silent zebra bing bang"
 ./rc --conf /sfw/rc.conf --locate /sfw/etc/rc.d --query what to enter here
+echo; echo "./rc --conf /sfw/rc.conf --locate /sfw/etc/rc.d --query what to enter here"
 
 # Test minimal set of long options, should succeed
 ./rc --debug --version rsyncd nothing matters but the version
+echo; echo "./rc --conf /sfw/rc.conf --locate /sfw/etc/rc.d --query what to enter here"
 
 # FIXME these cases are not handled yet by our configuration FIXME #
 #./rc --debug --version
-#echo
+#echo; echo "./rc --debug --version"
 #./rc --debug --help
-#echo
+#echo; echo "./rc --debug --help"
 #./rc --debug --info --verbose
-#echo
+#echo; echo "./rc --debug --info --verbose"
 #./rc --conf /etc/rc.conf --debug --info --raw
-#echo
+#echo; echo "./rc --conf /etc/rc.conf --debug --info --raw"
 #./rc --conf /sfw/rc.conf --tmp /sfw/RPM/TMP --debug --labels rsyncd
-#echo
+#echo; echo "./rc --conf /sfw/rc.conf --tmp /sfw/RPM/TMP --debug --labels rsyncd"
 # FIXME these cases are not handled yet by our configuration FIXME #
 
 ./rc --func /sfw/etc/rc.func --print --verbose openssh stop sleep=4 start
+echo; echo "./rc --func /sfw/etc/rc.func --print --verbose openssh stop sleep=4 start"
 ./rc --func /sfw/etc/rc.func --debug --eval uucp restart
+echo; echo "./rc --func /sfw/etc/rc.func --debug --eval uucp restart"
 ./rc --conf ./myrc --func /sfw/etc/rc.func --tmp /tmp --debug --silent --exec uucp start
+echo; echo "./rc --conf ./myrc --func /sfw/etc/rc.func --tmp /tmp --debug --silent --exec uucp start"
 
 # Next milestone
 #RequireOwner

CVSTrac 2.0.1