]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/ccanlint.h
merge
[ccan] / tools / ccanlint / ccanlint.h
index 804f80249d9204b362032e592c29a52d5e7b66b6..d704d58d6b9fcbd0ee484badeee4b0ba969bb764 100644 (file)
@@ -88,6 +88,11 @@ struct ccan_file {
 
        char *name;
 
+       /* Pristine version of the original file.
+        * Use get_ccan_file_lines to fill this. */
+       const char *contents;
+       size_t contents_size;
+
        /* Use get_ccan_file_lines / get_ccan_line_info to fill these. */
        unsigned int num_lines;
        char **lines;
@@ -108,11 +113,16 @@ enum line_compiled {
        MAYBE_COMPILED,
 };
 
-/* Simple evaluator: if this pre-processor symbol is defined to this
- * value, is this line compiled? (Other symbols assumed undefined) */
+/* Simple evaluator.  If symbols are set this way, is this condition true?
+ * NULL values mean undefined, NULL symbol terminates. */
 enum line_compiled get_ccan_line_pp(struct pp_conditions *cond,
                                    const char *symbol,
-                                   unsigned int value);
+                                   const unsigned int *value, ...);
+
+/* Get token if it's equal to token. */
+bool get_token(const char **line, const char *token);
+/* Talloc copy of symbol token, or NULL.  Increment line. */
+char *get_symbol_token(void *ctx, const char **line);
 
 /* Similarly for ->doc_sections */
 struct list_head *get_ccan_file_docs(struct ccan_file *f);