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,
17 unsigned int *timeleft, struct score *score)
21 list_for_each(&m->h_files, f, list) {
22 if (strstarts(f->name, m->basename)
23 && strlen(f->name) == strlen(m->basename) + 2) {
25 score->score = score->total;
29 score->error = talloc_asprintf(score,
30 "You have no %s/%s.h header file.\n\n"
31 "CCAN modules have a name, the same as the directory name. They're\n"
32 "expected to have an interface in the header of the same name.\n",
33 m->basename, m->basename);
36 struct ccanlint main_header_exists = {
37 .key = "main_header_exists",
38 .name = "Module has main header file",
39 .check = check_has_main_header,
43 REGISTER_TEST(main_header_exists);