X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Finfo_exists.c;h=8f01946f7ff018dfaa01d0acdf6e17d8f2e86cdb;hp=5e04bd8d42b6cf91cf04f2ef928e9d940446337e;hb=HEAD;hpb=64bd9ff9bc3e65bb0e77b982135d6612cda180cd diff --git a/tools/ccanlint/tests/info_exists.c b/tools/ccanlint/tests/info_exists.c index 5e04bd8d..8f01946f 100644 --- a/tools/ccanlint/tests/info_exists.c +++ b/tools/ccanlint/tests/info_exists.c @@ -1,4 +1,6 @@ #include +#include +#include #include #include #include @@ -10,19 +12,17 @@ #include #include #include -#include static void check_has_info(struct manifest *m, - bool keep, - unsigned int *timeleft, + unsigned int *timeleft UNNEEDED, struct score *score) { if (m->info_file) { score->pass = true; score->score = score->total; - add_info_options(m->info_file); + add_info_options(m); } else { - score->error = talloc_strdup(score, + score->error = tal_strdup(score, "You have no _info file.\n\n" "The file _info contains the metadata for a ccan package: things\n" "like the dependencies, the documentation for the package as a whole\n" @@ -31,8 +31,9 @@ static void check_has_info(struct manifest *m, } static const char template[] = - "#include \n" "#include \"config.h\"\n" + "#include \n" + "#include \n" "\n" "/**\n" " * %s - YOUR-ONE-LINE-DESCRIPTION-HERE\n" @@ -56,7 +57,8 @@ static const char template[] = " return 1;\n" "}\n"; -static void create_info_template(struct manifest *m, struct score *score) +static void create_info_template(struct manifest *m, + struct score *score UNNEEDED) { FILE *info; const char *filename; @@ -64,12 +66,12 @@ static void create_info_template(struct manifest *m, struct score *score) if (!ask("Should I create a template _info file for you?")) return; - filename = talloc_asprintf(m, "%s/%s", m->dir, "_info"); + filename = tal_fmt(m, "%s/%s", m->dir, "_info"); info = fopen(filename, "w"); if (!info) err(1, "Trying to create a template _info in %s", filename); - if (fprintf(info, template, m->basename) < 0) { + if (fprintf(info, template, m->modname) < 0) { unlink_noerr(filename); err(1, "Writing template into %s", filename); }