OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_config.c versions 1.22 and 1.23
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

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

--- rc_config.c  2002/07/05 14:10:24     1.22
+++ rc_config.c  2002/07/29 16:34:59     1.23
@@ -252,6 +252,86 @@
         return(RC_THROW(RC_OK));        /* No, we should continue processing. */
 }
 
+/************************************************
+* configDefaults(void)                          *
+* Write default values to empty config members  *
+************************************************/
+rc_return_t configDefaults(void)
+{
+    ex_t Except;
+
+    try { /* Test members for empty attributes */
+        if (!configGetval(RC_EVL_VAL) && !configGetval(RC_EXC_VAL) \
+            && !configGetval(RC_PRN_VAL))
+            clioptSetval(RC_PRN_VAL, "1");
+
+/*        if (!configGetval(RC_USE_VAL))
+        if (!configGetval(RC_HLP_VAL))
+        if (!configGetval(RC_INF_VAL))
+        if (!configGetval(RC_LBL_VAL))
+        if (!configGetval(RC_SIL_VAL))
+        if (!configGetval(RC_RAW_VAL))
+        if (!configGetval(RC_VRB_VAL))*/
+
+/*
+        if (!configGetval(RC_LOC_VAL)) {
+            If exists '/etc/rc.d'
+                clioptSetval(RC_LOC_VAL, "/etc/rc.d/rc.");
+                FIXME: !This 'rc.' reading logic must still be implemented!
+            Else
+                RC_NOP;
+        }
+        if (!configGetval(RC_CNF_VAL)) {
+            If exists '/etc/rcconf'
+                clioptSetval(RC_CNF_VAL, "/etc/rcconf");
+            Else
+                RC_NOP;
+        }
+        if (!configGetval(RC_FNC_VAL)) {
+            If exists '/etc/rc.func'
+                clioptSetval(RC_FNC_VAL, "/etc/rc.func");
+            Else
+                RC_NOP;
+        }
+*/
+
+/*        if (!configGetval(RC_QRY_VAL))*/
+
+/*
+        if (!configGetval(RC_TMP_VAL)) {
+            If exists '/tmp'
+                clioptSetval(RC_TMP_VAL, "/tmp");
+            Else
+                RC_NOP;
+        }
+*/
+
+/*        if (!configGetval(RC_OWN_VAL))
+        if (!configGetval(RC_GRP_VAL))
+        if (!configGetval(RC_MSK_VAL))
+        if (!configGetval(RC_ASS_VAL))*/
+
+        if (!configGetval(RC_DEF_VAL))
+            clioptSetval(RC_DEF_VAL, "^%(\\w+).*?\\n(.*?)^$");
+
+/*        if (!configGetval(RC_REF_VAL))
+        if (!configGetval(RC_PRM_VAL))
+        if (!configGetval(RC_TRM_VAL))*/
+
+        if (!configGetval(RC_NCF_VAL))
+            clioptSetval(RC_NCF_VAL, "config");
+
+/*        if (!configGetval(RC_CMN_VAL))
+        if (!configGetval(RC_DFL_VAL))
+        if (!configGetval(RC_ERR_VAL))*/
+    }
+    catch(Except) {
+        rethrow;
+    }
+
+    return(RC_THROW(RC_OK));    /* Normal response */
+}
+
 /***************************************
 * configDelete(void)                   *
 * Destruct a configuration             *

CVSTrac 2.0.1