3 * Copyright (c) 1997 Metro Link Incorporated
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * Except as contained in this notice, the name of the Metro Link shall not be
24 * used in advertising or otherwise to promote the sale, use or other dealings
25 * in this Software without prior written authorization from Metro Link.
29 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
38 * The above copyright notice and this permission notice shall be included in
39 * all copies or substantial portions of the Software.
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
45 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47 * OTHER DEALINGS IN THE SOFTWARE.
49 * Except as contained in this notice, the name of the copyright holder(s)
50 * and author(s) shall not be used in advertising or otherwise to promote
51 * the sale, use or other dealings in this Software without prior written
52 * authorization from the copyright holder(s) and author(s).
56 * This file contains the external interfaces for the XFree86 configuration
59 #ifdef HAVE_XORG_CONFIG_H
60 #include <xorg-config.h>
63 #ifndef _xf86Parser_h_
64 #define _xf86Parser_h_
66 #include <X11/Xdefs.h>
67 #include "xf86Optrec.h"
70 #define HAVE_PARSER_DECLS
74 char *file_modulepath
;
78 } XF86ConfFilesRec
, *XF86ConfFilesPtr
;
80 /* Values for load_type */
81 #define XF86_LOAD_MODULE 0
82 #define XF86_LOAD_DRIVER 1
83 #define XF86_DISABLE_MODULE 2
89 XF86OptionPtr load_opt
;
92 } XF86LoadRec
, *XF86LoadPtr
;
95 XF86LoadPtr mod_load_lst
;
96 XF86LoadPtr mod_disable_lst
;
98 } XF86ConfModuleRec
, *XF86ConfModulePtr
;
100 #define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
102 #define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
104 #define XF86CONF_PHSYNC 0x0001
105 #define XF86CONF_NHSYNC 0x0002
106 #define XF86CONF_PVSYNC 0x0004
107 #define XF86CONF_NVSYNC 0x0008
108 #define XF86CONF_INTERLACE 0x0010
109 #define XF86CONF_DBLSCAN 0x0020
110 #define XF86CONF_CSYNC 0x0040
111 #define XF86CONF_PCSYNC 0x0080
112 #define XF86CONF_NCSYNC 0x0100
113 #define XF86CONF_HSKEW 0x0200 /* hskew provided */
114 #define XF86CONF_BCAST 0x0400
115 #define XF86CONF_VSCAN 0x1000
133 } XF86ConfModeLineRec
, *XF86ConfModeLinePtr
;
138 XF86OptionPtr vp_option_lst
;
140 } XF86ConfVideoPortRec
, *XF86ConfVideoPortPtr
;
149 XF86OptionPtr va_option_lst
;
150 XF86ConfVideoPortPtr va_port_lst
;
153 } XF86ConfVideoAdaptorRec
, *XF86ConfVideoAdaptorPtr
;
155 #define CONF_MAX_HSYNC 8
156 #define CONF_MAX_VREFRESH 8
163 int red
, green
, blue
;
168 char *modes_identifier
;
169 XF86ConfModeLinePtr mon_modeline_lst
;
171 } XF86ConfModesRec
, *XF86ConfModesPtr
;
176 XF86ConfModesPtr ml_modes
;
177 } XF86ConfModesLinkRec
, *XF86ConfModesLinkPtr
;
181 char *mon_identifier
;
184 int mon_width
; /* in mm */
185 int mon_height
; /* in mm */
186 XF86ConfModeLinePtr mon_modeline_lst
;
188 parser_range mon_hsync
[CONF_MAX_HSYNC
];
190 parser_range mon_vrefresh
[CONF_MAX_VREFRESH
];
192 float mon_gamma_green
;
193 float mon_gamma_blue
;
194 XF86OptionPtr mon_option_lst
;
195 XF86ConfModesLinkPtr mon_modes_sect_lst
;
197 } XF86ConfMonitorRec
, *XF86ConfMonitorPtr
;
199 #define CONF_MAXDACSPEEDS 4
200 #define CONF_MAXCLOCKS 128
204 char *dev_identifier
;
212 int dev_dacSpeeds
[CONF_MAXDACSPEEDS
];
214 int dev_textclockfreq
;
215 unsigned long dev_bios_base
;
216 unsigned long dev_mem_base
;
217 unsigned long dev_io_base
;
220 int dev_clock
[CONF_MAXCLOCKS
];
225 XF86OptionPtr dev_option_lst
;
227 } XF86ConfDeviceRec
, *XF86ConfDevicePtr
;
232 } XF86ModeRec
, *XF86ModePtr
;
243 parser_rgb disp_weight
;
244 parser_rgb disp_black
;
245 parser_rgb disp_white
;
246 XF86ModePtr disp_mode_lst
;
247 XF86OptionPtr disp_option_lst
;
249 } XF86ConfDisplayRec
, *XF86ConfDisplayPtr
;
252 XF86OptionPtr flg_option_lst
;
254 } XF86ConfFlagsRec
, *XF86ConfFlagsPtr
;
258 char *al_adaptor_str
;
259 XF86ConfVideoAdaptorPtr al_adaptor
;
260 } XF86ConfAdaptorLinkRec
, *XF86ConfAdaptorLinkPtr
;
264 char *scrn_identifier
;
265 char *scrn_obso_driver
;
266 int scrn_defaultdepth
;
268 int scrn_defaultfbbpp
;
269 char *scrn_monitor_str
;
270 XF86ConfMonitorPtr scrn_monitor
;
271 char *scrn_device_str
;
272 XF86ConfDevicePtr scrn_device
;
273 XF86ConfAdaptorLinkPtr scrn_adaptor_lst
;
274 XF86ConfDisplayPtr scrn_display_lst
;
275 XF86OptionPtr scrn_option_lst
;
277 int scrn_virtualX
, scrn_virtualY
;
278 } XF86ConfScreenRec
, *XF86ConfScreenPtr
;
282 char *inp_identifier
;
284 XF86OptionPtr inp_option_lst
;
286 } XF86ConfInputRec
, *XF86ConfInputPtr
;
290 XF86ConfInputPtr iref_inputdev
;
291 char *iref_inputdev_str
;
292 XF86OptionPtr iref_option_lst
;
293 } XF86ConfInputrefRec
, *XF86ConfInputrefPtr
;
301 struct xorg_list entry
;
309 struct xorg_list match_product
;
310 struct xorg_list match_vendor
;
311 struct xorg_list match_device
;
312 struct xorg_list match_os
;
313 struct xorg_list match_pnpid
;
314 struct xorg_list match_usbid
;
315 struct xorg_list match_driver
;
316 struct xorg_list match_tag
;
317 struct xorg_list match_layout
;
318 xf86TriState is_keyboard
;
319 xf86TriState is_pointer
;
320 xf86TriState is_joystick
;
321 xf86TriState is_tablet
;
322 xf86TriState is_touchpad
;
323 xf86TriState is_touchscreen
;
324 XF86OptionPtr option_lst
;
326 } XF86ConfInputClassRec
, *XF86ConfInputClassPtr
;
328 /* Values for adj_where */
329 #define CONF_ADJ_OBSOLETE -1
330 #define CONF_ADJ_ABSOLUTE 0
331 #define CONF_ADJ_RIGHTOF 1
332 #define CONF_ADJ_LEFTOF 2
333 #define CONF_ADJ_ABOVE 3
334 #define CONF_ADJ_BELOW 4
335 #define CONF_ADJ_RELATIVE 5
340 XF86ConfScreenPtr adj_screen
;
341 char *adj_screen_str
;
342 XF86ConfScreenPtr adj_top
;
344 XF86ConfScreenPtr adj_bottom
;
345 char *adj_bottom_str
;
346 XF86ConfScreenPtr adj_left
;
348 XF86ConfScreenPtr adj_right
;
354 } XF86ConfAdjacencyRec
, *XF86ConfAdjacencyPtr
;
358 char *inactive_device_str
;
359 XF86ConfDevicePtr inactive_device
;
360 } XF86ConfInactiveRec
, *XF86ConfInactivePtr
;
364 char *lay_identifier
;
365 XF86ConfAdjacencyPtr lay_adjacency_lst
;
366 XF86ConfInactivePtr lay_inactive_lst
;
367 XF86ConfInputrefPtr lay_input_lst
;
368 XF86OptionPtr lay_option_lst
;
370 } XF86ConfLayoutRec
, *XF86ConfLayoutPtr
;
376 XF86OptionPtr vs_option_lst
;
378 } XF86ConfVendSubRec
, *XF86ConfVendSubPtr
;
382 char *vnd_identifier
;
383 XF86OptionPtr vnd_option_lst
;
384 XF86ConfVendSubPtr vnd_sub_lst
;
386 } XF86ConfVendorRec
, *XF86ConfVendorPtr
;
389 char *dri_group_name
;
393 } XF86ConfDRIRec
, *XF86ConfDRIPtr
;
396 XF86OptionPtr ext_option_lst
;
397 char *extensions_comment
;
398 } XF86ConfExtensionsRec
, *XF86ConfExtensionsPtr
;
401 XF86ConfFilesPtr conf_files
;
402 XF86ConfModulePtr conf_modules
;
403 XF86ConfFlagsPtr conf_flags
;
404 XF86ConfVideoAdaptorPtr conf_videoadaptor_lst
;
405 XF86ConfModesPtr conf_modes_lst
;
406 XF86ConfMonitorPtr conf_monitor_lst
;
407 XF86ConfDevicePtr conf_device_lst
;
408 XF86ConfScreenPtr conf_screen_lst
;
409 XF86ConfInputPtr conf_input_lst
;
410 XF86ConfInputClassPtr conf_inputclass_lst
;
411 XF86ConfLayoutPtr conf_layout_lst
;
412 XF86ConfVendorPtr conf_vendor_lst
;
413 XF86ConfDRIPtr conf_dri
;
414 XF86ConfExtensionsPtr conf_extensions
;
416 } XF86ConfigRec
, *XF86ConfigPtr
;
419 int token
; /* id of the token */
420 const char *name
; /* pointer to the LOWERCASED name */
421 } xf86ConfigSymTabRec
, *xf86ConfigSymTabPtr
;
424 * prototypes for public functions
426 extern void xf86initConfigFiles(void);
427 extern char *xf86openConfigFile(const char *path
, const char *cmdline
,
428 const char *projroot
);
429 extern char *xf86openConfigDirFiles(const char *path
, const char *cmdline
,
430 const char *projroot
);
431 extern void xf86setBuiltinConfig(const char *config
[]);
432 extern XF86ConfigPtr
xf86readConfigFile(void);
433 extern void xf86closeConfigFile(void);
434 extern void xf86freeConfig(XF86ConfigPtr p
);
435 extern int xf86writeConfigFile(const char *, XF86ConfigPtr
);
436 extern _X_EXPORT XF86ConfDevicePtr
xf86findDevice(const char *ident
,
437 XF86ConfDevicePtr p
);
438 extern _X_EXPORT XF86ConfLayoutPtr
xf86findLayout(const char *name
,
439 XF86ConfLayoutPtr list
);
440 extern _X_EXPORT XF86ConfMonitorPtr
xf86findMonitor(const char *ident
,
441 XF86ConfMonitorPtr p
);
442 extern _X_EXPORT XF86ConfModesPtr
xf86findModes(const char *ident
,
444 extern _X_EXPORT XF86ConfModeLinePtr
xf86findModeLine(const char *ident
,
445 XF86ConfModeLinePtr p
);
446 extern _X_EXPORT XF86ConfScreenPtr
xf86findScreen(const char *ident
,
447 XF86ConfScreenPtr p
);
448 extern _X_EXPORT XF86ConfInputPtr
xf86findInput(const char *ident
,
450 extern _X_EXPORT XF86ConfInputPtr
xf86findInputByDriver(const char *driver
,
452 extern _X_EXPORT XF86ConfVideoAdaptorPtr
xf86findVideoAdaptor(const char *ident
,
453 XF86ConfVideoAdaptorPtr
455 extern int xf86layoutAddInputDevices(XF86ConfigPtr config
,
456 XF86ConfLayoutPtr layout
);
458 extern _X_EXPORT GenericListPtr
xf86addListItem(GenericListPtr head
,
459 GenericListPtr c_new
);
460 extern _X_EXPORT
int xf86itemNotSublist(GenericListPtr list_1
,
461 GenericListPtr list_2
);
463 extern _X_EXPORT
int xf86pathIsAbsolute(const char *path
);
464 extern _X_EXPORT
int xf86pathIsSafe(const char *path
);
465 extern _X_EXPORT
char *xf86addComment(char *cur
, char *add
);
466 extern _X_EXPORT Bool
xf86getBoolValue(Bool
*val
, const char *str
);
468 #endif /* _xf86Parser_h_ */