get config
authorOlivier Matz <zer0@droids-corp.org>
Thu, 21 Jun 2018 20:45:29 +0000 (22:45 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 21 Jun 2018 20:45:35 +0000 (22:45 +0200)
lib/ecoli_node.c
lib/ecoli_node.h

index b710a40..a181835 100644 (file)
@@ -215,6 +215,11 @@ fail:
        return -1;
 }
 
+const struct ec_config *ec_node_get_config(struct ec_node *node)
+{
+       return node->config;
+}
+
 #if 0 /* later */
 int ec_node_del_child(struct ec_node *node, struct ec_node *child)
 {
index 1035778..63178f7 100644 (file)
@@ -149,10 +149,14 @@ struct ec_node *ec_node_clone(struct ec_node *node);
 void ec_node_free(struct ec_node *node);
 
 /* set configuration of a node
- * after a call to this function, the config is owned by the node and
- * must not be used by the caller */
+ * after a call to this function, the config is
+ * owned by the node and must not be used by the caller
+ * on error, the config is freed. */
 int ec_node_set_config(struct ec_node *node, struct ec_config *config);
 
+/* get the current node configuration. Return NULL if no configuration. */
+const struct ec_config *ec_node_get_config(struct ec_node *node);
+
 size_t ec_node_get_children_count(const struct ec_node *node);
 struct ec_node *
 ec_node_get_child(const struct ec_node *node, size_t i);