]> git.ozlabs.org Git - ccan-lca-2011.git/blobdiff - ccan/cdump/cdump_parse.h
cdump: first cut of translation of Tridge's genstruct junkcode.
[ccan-lca-2011.git] / ccan / cdump / cdump_parse.h
diff --git a/ccan/cdump/cdump_parse.h b/ccan/cdump/cdump_parse.h
new file mode 100644 (file)
index 0000000..867fa35
--- /dev/null
@@ -0,0 +1,21 @@
+#ifndef CCAN_CDUMP_PARSE_H
+#define CCAN_CDUMP_PARSE_H
+/**
+ * cdump_parse - code generator for cdump
+ * @ctx: talloc context to use for allocations
+ * @code: the code to parse for CDUMP_SAVED definitions
+ * @declarations: pointer to string to hold declarations
+ * @definitions: pointer to string to hold definitions
+ *
+ * This defines a struct cdump_desc for every structure and enum which
+ * has the CDUMP_SAVED label.  The declarations and definitions are separated,
+ * as they usually are placed in the header file and source file respectively.
+ *
+ * A non-NULL return indicates a human-readable error message.  Usually it
+ * means that the code couldn't be parsed.
+ */
+char *cdump_parse(const void *ctx, const char *code,
+                 char **declarations, char **definitions);
+
+#endif /* CCAN_CDUMP_PARSE_H */
+