2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
4 Desc: Function to write proto/modulename(_rel).h. Part of genmodule.
8 void writeincproto(struct config
*cfg
, int is_rel
)
11 char line
[256], define
[256], *banner
;
12 struct linelist
*linelistit
;
14 snprintf(line
, 255, "%s/proto/%s%s.h",
15 cfg
->gendir
, cfg
->modulename
, is_rel
? "_rel" : ""
17 out
= fopen(line
, "w");
25 banner
= getBanner(cfg
);
27 "#ifndef PROTO_%s%s_H\n"
28 "#define PROTO_%s%s_H\n"
32 , cfg
->modulenameupper
, is_rel
? "_REL" : ""
33 , cfg
->modulenameupper
, is_rel
? "_REL" : ""
38 "#ifdef __%s_RELLIBBASE__\n"
39 "#include <proto/%s_rel.h>\n"
40 "#else /* !__%s_RELLIBBASE__ */\n"
41 , cfg
->modulenameupper
43 , cfg
->modulenameupper
46 "#include <exec/types.h>\n"
47 "#include <aros/system.h>\n"
49 "#include <clib/%s_protos.h>\n"
57 "#if !defined(%s) && !defined(__NOLIBBASE__) && !defined(__%s_NOLIBBASE__)\n"
58 " #ifdef __%s_STDLIBBASE__\n"
59 " extern struct Library *%s;\n"
65 cfg
->libbase
, cfg
->modulenameupper
,
68 cfg
->libbasetypeptrextern
, cfg
->libbase
74 "#if !defined(%s) && !defined(__NOLIBBASE__) && !defined(__%s_NOLIBBASE__)\n"
75 "#ifndef __aros_getbase\n"
76 " void *__aros_getbase(void);\n"
78 " extern const IPTR __aros_rellib_offset_%s;\n"
79 "#define AROS_RELLIB_BASE_%s __aros_rellib_base_%s\n"
80 "#define AROS_RELLIB_OFFSET_%s __aros_rellib_offset_%s\n"
83 cfg
->libbase
, cfg
->modulenameupper
,
85 cfg
->modulenameupper
, cfg
->libbase
,
86 cfg
->modulenameupper
, cfg
->libbase
90 // define name must not start with a digit
91 // this solves a problem with proto/8svx.h
92 if (isdigit(cfg
->modulenameupper
[0]))
94 snprintf(define
, sizeof define
, "X%s", cfg
->modulenameupper
);
98 strncpy(define
, cfg
->modulenameupper
, sizeof define
);
104 "#if !defined(NOLIBINLINE) && !defined(%s_NOLIBINLINE)\n"
105 "# include <inline/%s%s.h>\n",
106 define
, cfg
->modulename
107 , (is_rel
) ? "_rel" : ""
112 "#%sif !defined(NOLIBDEFINES) && !defined(%s_NOLIBDEFINES)\n"
113 "# include <defines/%s%s.h>\n"
116 (is_rel
) ? "" : "el",
117 define
, cfg
->modulename
118 , (is_rel
) ? "_rel" : ""
122 "#endif /* !__%s_RELLIBBASE__ */\n"
123 , cfg
->modulenameupper
126 "#endif /* PROTO_%s_H */\n",