Libecoli  0.10.1
Extensible COmmand LIne library
node_subset.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
3  */
4 
10 #pragma once
11 
12 #include <ecoli/node.h>
13 
14 #define EC_NODE_SUBSET(args...) __ec_node_subset(args, EC_VA_END)
15 
16 /* list must be terminated with EC_VA_END */
17 /* all nodes given in the list will be freed when freeing this one */
18 /* avoid using this function directly, prefer the macro EC_NODE_SUBSET() or
19  * ec_node_subset() + ec_node_subset_add() */
20 struct ec_node *__ec_node_subset(const char *id, ...);
21 
22 struct ec_node *ec_node_subset(const char *id);
23 
24 /* child is consumed */
25 int ec_node_subset_add(struct ec_node *node, struct ec_node *child);
26 
struct ec_node * ec_node(const char *typename, const char *id)