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