7 * CDUMP_SAVED - prefix for a structure or enum to be parsed by cdump_parse.
9 * A structure or enum tagged with this will be parsed by cdump_parse;
10 * others are ignored. Note that the parser is very primitive, so
11 * your definitions should be formatted simply.
14 * CDUMP_SAVED struct foo {
21 * CDUMP_LEN - annotation for a pointer parsed by cdump_parse.
22 * @member: the structure memeber which defines the length.
24 * This marks a pointer as having a known length, either a constant or
25 * another structure member.
28 * CDUMP_SAVED struct bar {
30 * char *p CDUMP_LEN(len);
36 * CDUMP_ZEROTERM - annotation for a pointer parsed by cdump_parse.
38 * This marks a pointer as being an array terminated by a zero entry, such
42 * CDUMP_SAVED struct baz {
43 * char *p CDUMP_ZEROTERM;
46 #define CDUMP_ZEROTERM
52 * cdump_bundle - linearize a given datastructure
53 * @ctx: the context to tallocate the returned string off.
54 * @info: a cdump_desc definition created by cdump_parse()
55 * @data: a pointer to the struct described by @info.
57 * This tallocates a string which is a description of the talloc
58 * pointer @data and everything it references.
60 char *cdump_bundle(const void *ctx,
61 const struct cdump_desc *info, const void *data);
64 * cdump_unbundle - extract a datastructure from a linearized description
65 * @ctx: the context to tallocate the returned datastructure off.
66 * @info: a cdump_desc definition created by cdump_parse()
67 * @data: a pointer to the structute to unbundle.
68 * @str: the string created by cdump_bundle().
70 * Returns false on failure. Fields not mentioned in @str are zero-filled.
72 bool cdump_unbundle(const void *ctx,
73 const struct cdump_desc *info,
74 void *data, const char *str);
76 #endif /* CCAN_CDUMP_H */