21c96b1172b6a251506ab25215fb1ba13d8f6ef3
[protos/libecoli.git] / include / ecoli_node_seq.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
3  */
4
5 #ifndef ECOLI_NODE_SEQ_
6 #define ECOLI_NODE_SEQ_
7
8 #include <ecoli_node.h>
9
10 #define EC_NODE_SEQ(args...) __ec_node_seq(args, EC_NODE_ENDLIST)
11
12 /* list must be terminated with EC_NODE_ENDLIST */
13 /* all nodes given in the list will be freed when freeing this one */
14 /* avoid using this function directly, prefer the macro EC_NODE_SEQ() or
15  * ec_node_seq() + ec_node_seq_add() */
16 struct ec_node *__ec_node_seq(const char *id, ...);
17
18 struct ec_node *ec_node_seq(const char *id);
19
20 /* child is consumed */
21 int ec_node_seq_add(struct ec_node *node, struct ec_node *child);
22
23 #endif