+#include "config.h"
#include <string.h>
#include <stdio.h>
-#include "config.h"
/**
* ccan_tokenizer - A full-text lexer for C source files
* Example:
*
* #include <ccan/ccan_tokenizer/ccan_tokenizer.h>
- * #include <ccan/grab_file/grab_file.h>
+ * #include <ccan/tal/grab_file/grab_file.h>
* #include <err.h>
*
- * void token_list_stats(const struct token_list *tl) {
+ * static void token_list_stats(const struct token_list *tl) {
* size_t comment=0, white=0, stray=0, code=0, total=0;
* size_t count = 0;
* const struct token *i;
* }
*
* int main(int argc, char *argv[]) {
- * size_t len;
* char *file;
* struct token_list *tl;
* tok_message_queue mq;
* fprintf(stderr, "Usage: %s source_file\n", argv[0]);
* return 1;
* }
- * file = grab_file(NULL, argv[1], &len);
+ * file = grab_file(NULL, argv[1]);
* if (!file)
* err(1, "Could not read file %s", argv[1]);
*
* //tokenize the contents
- * tl = tokenize(file, len, &mq);
+ * tl = tokenize(file, file, strlen(file), &mq);
*
* //print warnings, errors, etc.
* while (queue_count(mq)) {
*
* return 0;
* }
+ *
+ * License: BSD (3 clause)
+ *
+ * Ccanlint:
+ * // We actually depend on the LGPL dependencies
+ * license_depends_compat FAIL
+ * // We don't put the license line in all files.
+ * license_comment FAIL
*/
int main(int argc, char *argv[])
{
return 1;
if (strcmp(argv[1], "depends") == 0) {
- printf("ccan/array\n");
+ printf("ccan/darray\n");
+ printf("ccan/talloc\n");
return 0;
}