X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcdump%2Fcdump_parse.c;h=41fd5c510ffc70981345dfa222faf65074607c36;hb=d5713111bd392c112c689171e727ab1a4d90ad9e;hp=fea7df141486276e8197854ed0bbe93018f7377b;hpb=45c8a57497b960a51bbb7178c6eace46929b0727;p=ccan-lca-2011.git diff --git a/ccan/cdump/cdump_parse.c b/ccan/cdump/cdump_parse.c index fea7df1..41fd5c5 100644 --- a/ccan/cdump/cdump_parse.c +++ b/ccan/cdump/cdump_parse.c @@ -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++;