Loading...
Searching...
No Matches
node_subset.h
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright 2016, Olivier MATZ <zer0@droids-corp.org>
*/
#pragma once
#include <ecoli/node.h>
#define EC_NODE_SUBSET(args...) __ec_node_subset(args, EC_VA_END)
/* list must be terminated with EC_VA_END */
/* all nodes given in the list will be freed when freeing this one */
/* avoid using this function directly, prefer the macro EC_NODE_SUBSET() or
* ec_node_subset() + ec_node_subset_add() */
struct ec_node *__ec_node_subset(const char *id, ...);
struct ec_node *ec_node_subset(const char *id);
struct ec_node *ec_node_subset_min(const char *id, unsigned int min);
int ec_node_subset_add(struct ec_node *node, struct ec_node *child);
int ec_node_subset_set_min(struct ec_node *node, unsigned int min);
unsigned int ec_node_subset_get_min(const struct ec_node *node);
ec_node_subset_add
int ec_node_subset_add(struct ec_node *node, struct ec_node *child)
Add a child to a subset node.
ec_node_subset_get_min
unsigned int ec_node_subset_get_min(const struct ec_node *node)
Get the minimum number of children that must match.
ec_node_subset_set_min
int ec_node_subset_set_min(struct ec_node *node, unsigned int min)
Set the minimum number of children that must match.
ec_node_subset_min
struct ec_node * ec_node_subset_min(const char *id, unsigned int min)
Create an empty subset node with a minimum number of children that must match.
ec_node_subset
struct ec_node * ec_node_subset(const char *id)
Create an empty subset node.
ec_node
struct ec_node * ec_node(const char *typename, const char *id)
Create a new node from its type name.