Too Busy For Words - the PaulWay Blog

Thu 17th Nov, 2011

Adding Cans to C

I've been meaning to copy some of my personal C libraries to CCAN, Rusty Russell's C Code Archive. It's not yet quite as comprehensive as he would like, I suspect, but it's certainly a good project. And I think, bold as this may be, that I have something to offer it even if I'm not a full-time C programmer.

The thing that's scared me off is the whole "meeting someone else's standards" thing. So after Rusty's talk at OSDC this year, and finding out that 'ccanlint' can prompt you with what you need to do to make a good package, I decided to give it a go. And after I started having a few minor problems understanding exactly what I needed to do to get it working, I decided to write it down here for other people.

  1. Check out the Git repository:
    git clone git://git.ozlabs.org/~ccan/ccan ; cd ccan
  2. Make everything:
    make
  3. Make the thing that isn't included in everything that you really need:
    make tools/ccanlint/ccanlint
  4. Create a directory for my work and put the already written stuff in there:
    mkdir ccan/cfile; cd ccan/cfile; cp ~/coding/pwlib-c/cfile/cfile* .
  5. Save yourself some typing: export CCT=../../tools; export CCL=$CCT/ccanlint/ccanlint
  6. Generate a standard configuration file for the project:
    $CCT/configurator/configurator > config.h
  7. Check what you've got so far:
    $CCL
    ccanlint will ask you if you want to create a _info file. This is the file which declares the 'metadata' about a ccan module. It's a C program. Let it generate it.
  8. Check what you've got so far:
    $CCL
    Keep repeating this step, fixing what ccanlint tells you is wrong, until you get a module in some form.
  9. Submit the module for inclusion in CCAN:
    haven't done this yet.

Last updated: | path: tech / c | permanent link to this entry


All posts licensed under the CC-BY-NC license. Author Paul Wayper.


Main index / tbfw/ - © 2004-2016 Paul Wayper
Valid HTML5 Valid CSS!