First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xfree86 / utils / xorgcfg / loader.h
blob16c527327f799e730b13ead57811af3639251dc9
1 /*
2 * Copyright (c) 2000 by Conectiva S.A. (http://www.conectiva.com)
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * CONECTIVA LINUX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
19 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 * SOFTWARE.
22 * Except as contained in this notice, the name of Conectiva Linux shall
23 * not be used in advertising or otherwise to promote the sale, use or other
24 * dealings in this Software without prior written authorization from
25 * Conectiva Linux.
27 * Author: Paulo César Pereira de Andrade <pcpa@conectiva.com.br>
31 #ifdef USE_MODULES
32 #ifndef LOADER_PRIVATE
33 #include "config.h"
34 #include "stubs.h"
36 #else
38 #define IN_LOADER
40 #include "xf86.h"
41 #include "xf86str.h"
42 #include "xf86Opt.h"
43 #include "xf86Module.h"
45 #ifndef XINPUT
46 #define XINPUT
47 #endif
48 #include "xf86Xinput.h"
50 #include <X11/fonts/fontmod.h>
51 #include "loaderProcs.h"
53 #include <sym.h>
55 void LoaderDefaultFunc(void);
56 #endif
58 #ifndef _xf86cfg_loader_h
59 #define _xf86cfg_loader_h
61 void xf86cfgLoaderInit(void);
62 void xf86cfgLoaderInitList(int);
63 void xf86cfgLoaderFreeList(void);
64 int xf86cfgCheckModule(void);
66 #ifndef LOADER_PRIVATE
67 /* common/xf86Opt.h */
68 typedef struct {
69 double freq;
70 int units;
71 } OptFrequency;
73 typedef union {
74 unsigned long num;
75 char * str;
76 double realnum;
77 Bool xbool;
78 OptFrequency freq;
79 } ValueUnion;
81 typedef enum {
82 OPTV_NONE = 0,
83 OPTV_INTEGER,
84 OPTV_STRING, /* a non-empty string */
85 OPTV_ANYSTR, /* Any string, including an empty one */
86 OPTV_REAL,
87 OPTV_BOOLEAN,
88 OPTV_FREQ
89 } OptionValueType;
91 typedef enum {
92 OPTUNITS_HZ = 1,
93 OPTUNITS_KHZ,
94 OPTUNITS_MHZ
95 } OptFreqUnits;
97 typedef struct {
98 int token;
99 const char* name;
100 OptionValueType type;
101 ValueUnion value;
102 Bool found;
103 } OptionInfoRec, *OptionInfoPtr;
105 /* fontmod.h */
106 typedef void (*InitFont)(void);
108 typedef struct {
109 InitFont initFunc;
110 char * name;
111 void *module;
112 } FontModule;
114 extern FontModule *FontModuleList;
116 typedef struct {
117 int token; /* id of the token */
118 const char * name; /* token name */
119 } SymTabRec, *SymTabPtr;
120 #endif /* !LOADER_PRIVATE */
122 typedef enum {
123 NullModule = 0,
124 VideoModule,
125 InputModule,
126 GenericModule,
127 FontRendererModule
128 } ModuleType;
130 typedef struct _xf86cfgModuleOptions {
131 char *name;
132 ModuleType type;
133 OptionInfoPtr option;
134 int vendor;
135 SymTabPtr chipsets;
136 struct _xf86cfgModuleOptions *next;
137 } xf86cfgModuleOptions;
139 extern xf86cfgModuleOptions *module_options;
141 /* When adding a new code to the LEGEND, also update checkerLegend
142 * in loader.c
144 extern char **checkerLegend;
145 extern int *checkerErrors;
146 #define CHECKER_OPTIONS_FILE_MISSING 1
147 #define CHECKER_OPTION_DESCRIPTION_MISSING 2
148 #define CHECKER_LOAD_FAILED 3
149 #define CHECKER_RECOGNIZED_AS 4
150 #define CHECKER_NO_OPTIONS_AVAILABLE 5
151 #define CHECKER_NO_VENDOR_CHIPSET 6
152 #define CHECKER_CANNOT_VERIFY_CHIPSET 7
153 #define CHECKER_OPTION_UNUSED 8
154 #define CHECKER_NOMATCH_CHIPSET_STRINGS 9
155 #define CHECKER_CHIPSET_NOT_LISTED 10
156 #define CHECKER_CHIPSET_NOT_SUPPORTED 11
157 #define CHECKER_CHIPSET_NO_VENDOR 12
158 #define CHECKER_NO_CHIPSETS 13
159 #define CHECKER_FILE_MODULE_NAME_MISMATCH 14
161 #define CHECKER_LAST_MESSAGE 14
163 extern void CheckMsg(int, char*, ...);
165 #ifndef LOADER_PRIVATE
166 int LoaderInitializeOptions(void);
167 #endif
168 #endif /* USE_MODULES */
170 #endif /* _xf86cfg_loader_h */