]> git.ozlabs.org Git - ccan/blob - tools/ccanlint/licenses.h
ccanlint: fix ccanlint -l
[ccan] / tools / ccanlint / licenses.h
1 #ifndef CCANLINT_LICENSES_H
2 #define CCANLINT_LICENSES_H
3 #include <stdbool.h>
4
5 enum license {
6         LICENSE_LGPLv2_PLUS,
7         LICENSE_LGPLv2,
8         LICENSE_LGPLv3,
9         LICENSE_LGPL,
10         LICENSE_GPLv2_PLUS,
11         LICENSE_GPLv2,
12         LICENSE_GPLv3,
13         LICENSE_GPL,
14         LICENSE_BSD,
15         LICENSE_MIT,
16         LICENSE_PUBLIC_DOMAIN,
17         LICENSE_UNKNOWN
18 };
19
20 #define NUM_CLAUSES 3
21
22 struct license_info {
23         const char *name;
24         const char *shortname;
25         /* Edit distance is expensive, and this works quite well. */
26         const char *clause[NUM_CLAUSES];
27 };
28
29 /* Is [project license][file license] compatible? */
30 bool license_compatible[LICENSE_UNKNOWN+1][LICENSE_UNKNOWN];
31
32 extern const struct license_info licenses[];
33
34 struct ccan_file;
35 bool find_boilerplate(struct ccan_file *f, enum license license);
36
37 struct doc_section;
38 enum license which_license(struct doc_section *d);
39
40 struct manifest;
41 struct doc_section *find_license_tag(const struct manifest *m);
42
43 #endif /* CCANLINT_LICENSES_H */