codemap - C code documentation generator.
Codemap is used for fast creation of sourcecode-based documentation. It generates html documentation from C source code files by analyzing simple meta markup.
Codemap markup has following structure:
MAP SECTION_1 ELEMENT_1 ELEMENT_N SECTION_N ELEMENT_1 ELEMENT_N
map tag organizes all sections together (under sub-sections) and used to generate documentation index file.
section tag groups elements together.
def tag describe element's like functions, macroses or
code examples. Following description tags can be used:
desc - text description till /desc tag.
it - description of some argument till /it tag.
ret - description of returnt value till /ret tag.
After that, def tag copies all code content till end or the next def tag.
All tag declarations must be placed in /** **/ C comment.
Example
This Documentation would be generated on following file:
/* lib.c */ #include <stdlib.h> #include <stdio.h> /** <map> <name>HelloWorld API reference manual.</name> <desc>HelloWorld project.</desc> <sub 'main stuff'> <attach 'sectionA'> </sub> <sub 'other'> <attach 'sectionB'> </sub> </map> **/ /** <section sectionA 'section A name'> Description of Some very important stuff from sectionA. </section> **/ /** <def sectionA somecallback_t> <desc>Callback type used in record listing and matching. </desc> <it 'ptr'>user specified data.</it> <it 'name'>record name.</it> <it 'category'>category name.</it> <it 'rating'>record rating value.</it> <it 'date'>record creation date.</it> <it 'update'>record update date.</it> **/ typedef void (*somecallback_t)(void * ptr, char * name, char * category, int rating, int date_d, int date_m, int date_y, int up_d, int up_m, int up_y); /** <def sectionA 'hello_func()'> <desc>prints "hello ARG1 world ARG2"</desc> <it 'arg1'>arg1 description.</it> <it 'arg2'>arg2 description.</it> <it 'category'>category name.</it> <ret>magic number.</ret> **/ int hello_func(char * arg1, char * arg2); /** <end> **/ /** <section sectionB 'section B name'> Description of Some very important stuff from sectionB. </section> **/ /** <def sectionB 'MAX'> <desc>MAX macro description</desc> <it 'A, B'>integer arguments</it> **/ #define MAX(A, B) (((A) > (B)) ? (A) : (B)) /** <end> **/ int hello_func(char * arg1, char * arg2) { printf("hello %s world %s\n", arg1, arg2); return 1234; }