Add Allwinner Technology to the vendor ID list
[AROS.git] / tools / genmodule / writeincclib.c
blob91c1a80531617e7c7adec94e9570843fb1cbb413
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Function to write clib/modulename_protos.h. Part of genmodule.
6 */
7 #include "genmodule.h"
9 void writeincclib(struct config *cfg)
11 FILE *out;
12 char line[256], *banner;
13 struct functionhead *funclistit;
14 struct functionarg *arglistit;
15 struct stringlist *linelistit;
17 snprintf(line, 255, "%s/clib/%s_protos.h", cfg->gendir, cfg->includename);
19 out = fopen(line, "w");
21 if (out == NULL)
23 perror(line);
24 exit(20);
27 banner = getBanner(cfg);
28 fprintf(out,
29 "#ifndef CLIB_%s_PROTOS_H\n"
30 "#define CLIB_%s_PROTOS_H\n"
31 "\n"
32 "%s"
33 "\n"
34 "#include <aros/libcall.h>\n"
35 "\n",
36 cfg->includenameupper, cfg->includenameupper, banner
38 freeBanner(banner);
40 for (linelistit = cfg->cdeflines; linelistit!=NULL; linelistit = linelistit->next)
41 fprintf(out, "%s\n", linelistit->s);
43 fprintf(out,
44 "\n"
45 "__BEGIN_DECLS\n"
46 "\n"
49 writefuncprotos(out, cfg, cfg->funclist);
51 fprintf(out,
52 "\n"
53 "__END_DECLS\n"
54 "\n"
55 "#endif /* CLIB_%s_PROTOS_H */\n",
56 cfg->includenameupper);