-
Notifications
You must be signed in to change notification settings - Fork 206
Module
rustyrussell edited this page Sep 28, 2011
·
2 revisions
Each CCAN module is a subdirectory of ccan/, eg. ccan/foo.
Moving your code there and running "ccanlint" will give you feedback; that tool is what we use to test modules and it's extremely useful. In particular:
- The module is built by compiling all the .c files.
- You can test for features by including config.h and using #if HAVE_.
- There should be a header of same name as the module, eg. ccan/foo/foo.h.
- An _info file contains metadata about the module.
- Unit Tests go into test/.
- LICENSE should be a symlink or contain the license text, except for Public domain code.
- API Documentation should be above each function in a kernel-doc style comment.
Other files and subdirectories are ignored, but it's generally better to place other files into subdirectories, so the code stands out. See Golden Rule.