2 Copyright © 1995-2005, The AROS Development Team. All rights reserved.
5 Function to write modulename_mcc_init.c. Part of genmodule.
8 #include "boopsisupport.h"
10 void writemccinit(FILE *out
, struct config
*cfg
, struct functions
*functions
)
12 struct functionhead
*methlistit
;
13 struct functionarg
*arglistit
;
14 struct stringlist
*linelistit
;
20 "/* Initialisation routines of a MUI class */\n"
21 "/* =======================================*/\n"
23 "#include <dos/dosextens.h>\n"
24 "#include <aros/debug.h>\n"
26 "#include <intuition/classes.h>\n"
27 "#include <intuition/classusr.h>\n"
29 "#include <proto/exec.h>\n"
30 "#include <proto/utility.h>\n"
31 "#include <proto/dos.h>\n"
32 "#include <proto/graphics.h>\n"
33 "#include <proto/intuition.h>\n"
34 "#include <proto/muimaster.h>\n"
36 "#include <aros/symbolsets.h>\n"
41 for(linelistit
= cfg
->cdeflines
; linelistit
!= NULL
; linelistit
= linelistit
->next
)
43 fprintf(out
, "%s\n", linelistit
->s
);
50 "/*** Instance data structure size ***************************************/\n"
51 "#ifndef NO_CLASS_DATA\n"
52 "# define %s_DATA_SIZE (sizeof(struct %s_DATA))\n"
54 "# define %s_DATA_SIZE (0)\n"
56 cfg
->basename
, cfg
->basename
, cfg
->basename
64 "/*** Variables **************************************************************/\n"
65 "struct MUI_CustomClass *MCC;\n"
68 "/*** Prototypes *************************************************************/\n"
73 methlistit
= functions
->methlist
;
75 methlistit
= methlistit
->next
)
79 fprintf(out
, "%s %s__%s(", methlistit
->type
, cfg
->basename
, methlistit
->name
);
83 arglistit
= methlistit
->arguments
;
85 arglistit
= arglistit
->next
93 fprintf(out
, "%s", arglistit
->arg
);
99 writeboopsidispatcher(out
, cfg
, functions
);
106 "/*** Library startup and shutdown *******************************************/\n"
107 "AROS_SET_LIBFUNC(MCC_Startup, LIBBASETYPE, LIBBASE)\n"
109 " AROS_SET_LIBFUNC_INIT\n"
111 " MCC = MUI_CreateCustomClass((struct Library *) LIBBASE, \"%s\", NULL, %s_DATA_SIZE, %s_Dispatcher);\n"
113 " return MCC != NULL;\n"
115 " AROS_SET_LIBFUNC_EXIT\n"
118 "AROS_SET_LIBFUNC(MCC_Shutdown, LIBBASETYPE, LIBBASE)\n"
120 " AROS_SET_LIBFUNC_INIT\n"
122 " MUI_DeleteCustomClass(MCC);\n"
125 " AROS_SET_LIBFUNC_EXIT\n"
128 "ADD2INITLIB(MCC_Startup, 0);\n"
129 "ADD2EXPUNGELIB(MCC_Shutdown, 0);\n",
130 cfg
->superclass
, cfg
->basename
, cfg
->basename