X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=include%2Fecoli_node_or.h;fp=include%2Fecoli_node_or.h;h=db115b2a3f70ce75812a9c9ebfedfc941c2aed76;hb=18d03456d96f7a086a2ccc82ce97fcf056848d90;hp=0000000000000000000000000000000000000000;hpb=a1571d413d2acac5d4a4fbdf2e50b2d1a6da3aa6;p=protos%2Flibecoli.git diff --git a/include/ecoli_node_or.h b/include/ecoli_node_or.h new file mode 100644 index 0000000..db115b2 --- /dev/null +++ b/include/ecoli_node_or.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2016, Olivier MATZ + */ + +#ifndef ECOLI_NODE_OR_ +#define ECOLI_NODE_OR_ + +#include + +#define EC_NODE_OR(args...) __ec_node_or(args, EC_NODE_ENDLIST) + +/* list must be terminated with EC_NODE_ENDLIST */ +/* all nodes given in the list will be freed when freeing this one */ +/* avoid using this function directly, prefer the macro EC_NODE_OR() or + * ec_node_or() + ec_node_or_add() */ +struct ec_node *__ec_node_or(const char *id, ...); + +struct ec_node *ec_node_or(const char *id); + +/* child is consumed */ +int ec_node_or_add(struct ec_node *node, struct ec_node *child); + + +#endif