]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/ccanlint.h
ccanlint: Add cflags support to _info
[ccan] / tools / ccanlint / ccanlint.h
index 6fcca5fa8eb26fbf40153e244a27c4d9e66e0922..9cb858f7d6a02e715eda56ac38d92d133e846066 100644 (file)
@@ -2,11 +2,13 @@
 #define CCAN_LINT_H
 #include "config.h"
 #include <ccan/list/list.h>
+#include <ccan/tal/tal.h>
 #include <ccan/dgraph/dgraph.h>
 #include <ccan/autodata/autodata.h>
 #include <stdbool.h>
 #include "../doc_extract.h"
 #include "../manifest.h"
+#include "../tools.h"
 #include "licenses.h"
 
 AUTODATA_TYPE(ccanlint_tests, struct ccanlint);
@@ -55,7 +57,7 @@ struct ccanlint {
        bool compulsory;
 
        /* If timeleft is set to 0, means it timed out.
-        * score is the result, and a talloc context freed after all our
+        * score is the result, and a tal context freed after all our
         * depends are done. */
        void (*check)(struct manifest *m,
                      unsigned int *timeleft, struct score *score);
@@ -137,7 +139,7 @@ enum line_compiled get_ccan_line_pp(struct pp_conditions *cond,
 
 /* 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. */
+/* Tal copy of symbol token, or NULL.  Increment line. */
 char *get_symbol_token(void *ctx, const char **line);
 
 /* Similarly for ->doc_sections */
@@ -150,6 +152,10 @@ char **per_file_options(const struct ccanlint *test, struct ccan_file *f);
 void score_file_error(struct score *, struct ccan_file *f, unsigned line,
                      const char *errorfmt, ...);
 
+/* Append message to the score->error */
+void score_error(struct score *score, const char * source,
+                const char *errorfmt, ...);
+
 /* Start a command in the background. */
 void run_command_async(const void *ctx, unsigned int time_ms,
                       const char *fmt, ...);
@@ -164,6 +170,9 @@ void compile_and_link_async(const void *ctx, unsigned int time_ms,
 /* Get results of a command, returning ctx (and free it). */
 void *collect_command(bool *ok, char **output);
 
+/* Find manifest for this dir and return compiled _info filename. */
+char *get_or_compile_info(const void *ctx, const char *dir);
+
 /* Normal tests. */
 extern struct ccanlint trailing_whitespace;
 
@@ -185,10 +194,16 @@ extern bool safe_mode;
 /* Did the user want to keep all the results? */
 extern bool keep_results;
 
-/* Compiler and CFLAGS, from config.h if available. */
-extern const char *compiler, *cflags;
+/* Did we find non-ccan dependencies? */
+extern bool non_ccan_deps;
+
+/* Did we fail to build? */
+extern bool build_failed;
 
 /* Contents of config.h (or NULL if not found) */
 extern const char *config_header;
 
+/* Where is the ccan dir?   */
+extern const char *ccan_dir;
+
 #endif /* CCAN_LINT_H */