This tool is as simple as it can be, but is very powerful.
Start your program with the lines:
/*
FILE xxx.c
HEADER xxx.h
and the script will know that the header file is named xxx.h
After this any line between
TO_HEADER:
and a line
*/
will be copied into the header file almost verbatim. The copying process chops off all
//comment
like C++ comments.
Function prototypes should be started with a line containing:
/*FUNCTION*/
(All capital letters and no space.) Following this the prototype of the function is going to be copied into the header file until a line containing the two characters
){
is found. This closes the prototype and is converted to ); to be correct.
The header file is enclosed automatically
#ifndef __XXX_H__
#define __XXX_H__ 1
...
#endif
not to be included twice.
The code can be downloaded here as Perl and also here as ScriptBasic code.