genmodule: Add 'oopbase_field' config item
[AROS.git] / tools / genmodule / config.h
blob88140e234827abdeddb7fcd56af86a0c185d4433
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
4 Desc: Define the C structure for storing the command line options and the
5 module config data
6 */
8 #ifndef _CONFIG_H
9 #define _CONFIG_H
11 #include <assert.h>
13 #include "functionhead.h"
14 #include "stringlist.h"
16 enum command { CMD_UNSPECIFIED, FILES, LIBDEFS, INCLUDES, MAKEFILE, WRITEFUNCLIST, WRITEFD, WRITESKEL };
17 enum modtype { UNSPECIFIED, LIBRARY, MCC, MUI, MCP, DEVICE, RESOURCE, IMAGE, GADGET,
18 DATATYPE, CLASS, HIDD, USBCLASS, HANDLER
21 enum optionbit { BIT_NOAUTOLIB, BIT_NOEXPUNGE, BIT_NORESIDENT,
22 BIT_DUPBASE, BIT_DUPPERID, BIT_INCLUDES, BIT_NOINCLUDES,
23 BIT_STUBS, BIT_NOSTUBS, BIT_AUTOINIT, BIT_NOAUTOINIT,
24 BIT_RESAUTOINIT, BIT_NOOPENCLOSE, BIT_SELFINIT, BIT_BASEREL
26 enum optionflags
28 OPTION_NOAUTOLIB = 1<<BIT_NOAUTOLIB,
29 OPTION_NOEXPUNGE = 1<<BIT_NOEXPUNGE,
30 OPTION_NORESIDENT = 1<<BIT_NORESIDENT,
31 OPTION_DUPBASE = 1<<BIT_DUPBASE,
32 OPTION_DUPPERID = 1<<BIT_DUPPERID,
33 OPTION_INCLUDES = 1<<BIT_INCLUDES,
34 OPTION_NOINCLUDES = 1<<BIT_NOINCLUDES,
35 OPTION_STUBS = 1<<BIT_STUBS,
36 OPTION_NOSTUBS = 1<<BIT_NOSTUBS,
37 OPTION_AUTOINIT = 1<<BIT_AUTOINIT,
38 OPTION_NOAUTOINIT = 1<<BIT_NOAUTOINIT,
39 OPTION_RESAUTOINIT = 1<<BIT_RESAUTOINIT,
40 OPTION_NOOPENCLOSE = 1<<BIT_NOOPENCLOSE,
41 OPTION_SELFINIT = 1<<BIT_SELFINIT,
42 OPTION_BASEREL = 1<<BIT_BASEREL
45 enum coptionbit { CBIT_PRIVATE };
46 enum coptionflags { COPTION_PRIVATE = 1<<CBIT_PRIVATE };
48 enum intcfgbit { BIT_GENASTUBS, BIT_NOREADFUNCS };
49 enum intcfgflags
51 CFG_GENASTUBS = 1<<BIT_GENASTUBS,
52 CFG_NOREADFUNCS = 1<<BIT_NOREADFUNCS /* all needed functions are available */
55 /* Classinfo is used to store the information of a BOOPSI class */
56 struct classinfo
58 struct classinfo *next;
60 /* Type and name of the class */
61 enum modtype classtype;
62 char *basename;
64 /* Priority with which the class will be initialized */
65 int initpri;
67 /* Additional options for the class */
68 enum coptionflags options;
70 const char **boopsimprefix;
71 char *classid, *superclass, *superclass_field, *classptr_field, *classptr_var;
72 char *dispatcher; /* == NULL when the generated dispatcher is used,
73 * otherwise it is the function name of the dispatcher */;
74 char *classdatatype; /* The type of the data for every object */
76 struct functionhead *methlist;
78 /* Interfaces used in this class (only for HIDD classes) */
79 struct stringlist *interfaces;
82 /* DOS handlers */
83 struct handlerinfo {
84 struct handlerinfo *next;
86 enum {
87 HANDLER_DOSTYPE, /* FileSysResource registered */
88 HANDLER_DOSNODE, /* Non-bootable DOS device */
89 HANDLER_RESIDENT, /* AddSegment() registered */
90 } type;
91 unsigned int id;
92 char *name;
93 int autodetect; /* Autodetect priority (0 for not autodetectable) */
94 /* DeviceNode overrides */
95 int priority; /* Task priority */
96 int stacksize; /* Stacksize information */
98 char *handler; /* Name of the handler */
101 struct config
103 /* members that store filename and paths derived from argv */
104 char *conffile, *gendir, *genincdir;
106 /* The name and type of the module */
107 char *modulename, *modulenameupper;
108 enum modtype modtype;
109 char *suffix;
111 /* firstlvo is the LVO number of the first user definable function
112 * in the module
114 unsigned int firstlvo;
116 /* What to do ? */
117 enum command command;
119 /* Name for variables and types */
120 char *basename, *libbase, *libbasetype, *libbasetypeptrextern;
123 /* The default path to put the module relative to SYS: */
124 char *moddir;
126 /* The names of the fields in the custom library base for storing internal
127 * information
129 char *sysbase_field, *seglist_field, *rootbase_field, *oopbase_field;
131 /* Some additional options, see optionsflags enum above */
132 enum optionflags options;
134 /* Internal configuration flags */
135 enum intcfgflags intcfg;
137 /* Further configuration data for the generated Resident struct */
138 char *datestring, *copyright;
139 int residentpri;
140 unsigned int majorversion, minorversion;
141 char *addromtag;
143 /* In forcelist a list of basenames is present that need to be present in the
144 * static link library so that certain libraries are opened by a program
146 struct stringlist *forcelist;
148 /* Code to add to the generated files */
149 struct stringlist *cdeflines, *cdefprivatelines, *startuplines;
151 /* device specific data */
152 char *beginiofunc, *abortiofunc;
154 /* For option peridbase */
155 char *getidfunc;
157 /* The functions of this module */
158 struct functionhead *funclist;
160 /* The classes defined in this module */
161 struct classinfo *classlist;
163 /* The DOS IDs and handlers for this module */
164 struct handlerinfo *handlerlist;
167 /* Function prototypes */
169 struct config *initconfig(int, char **);
171 char* getBanner(struct config*);
172 void freeBanner(char*);
174 #endif //_CONFIG_H