licenses.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef CCANLINT_LICENSES_H
  2. #define CCANLINT_LICENSES_H
  3. #include <stdbool.h>
  4. #include <ccan/tal/tal.h>
  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. #define NUM_CLAUSES 3
  21. struct license_info {
  22. const char *name;
  23. const char *shortname;
  24. const char *describe;
  25. /* Edit distance is expensive, and this works quite well. */
  26. const char *clause[NUM_CLAUSES];
  27. };
  28. /* Is [project license][file license] compatible? */
  29. bool license_compatible[LICENSE_UNKNOWN+1][LICENSE_UNKNOWN];
  30. extern const struct license_info licenses[];
  31. struct ccan_file;
  32. bool find_boilerplate(struct ccan_file *f, enum license license);
  33. struct doc_section;
  34. enum license which_license(struct doc_section *d);
  35. struct manifest;
  36. struct doc_section *find_license_tag(const struct manifest *m);
  37. const char *get_license_oneliner(const tal_t *ctx, enum license license);
  38. #endif /* CCANLINT_LICENSES_H */