Skip to content
Andrew Jeffery edited this page Sep 11, 2015 · 3 revisions

All the metadata for a package is contained in _info. It's a C program, and much of it is encoded in the standard Documentation style, to provide the documentation for the code as a whole. This is parsed by ccanlint.

The following sections in the comment are standard:

  1. First line. This is of form "foo - one line description" and is extracted to the web page.
  2. Description. This is a freeform longer description, and is also extracted to the web page.
  3. Author: The author (or authors) of the code, basically freeform.
  4. Maintainer: If present, this is who should get bug reports.
  5. License: See Licenses. This can be anything, but ccanlint recognizes certain ones and checks them against the LICENSE symlink, ccan dependencies, and files.
  6. Example: A fully-compilable example, tested by ccanlint and published on the web page. See ccanlint/examples.
  7. Ccanlint: Options for Ccanlint, one per line, most commonly of form " FAIL" to indicate a known failure.

The rest is a standard C program, which prints out multi-line answers given a single command line argument. The currently-defined arguments are:

  1. depends. Print out the dependencies, one per line. Other CCAN modules have a ccan/ prefix, otherwise it's the commonly preferred name of the external dependency (those are currently for human consumption). Exit with status 0.
  2. libs (optional). Print out any libraries required, one per line. These will be given as arguments following "-l" on the link line. Exit with status 0.
  3. cflags (optional). Print out any extra flags that might be required to cleanly compile, one per line. Exit with status 0.
  4. Any unsupported option should cause an non-0 exit status.

Why an executable program? Because dependencies are platform and even configuration dependent, and can require complex calculations to determine them. Since every CCAN author knows C, it seems the logical choice.

Clone this wiki locally