scripts/nightly: fix typo
[AROS.git] / tools / genmodule / config.h
blobdaa01dd5c3ea16e82397434bd1188a90a3b08a29
1 /*
2 Copyright © 1995-2014, 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_PERTASKBASE, BIT_INCLUDES, BIT_NOINCLUDES,
23 BIT_STUBS, BIT_NOSTUBS, BIT_AUTOINIT, BIT_NOAUTOINIT,
24 BIT_RESAUTOINIT, BIT_NOOPENCLOSE, BIT_SELFINIT,
25 BIT_STACKCALL
27 enum optionflags
29 OPTION_NOAUTOLIB = 1<<BIT_NOAUTOLIB,
30 OPTION_NOEXPUNGE = 1<<BIT_NOEXPUNGE,
31 OPTION_NORESIDENT = 1<<BIT_NORESIDENT,
32 OPTION_DUPBASE = 1<<BIT_DUPBASE,
33 OPTION_PERTASKBASE = 1<<BIT_PERTASKBASE,
34 OPTION_INCLUDES = 1<<BIT_INCLUDES,
35 OPTION_NOINCLUDES = 1<<BIT_NOINCLUDES,
36 OPTION_STUBS = 1<<BIT_STUBS,
37 OPTION_NOSTUBS = 1<<BIT_NOSTUBS,
38 OPTION_AUTOINIT = 1<<BIT_AUTOINIT,
39 OPTION_NOAUTOINIT = 1<<BIT_NOAUTOINIT,
40 OPTION_RESAUTOINIT = 1<<BIT_RESAUTOINIT,
41 OPTION_NOOPENCLOSE = 1<<BIT_NOOPENCLOSE,
42 OPTION_SELFINIT = 1<<BIT_SELFINIT,
43 OPTION_STACKCALL = 1<<BIT_STACKCALL,
46 enum coptionbit { CBIT_PRIVATE };
47 enum coptionflags { COPTION_PRIVATE = 1<<CBIT_PRIVATE };
49 enum intcfgbit { BIT_GENASTUBS, BIT_NOREADFUNCS };
50 enum intcfgflags
52 CFG_GENASTUBS = 1<<BIT_GENASTUBS,
53 CFG_NOREADFUNCS = 1<<BIT_NOREADFUNCS /* all needed functions are available */
56 /* Classinfo is used to store the information of a BOOPSI class */
57 struct classinfo
59 struct classinfo *next;
61 /* Type and name of the class */
62 enum modtype classtype;
63 char *basename;
65 /* Priority with which the class will be initialized */
66 int initpri;
68 /* Additional options for the class */
69 enum coptionflags options;
71 const char **boopsimprefix;
72 char *classid, *superclass, *superclass_field, *classptr_field, *classptr_var;
73 char *dispatcher; /* == NULL when the generated dispatcher is used,
74 * otherwise it is the function name of the dispatcher */;
75 char *classdatatype; /* The type of the data for every object */
77 struct functionhead *methlist;
79 /* Interfaces used in this class (only for HIDD classes) */
80 struct stringlist *interfaces;
84 /* interfaceinfo is used to store the information of a BOOPSI class */
85 struct interfaceinfo
87 struct interfaceinfo *next;
89 /* id and base name of the interface */
90 char *interfaceid;
91 char *interfacename;
92 char *methodstub;
93 char *methodbase;
94 char *attributebase;
96 struct functionhead *methodlist;
97 struct functionhead *attributelist;
101 /* DOS handlers */
102 struct handlerinfo {
103 struct handlerinfo *next;
105 enum {
106 HANDLER_DOSTYPE, /* FileSysResource registered */
107 HANDLER_DOSNODE, /* Non-bootable DOS device */
108 HANDLER_RESIDENT, /* AddSegment() registered */
109 } type;
110 unsigned int id;
111 char *name;
112 int autodetect; /* Autodetect priority (0 for not autodetectable) */
113 /* DeviceNode overrides */
114 int bootpri; /* Boot priority */
115 int priority; /* Task priority */
116 int stacksize; /* Stacksize information */
117 int startup; /* Startup id */
120 struct config
122 /* members that store filename and paths derived from argv */
123 char *conffile, *gendir, *genincdir;
125 /* The name and type of the module */
126 char *modulename, *modulenameupper;
127 enum modtype modtype;
128 char *modtypestr;
129 char *suffix;
130 char *includename, *includenameupper;
132 /* Extra string to include in version */
133 char *versionextra;
135 /* firstlvo is the LVO number of the first user definable function
136 * in the module
138 unsigned int firstlvo;
140 /* What to do ? */
141 enum command command;
143 /* Name for variables and types */
144 char *basename, *libbase, *libbasetype, *libbasetypeptrextern;
147 /* The default path to put the module relative to SYS: */
148 char *moddir;
150 /* The names of the fields in the custom library base for storing internal
151 * information
153 char *sysbase_field, *seglist_field, *rootbase_field, *oopbase_field;
155 /* Some additional options, see optionsflags enum above */
156 enum optionflags options;
158 /* Internal configuration flags */
159 enum intcfgflags intcfg;
161 /* Further configuration data for the generated Resident struct */
162 char *datestring, *copyright;
163 int residentpri;
164 unsigned int majorversion, minorversion;
165 char *addromtag;
167 /* In forcelist a list of basenames is present that need to be present in the
168 * static link library so that certain libraries are opened by a program
170 struct stringlist *forcelist;
172 /* Code to add to the generated files */
173 struct stringlist *cdeflines, *cdefprivatelines, *startuplines;
175 /* device specific data */
176 char *beginiofunc, *abortiofunc;
178 /* The functions of this module */
179 struct functionhead *funclist;
181 /* The classes defined in this module */
182 struct classinfo *classlist;
184 /* The interface defined in this module */
185 struct interfaceinfo *interfacelist;
187 /* The DOS IDs and handlers for this module */
188 char *handlerfunc;
189 struct handlerinfo *handlerlist;
191 /* Relative libraries used by this library
193 struct stringlist *rellibs;
196 /* Function prototypes */
198 struct config *initconfig(int, char **);
200 char* getBanner(struct config*);
201 void freeBanner(char*);
203 #endif //_CONFIG_H