/* makeheaders.c Copyright (C) 2005-2007 Codemist Ltd */ /* * This code may be used and modified, and redistributed in binary * or source form, subject to the "CCL Public License", which should * accompany it. This license is a variant on the BSD license, and thus * permits use of code derived from this in either open and commercial * projects: but it does require that updates to this code be made * available back to the originators of the package. * Before merging other code in with this or linking this code * with other packages or libraries please check that the license terms * of the other material are compatible with those of this. */ /* Signature: 07b413e8 26-Jun-2007 */ /* * Transcribes some header files, stripping comments etc */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include /* * \ if not in comment next char not special * (I might not worry about the sequence "... \/* ...") * ' if not in comment go into char mode * " if not in comments go into string mode * / if not in string or char or comment check next char... * / then * go into comment mode * * in comment, check next char... * * then / end comment * */ /* * In some cases I may end up passing a file-name of the form * /cygdrive/d/path.../leaf * here. For things to behave I need to map that onto * d:/...path/leaf */ static FILE *myfopen(char *name, char *mode) { char newname[256]; if (strncmp(name, "/cygdrive/", 10) != 0) return fopen(name, mode); newname[0] = name[10]; newname[1] = ':'; strcpy(&newname[2], &name[11]); return fopen(newname, mode); } int main(int argc, char *argv[]) { int i; printf("char *config_header[] = {\n"); for (i=1; i