OSSP CVS Repository

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

Check-in Number: 2301
Date: 2002-Jul-17 16:35:09 (local)
2002-Jul-17 14:35:09 (UTC)
User:rse
Branch:
Comment: make available at least the recursive traversal function
Tickets:
Inspections:
Files:
ossp-pkg/cfg/cfg_node.c      1.9 -> 1.10     18 inserted, 26 deleted

ossp-pkg/cfg/cfg_node.c 1.9 -> 1.10

--- cfg_node.c   2002/07/13 18:52:41     1.9
+++ cfg_node.c   2002/07/17 14:35:09     1.10
@@ -354,22 +354,8 @@
     void *cb_ctx_cmp, 
     cfg_node_t **cont)
 {
-#if 0
-    cfg_rc_t rc;
-
-    if (cfg == NULL)
-        return CFG_ERR_ARG;
-    if (node != NULL) {
-        cb_fct(cb_ctx, node);
-        if (node->child1 != NULL)
-            if ((rc = cfg_node_apply(node->child1, cb_fct, cb_ctx)) != CFG_OK)
-                return rc;
-        if (node->rbroth != NULL)
-            if ((rc = cfg_node_apply(node->rbroth, cb_fct, cb_ctx)) != CFG_OK)
-                return rc;
-    }
-#endif
-    return CFG_OK;
+    /* FIXME */
+    return CFG_ERR_INT;
 }
 
 cfg_rc_t 
@@ -383,18 +369,24 @@
 {
     cfg_rc_t rc;
 
-    if (cfg == NULL || node == NULL || cb_fct_cb == NULL)
+    if (cfg == NULL)
         return CFG_ERR_ARG;
-    node = NULL;
-    if (node == NULL)
-        if ((node = cfg->root) == NULL)
-            return CFG_OK;
-    do {
-        if ((rc = cb_fct_cb(cfg, node, cb_ctx_cb)) != CFG_OK)
+    if (node != NULL) {
+        if ((rc = cb_fct_cmp(cfg, node, cb_ctx_cmp)) == CFG_OK)
+            cb_fct_cb(cfg, node, cb_ctx_cb);
+        if (rc != CFG_ERR_NDE)
             return rc;
-    } while ((rc = cfg_node_find(cfg, node, cb_fct_cmp, cb_ctx_cmp, &node)) == CFG_OK);
-    if (rc != CFG_OK && rc != CFG_ERR_NDE)
-        return rc;
+        if (node->child1 != NULL)
+            if ((rc = cfg_node_apply(cfg, node->child1, 
+                                     cb_fct_cmp, cb_ctx_cmp,
+                                     cb_fct_cb, cb_ctx_cb)) != CFG_OK)
+                return rc;
+        if (node->rbroth != NULL)
+            if ((rc = cfg_node_apply(cfg, node->rbroth, 
+                                     cb_fct_cmp, cb_ctx_cmp,
+                                     cb_fct_cb, cb_ctx_cb)) != CFG_OK)
+                return rc;
+    }
     return CFG_OK;
 }
 

CVSTrac 2.0.1