licenses.h 939 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_CC0,
  16. LICENSE_PUBLIC_DOMAIN,
  17. LICENSE_UNKNOWN
  18. };
  19. #define NUM_CLAUSES 3
  20. struct license_info {
  21. const char *name;
  22. const char *shortname;
  23. /* Edit distance is expensive, and this works quite well. */
  24. const char *clause[NUM_CLAUSES];
  25. };
  26. /* Is [project license][file license] compatible? */
  27. bool license_compatible[LICENSE_UNKNOWN+1][LICENSE_UNKNOWN];
  28. extern const struct license_info licenses[];
  29. struct ccan_file;
  30. bool find_boilerplate(struct ccan_file *f, enum license license);
  31. struct doc_section;
  32. enum license which_license(struct doc_section *d);
  33. struct manifest;
  34. struct doc_section *find_license_tag(const struct manifest *m);
  35. #endif /* CCANLINT_LICENSES_H */