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, unsigned int *timeleft)
19 list_for_each(&m->h_files, f, list) {
20 if (strstarts(f->name, m->basename)
21 && strlen(f->name) == strlen(m->basename) + 2)
27 static const char *describe_has_main_header(struct manifest *m,
30 return talloc_asprintf(m,
31 "You have no %s/%s.h header file.\n\n"
32 "CCAN modules have a name, the same as the directory name. They're\n"
33 "expected to have an interface in the header of the same name.\n",
34 m->basename, m->basename);
37 struct ccanlint has_main_header = {
38 .key = "has-main-header",
39 .name = "Module has main header file",
40 .check = check_has_main_header,
41 .describe = describe_has_main_header,
44 REGISTER_TEST(has_main_header, NULL);