- Set a default PCM volume so that something can be heard when driver is
[AROS.git] / tools / genmodule / writeincproto.c
blob3c074b27f5dee3291a347eeeea8def8124aa96b6
1 /*
2 Copyright © 1995-2009, The AROS Development Team. All rights reserved.
4 Desc: Function to write proto/modulename.h. Part of genmodule.
5 */
6 #include "genmodule.h"
8 void writeincproto(struct config *cfg)
10 FILE *out;
11 char line[256], *banner;
12 struct linelist *linelistit;
14 snprintf(line, 255, "%s/proto/%s.h", cfg->gendir, cfg->modulename);
15 out = fopen(line, "w");
17 if (out == NULL)
19 perror(line);
20 exit(20);
23 banner = getBanner(cfg);
24 fprintf(out,
25 "#ifndef PROTO_%s_H\n"
26 "#define PROTO_%s_H\n"
27 "\n"
28 "%s"
29 "\n"
30 "#include <exec/types.h>\n"
31 "#include <aros/system.h>\n"
32 "\n"
33 "#include <clib/%s_protos.h>\n"
34 "\n"
35 "#if !defined(%s) && !defined(__NOLIBBASE__) && !defined(__%s_NOLIBBASE__)\n"
36 " #ifdef __%s_STDLIBBASE__\n"
37 " extern struct Library *%s;\n"
38 " #else\n"
39 " extern %s%s;\n"
40 " #endif\n"
41 "#endif\n"
42 "\n",
43 cfg->modulenameupper, cfg->modulenameupper, banner,
44 cfg->modulename,
45 cfg->libbase, cfg->modulenameupper,
46 cfg->modulenameupper,
47 cfg->libbase,
48 cfg->libbasetypeptrextern, cfg->libbase
50 freeBanner(banner);
52 fprintf(out,
53 "#if !defined(NOLIBINLINE) && !defined(%s_NOLIBINLINE)\n"
54 "# include <inline/%s.h>\n"
55 "#elif !defined(NOLIBDEFINES) && !defined(%s_NOLIBDEFINES)\n"
56 "# include <defines/%s.h>\n"
57 "#endif\n"
58 "\n"
59 "#endif /* PROTO_%s_H */\n",
60 cfg->modulenameupper, cfg->modulename,
61 cfg->modulenameupper, cfg->modulename,
62 cfg->modulenameupper
64 fclose(out);