2 Copyright © 2012, The AROS Development Team. All rights reserved.
5 Function to write module_getlibbase.c. Part of genmodule.
10 void writegetlibbase(struct config
*cfg
, int is_rel
)
13 char line
[256], *banner
;
15 snprintf(line
, 255, "%s/%s_%sgetlibbase.c",
16 cfg
->libgendir
, cfg
->modulename
, is_rel
? "rel" : ""
18 out
= fopen(line
, "w");
26 banner
= getBanner(cfg
);
27 fprintf(out
, "%s\n", banner
);
35 "%s__aros_getbase_%s(void);\n"
37 "%s__aros_getbase_%s(void)\n"
41 cfg
->libbasetypeptrextern
, cfg
->libbase
,
42 cfg
->libbasetypeptrextern
, cfg
->libbase
,
43 cfg
->libbasetypeptrextern
, cfg
->libbase
,
50 "#include <exec/types.h>\n"
51 "char *__aros_getoffsettable(void);\n"
52 "extern IPTR __aros_rellib_offset_%s;\n"
54 "%s__aros_getbase_%s(void);\n"
56 "%s__aros_getbase_%s(void)\n"
58 " return *((%s*)(__aros_getoffsettable()+__aros_rellib_offset_%s));\n"
61 cfg
->libbasetypeptrextern
, cfg
->libbase
,
62 cfg
->libbasetypeptrextern
, cfg
->libbase
,
63 cfg
->libbasetypeptrextern
, cfg
->libbase