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