licenses.h 925 B

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