rename __ec_node
authorOlivier Matz <zer0@droids-corp.org>
Thu, 9 Aug 2018 13:29:06 +0000 (15:29 +0200)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 9 Aug 2018 13:29:06 +0000 (15:29 +0200)
16 files changed:
lib/ecoli_node.c
lib/ecoli_node.h
lib/ecoli_node_cmd.c
lib/ecoli_node_dynamic.c
lib/ecoli_node_helper.c
lib/ecoli_node_int.c
lib/ecoli_node_many.c
lib/ecoli_node_once.c
lib/ecoli_node_option.c
lib/ecoli_node_or.c
lib/ecoli_node_re.c
lib/ecoli_node_re_lex.c
lib/ecoli_node_seq.c
lib/ecoli_node_sh_lex.c
lib/ecoli_node_str.c
lib/ecoli_node_subset.c

index 1ebbcf1..878aded 100644 (file)
@@ -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)
index f66fa3d..3501361 100644 (file)
@@ -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);
index b08db0b..b745fd8 100644 (file)
@@ -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;
index 9032257..8a3edf3 100644 (file)
@@ -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;
 
index b2be8f7..9ec7e89 100644 (file)
@@ -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)
index daece01..b42a912 100644 (file)
@@ -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;
 
index 32e7ad5..1c91f85 100644 (file)
@@ -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;
index 3d4b038..6309878 100644 (file)
@@ -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;
 
index 06cca69..ab4f352 100644 (file)
@@ -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;
 
index aeac206..bbb8ad5 100644 (file)
@@ -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;;
index 05db048..6ac5182 100644 (file)
@@ -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;
 
index 0120367..f5a6c37 100644 (file)
@@ -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;
index fa49c03..fa9eaac 100644 (file)
@@ -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;
 
index a632f97..e27f21b 100644 (file)
@@ -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;
index 0100fec..991f7e0 100644 (file)
@@ -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;
 
index bfd7e71..e3184ef 100644 (file)
@@ -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;;