Added new type "usbclass" to archtool and genmodule. I hope I didn't mess things...
[cake.git] / tools / genmodule / config.h
blob1d4a13a62cde65ab8a4f69b07c6b4674a1a2a14b
1 /*
2 Copyright © 1995-2008, 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, DUMMY, FILES, LIBDEFS, INCLUDES, MAKEFILE, WRITEFUNCLIST };
17 enum modtype { UNSPECIFIED, LIBRARY, MCC, MUI, MCP, DEVICE, RESOURCE, IMAGE, GADGET,
18 DATATYPE, CLASS, HIDD, USBCLASS
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
25 enum optionflags
27 OPTION_NOAUTOLIB = 1<<BIT_NOAUTOLIB,
28 OPTION_NOEXPUNGE = 1<<BIT_NOEXPUNGE,
29 OPTION_NORESIDENT = 1<<BIT_NORESIDENT,
30 OPTION_DUPBASE = 1<<BIT_DUPBASE,
31 OPTION_DUPPERID = 1<<BIT_DUPPERID,
32 OPTION_INCLUDES = 1<<BIT_INCLUDES,
33 OPTION_NOINCLUDES = 1<<BIT_NOINCLUDES,
34 OPTION_STUBS = 1<<BIT_STUBS,
35 OPTION_NOSTUBS = 1<<BIT_NOSTUBS,
36 OPTION_AUTOINIT = 1<<BIT_AUTOINIT,
37 OPTION_NOAUTOINIT = 1<<BIT_NOAUTOINIT
40 enum coptionbit { CBIT_PRIVATE };
41 enum coptionflags { COPTION_PRIVATE = 1<<CBIT_PRIVATE };
43 enum intcfgbit { BIT_GENASTUBS, BIT_NOREADREF };
44 enum intcfgflags
46 CFG_GENASTUBS = 1<<BIT_GENASTUBS,
47 CFG_NOREADREF = 1<<BIT_NOREADREF
50 /* Classinfo is used to store the information of a BOOPSI class */
51 struct classinfo
53 struct classinfo *next;
55 /* Type and name of the class */
56 enum modtype classtype;
57 char *basename;
59 /* Priority with which the class will be initialized */
60 int initpri;
62 /* Additional options for the class */
63 enum coptionflags options;
65 const char **boopsimprefix;
66 char *classid, *superclass, *superclass_field, *classptr_field, *classptr_var;
67 char *dispatcher; /* == NULL when the generated dispatcher is used,
68 * otherwise it is the function name of the dispatcher */;
69 char *classdatatype; /* The type of the data for every object */
71 struct functionhead *methlist;
73 /* Interfaces used in this class (only for HIDD classes) */
74 struct stringlist *interfaces;
77 struct config
79 /* members that store filename and paths derived from argv */
80 char *conffile, *gendir, *genincdir, *reffile;
82 /* The name and type of the module */
83 char *modulename, *modulenameupper;
84 enum modtype modtype;
85 char *suffix;
87 /* firstlvo is the LVO number of the first user definable function
88 * in the module
90 unsigned int firstlvo;
92 /* What to do ? */
93 enum command command;
95 /* Name for variables and types */
96 char *basename, *libbase, *libbasetype, *libbasetypeptrextern;
99 /* The default path to put the module relative to SYS: */
100 char *moddir;
102 /* The names of the fields in the custom library base for storing internal
103 * information
105 char *sysbase_field, *seglist_field, *rootbase_field;
107 /* Some additional options, see optionsflags enum above */
108 enum optionflags options;
110 /* Internal configuration flags */
111 enum intcfgflags intcfg;
113 /* Further configuration data for the generated Resident struct */
114 char *datestring, *copyright;
115 int residentpri;
116 unsigned int majorversion, minorversion;
118 /* In forcelist a list of basenames is present that need to be present in the
119 * static link library so that certain libraries are opened by a program
121 struct stringlist *forcelist;
123 /* Code to add to the generated fioles */
124 struct stringlist *cdeflines, *cdefprivatelines;
126 /* device specific data */
127 char *beginiofunc, *abortiofunc;
129 /* For option peridbase */
130 char *getidfunc;
132 /* The functions of this module */
133 struct functionhead *funclist;
135 /* The classes defined in this module */
136 struct classinfo *classlist;
139 /* Function prototypes */
141 struct config *initconfig(int, char **);
143 const char* getBanner(struct config*);
144 void freeBanner(char*);
146 #endif //_CONFIG_H