X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fecoli_node.c;h=0c5890f89c252f67f6e28861bf8efa4931becfa6;hb=be399018140cd20c8da9361c00f6095e2cd48940;hp=1ebbcf10abb8b4f4c0474cfacce4eaf3849da40b;hpb=8937e9addfe15dfe34ea241884aa10cfb3dc54fb;p=protos%2Flibecoli.git diff --git a/lib/ecoli_node.c b/lib/ecoli_node.c index 1ebbcf1..0c5890f 100644 --- a/lib/ecoli_node.c +++ b/lib/ecoli_node.c @@ -64,7 +64,7 @@ void ec_node_type_dump(FILE *out) fprintf(out, "%s\n", type->name); } -struct ec_node *__ec_node(const struct ec_node_type *type, const char *id) +struct ec_node *ec_node_from_type(const struct ec_node_type *type, const char *id) { struct ec_node *node = NULL; @@ -111,6 +111,18 @@ struct ec_node *__ec_node(const struct ec_node_type *type, const char *id) 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; @@ -122,7 +134,7 @@ struct ec_node *ec_node(const char *typename, const char *id) return NULL; } - return __ec_node(type, id); + return ec_node_from_type(type, id); } static void count_references(struct ec_node *node, unsigned int refs) @@ -275,8 +287,7 @@ ec_node_set_config(struct ec_node *node, struct ec_config *config) errno = EINVAL; goto fail; } - if (ec_config_validate(config, node->type->schema, - node->type->schema_len) < 0) + if (ec_config_validate(config, node->type->schema) < 0) goto fail; if (node->type->set_config != NULL) { if (node->type->set_config(node, config) < 0)