1 #include <tools/ccanlint/ccanlint.h>
11 #include <ccan/str/str.h>
12 #include <ccan/talloc/talloc.h>
13 #include <ccan/noerr/noerr.h>
15 static void check_has_main_header(struct manifest *m,
16 unsigned int *timeleft, struct score *score)
20 list_for_each(&m->h_files, f, list) {
21 if (strstarts(f->name, m->basename)
22 && strlen(f->name) == strlen(m->basename) + 2) {
24 score->score = score->total;
28 score->error = talloc_asprintf(score,
29 "You have no %s/%s.h header file.\n\n"
30 "CCAN modules have a name, the same as the directory name. They're\n"
31 "expected to have an interface in the header of the same name.\n",
32 m->basename, m->basename);
35 struct ccanlint main_header_exists = {
36 .key = "main_header_exists",
37 .name = "Module has main header file",
38 .check = check_has_main_header,
42 REGISTER_TEST(main_header_exists);