]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - ccan/cdump/cdump_parse.c
cdump: features which weren't in genparser
[ccan-lca-2011.git] / ccan / cdump / cdump_parse.c
index fea7df141486276e8197854ed0bbe93018f7377b..41fd5c510ffc70981345dfa222faf65074607c36 100644 (file)
@@ -127,6 +127,9 @@ static size_t parse_one(const void *ctx, const char *outer_struct_name,
        unbundle = talloc_strdup(ctx, "cdump_unbundle");
        size = talloc_strdup(ctx, "sizeof(");
        for (i = 0; i < typelen; i++) {
+               /* Const is irrelevant for bundling. */
+               if (streq(type[i], "const"))
+                       continue;
                bundle = talloc_asprintf_append(bundle, "_%s", type[i]);
                unbundle = talloc_asprintf_append(unbundle, "_%s", type[i]);
                size = talloc_asprintf_append(size, "%s ", type[i]);
@@ -177,6 +180,8 @@ static size_t parse_element(const void *ctx, const char *outer_struct_name,
                                typelen = i - 1;
                        }
                }
+               if (streq(tok[i], "CDUMP_IGNORE"))
+                       goto skip;
        }
        i = typelen;
 
@@ -188,6 +193,7 @@ static size_t parse_element(const void *ctx, const char *outer_struct_name,
                        i++;
        } while (tok[i] && !streq(tok[i], ";") && !strstarts(tok[i], "CDUMP_"));
 
+skip:
        while (tok[i] && !streq(tok[i], ";"))
                i++;