From: Olivier Matz Date: Thu, 9 Aug 2018 13:29:06 +0000 (+0200) Subject: rename __ec_node X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=833dc6c2a9c47b821548b197a1d1f96f60df7de8;p=protos%2Flibecoli.git rename __ec_node --- diff --git a/lib/ecoli_node.c b/lib/ecoli_node.c index 1ebbcf1..878aded 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; @@ -122,7 +122,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) diff --git a/lib/ecoli_node.h b/lib/ecoli_node.h index f66fa3d..3501361 100644 --- a/lib/ecoli_node.h +++ b/lib/ecoli_node.h @@ -156,7 +156,7 @@ struct ec_node { /* create a new node when the type is known, typically called from the node * code */ -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); /* create a new node */ struct ec_node *ec_node(const char *typename, const char *id); diff --git a/lib/ecoli_node_cmd.c b/lib/ecoli_node_cmd.c index b08db0b..b745fd8 100644 --- a/lib/ecoli_node_cmd.c +++ b/lib/ecoli_node_cmd.c @@ -557,7 +557,7 @@ struct ec_node *__ec_node_cmd(const char *id, const char *cmd, ...) if (children == NULL) goto fail; - gen_node = __ec_node(&ec_node_cmd_type, id); + gen_node = ec_node_from_type(&ec_node_cmd_type, id); if (gen_node == NULL) goto fail; node = (struct ec_node_cmd *)gen_node; diff --git a/lib/ecoli_node_dynamic.c b/lib/ecoli_node_dynamic.c index 9032257..8a3edf3 100644 --- a/lib/ecoli_node_dynamic.c +++ b/lib/ecoli_node_dynamic.c @@ -113,7 +113,7 @@ ec_node_dynamic(const char *id, ec_node_dynamic_build_t build, void *opaque) goto fail; } - gen_node = __ec_node(&ec_node_dynamic_type, id); + gen_node = ec_node_from_type(&ec_node_dynamic_type, id); if (gen_node == NULL) goto fail; diff --git a/lib/ecoli_node_helper.c b/lib/ecoli_node_helper.c index b2be8f7..9ec7e89 100644 --- a/lib/ecoli_node_helper.c +++ b/lib/ecoli_node_helper.c @@ -70,7 +70,7 @@ struct ec_config * ec_node_config_node_list_from_vargs(va_list ap) { struct ec_config *list = NULL; - struct ec_node *node; + struct ec_node *node = va_arg(ap, struct ec_node *); list = ec_config_list(); if (list == NULL) diff --git a/lib/ecoli_node_int.c b/lib/ecoli_node_int.c index daece01..b42a912 100644 --- a/lib/ecoli_node_int.c +++ b/lib/ecoli_node_int.c @@ -218,7 +218,7 @@ struct ec_node *ec_node_int(const char *id, int64_t min, struct ec_node *gen_node = NULL; int ret; - gen_node = __ec_node(&ec_node_int_type, id); + gen_node = ec_node_from_type(&ec_node_int_type, id); if (gen_node == NULL) return NULL; @@ -328,7 +328,7 @@ struct ec_node *ec_node_uint(const char *id, uint64_t min, struct ec_node *gen_node = NULL; int ret; - gen_node = __ec_node(&ec_node_uint_type, id); + gen_node = ec_node_from_type(&ec_node_uint_type, id); if (gen_node == NULL) return NULL; diff --git a/lib/ecoli_node_many.c b/lib/ecoli_node_many.c index 32e7ad5..1c91f85 100644 --- a/lib/ecoli_node_many.c +++ b/lib/ecoli_node_many.c @@ -205,7 +205,7 @@ struct ec_node *ec_node_many(const char *id, struct ec_node *child, if (child == NULL) return NULL; - node = (struct ec_node_many *)__ec_node(&ec_node_many_type, id); + node = (struct ec_node_many *)ec_node_from_type(&ec_node_many_type, id); if (node == NULL) { ec_node_free(child); return NULL; diff --git a/lib/ecoli_node_once.c b/lib/ecoli_node_once.c index 3d4b038..6309878 100644 --- a/lib/ecoli_node_once.c +++ b/lib/ecoli_node_once.c @@ -159,7 +159,7 @@ struct ec_node *ec_node_once(const char *id, struct ec_node *child) if (child == NULL) return NULL; - gen_node = __ec_node(&ec_node_once_type, id); + gen_node = ec_node_from_type(&ec_node_once_type, id); if (gen_node == NULL) goto fail; diff --git a/lib/ecoli_node_option.c b/lib/ecoli_node_option.c index 06cca69..ab4f352 100644 --- a/lib/ecoli_node_option.c +++ b/lib/ecoli_node_option.c @@ -125,7 +125,7 @@ struct ec_node *ec_node_option(const char *id, struct ec_node *child) if (child == NULL) goto fail; - gen_node = __ec_node(&ec_node_option_type, id); + gen_node = ec_node_from_type(&ec_node_option_type, id); if (gen_node == NULL) goto fail; diff --git a/lib/ecoli_node_or.c b/lib/ecoli_node_or.c index aeac206..bbb8ad5 100644 --- a/lib/ecoli_node_or.c +++ b/lib/ecoli_node_or.c @@ -150,7 +150,7 @@ struct ec_node *__ec_node_or(const char *id, ...) va_start(ap, id); - gen_node = __ec_node(&ec_node_or_type, id); + gen_node = ec_node_from_type(&ec_node_or_type, id); node = (struct ec_node_or *)gen_node; if (node == NULL) fail = 1;; diff --git a/lib/ecoli_node_re.c b/lib/ecoli_node_re.c index 05db048..6ac5182 100644 --- a/lib/ecoli_node_re.c +++ b/lib/ecoli_node_re.c @@ -108,7 +108,7 @@ struct ec_node *ec_node_re(const char *id, const char *re_str) { struct ec_node *gen_node = NULL; - gen_node = __ec_node(&ec_node_re_type, id); + gen_node = ec_node_from_type(&ec_node_re_type, id); if (gen_node == NULL) goto fail; diff --git a/lib/ecoli_node_re_lex.c b/lib/ecoli_node_re_lex.c index 0120367..f5a6c37 100644 --- a/lib/ecoli_node_re_lex.c +++ b/lib/ecoli_node_re_lex.c @@ -235,7 +235,7 @@ struct ec_node *ec_node_re_lex(const char *id, struct ec_node *child) if (child == NULL) return NULL; - node = (struct ec_node_re_lex *)__ec_node(&ec_node_re_lex_type, id); + node = (struct ec_node_re_lex *)ec_node_from_type(&ec_node_re_lex_type, id); if (node == NULL) { ec_node_free(child); return NULL; diff --git a/lib/ecoli_node_seq.c b/lib/ecoli_node_seq.c index fa49c03..fa9eaac 100644 --- a/lib/ecoli_node_seq.c +++ b/lib/ecoli_node_seq.c @@ -309,7 +309,7 @@ struct ec_node *__ec_node_seq(const char *id, ...) va_start(ap, id); child = va_arg(ap, struct ec_node *); - gen_node = __ec_node(&ec_node_seq_type, id); + gen_node = ec_node_from_type(&ec_node_seq_type, id); if (gen_node == NULL) goto fail_free_children; diff --git a/lib/ecoli_node_sh_lex.c b/lib/ecoli_node_sh_lex.c index a632f97..e27f21b 100644 --- a/lib/ecoli_node_sh_lex.c +++ b/lib/ecoli_node_sh_lex.c @@ -386,7 +386,7 @@ struct ec_node *ec_node_sh_lex(const char *id, struct ec_node *child) if (child == NULL) return NULL; - node = (struct ec_node_sh_lex *)__ec_node(&ec_node_sh_lex_type, id); + node = (struct ec_node_sh_lex *)ec_node_from_type(&ec_node_sh_lex_type, id); if (node == NULL) { ec_node_free(child); return NULL; diff --git a/lib/ecoli_node_str.c b/lib/ecoli_node_str.c index 0100fec..991f7e0 100644 --- a/lib/ecoli_node_str.c +++ b/lib/ecoli_node_str.c @@ -180,7 +180,7 @@ struct ec_node *ec_node_str(const char *id, const char *str) { struct ec_node *gen_node = NULL; - gen_node = __ec_node(&ec_node_str_type, id); + gen_node = ec_node_from_type(&ec_node_str_type, id); if (gen_node == NULL) goto fail; diff --git a/lib/ecoli_node_subset.c b/lib/ecoli_node_subset.c index bfd7e71..e3184ef 100644 --- a/lib/ecoli_node_subset.c +++ b/lib/ecoli_node_subset.c @@ -316,7 +316,7 @@ struct ec_node *__ec_node_subset(const char *id, ...) va_start(ap, id); - gen_node = __ec_node(&ec_node_subset_type, id); + gen_node = ec_node_from_type(&ec_node_subset_type, id); node = (struct ec_node_subset *)gen_node; if (node == NULL) fail = 1;;