]> git.ozlabs.org Git - ccan/blob - tools/ccanlint/licenses.h
tools: manifest.c should use path_canon.
[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_CC0,
17         LICENSE_PUBLIC_DOMAIN,
18         LICENSE_UNKNOWN
19 };
20
21 #define NUM_CLAUSES 3
22
23 struct license_info {
24         const char *name;
25         const char *shortname;
26         /* Edit distance is expensive, and this works quite well. */
27         const char *clause[NUM_CLAUSES];
28 };
29
30 /* Is [project license][file license] compatible? */
31 bool license_compatible[LICENSE_UNKNOWN+1][LICENSE_UNKNOWN];
32
33 extern const struct license_info licenses[];
34
35 struct ccan_file;
36 bool find_boilerplate(struct ccan_file *f, enum license license);
37
38 struct doc_section;
39 enum license which_license(struct doc_section *d);
40
41 struct manifest;
42 struct doc_section *find_license_tag(const struct manifest *m);
43
44 #endif /* CCANLINT_LICENSES_H */