From be399018140cd20c8da9361c00f6095e2cd48940 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Thu, 9 Aug 2018 15:48:51 +0200 Subject: [PATCH] accessors for node type --- lib/ecoli_node.c | 12 ++++++++++++ lib/ecoli_node.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/lib/ecoli_node.c b/lib/ecoli_node.c index 46bd9d8..0c5890f 100644 --- a/lib/ecoli_node.c +++ b/lib/ecoli_node.c @@ -111,6 +111,18 @@ struct ec_node *ec_node_from_type(const struct ec_node_type *type, const char *i return NULL; } +const struct ec_config_schema * +ec_node_type_schema(const struct ec_node_type *type) +{ + return type->schema; +} + +const char * +ec_node_type_name(const struct ec_node_type *type) +{ + return type->name; +} + struct ec_node *ec_node(const char *typename, const char *id) { const struct ec_node_type *type; diff --git a/lib/ecoli_node.h b/lib/ecoli_node.h index 0867525..45f3e74 100644 --- a/lib/ecoli_node.h +++ b/lib/ecoli_node.h @@ -132,6 +132,18 @@ const struct ec_node_type *ec_node_type_lookup(const char *name); */ void ec_node_type_dump(FILE *out); +/** + * Get the config schema of a node type. + */ +const struct ec_config_schema * +ec_node_type_schema(const struct ec_node_type *type); + +/** + * Get the name of a node type. + */ +const char * +ec_node_type_name(const struct ec_node_type *type); + enum ec_node_free_state { EC_NODE_FREE_STATE_NONE, EC_NODE_FREE_STATE_TRAVERSED, -- 2.20.1