1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
6 * @defgroup nodes Nodes
10 #ifndef ECOLI_NODE_OR_
11 #define ECOLI_NODE_OR_
13 #include <ecoli_node.h>
14 #include <ecoli_utils.h>
16 #define EC_NODE_OR(args...) __ec_node_or(args, EC_VA_END)
18 /* list must be terminated with EC_VA_END */
19 /* all nodes given in the list will be freed when freeing this one */
20 /* avoid using this function directly, prefer the macro EC_NODE_OR() or
21 * ec_node_or() + ec_node_or_add() */
22 struct ec_node *__ec_node_or(const char *id, ...);
24 struct ec_node *ec_node_or(const char *id);
26 /* child is consumed */
27 int ec_node_or_add(struct ec_node *node, struct ec_node *child);