]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - ccan/cdump/cdump.c
cdump: features which weren't in genparser
[ccan-lca-2011.git] / ccan / cdump / cdump.c
index f151cbffdaf4d30a646887b98bb196faee1114ef..a1b55195aa1b0159034ef48ad4fe4586b966eb64 100644 (file)
@@ -725,6 +725,12 @@ bool cdump_unbundle_float(const void *ctx, void *ptr, const char *str)
        return true;
 }
 
+bool cdump_unbundle_size_t(const void *ctx, void *ptr, const char *str)
+{
+       *(size_t *)ptr = strtoul(str, NULL, 10);
+       return true;
+}
+
 bool cdump_bundle_char(struct cdump_string *p, const void *ptr, unsigned indent)
 {
        return addshort(p, "%u", *(unsigned char *)ptr);
@@ -754,3 +760,8 @@ bool cdump_bundle_float(struct cdump_string *p, const void *ptr, unsigned indent
 {
        return addshort(p, "%g", *(float *)ptr);
 }
+
+bool cdump_bundle_size_t(struct cdump_string *p, const void *ptr, unsigned indent)
+{
+       return addshort(p, "%zu", *(size_t *)ptr);
+}