VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.1.0/xf86Opt.h@ 78293

Last change on this file since 78293 was 51223, checked in by vboxsync, 11 years ago

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1/* $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86Opt.h,v 1.15 2003/10/08 14:30:38 dawes Exp $ */
2
3/*
4 * Copyright (c) 1998-2003 by The XFree86 Project, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * Except as contained in this notice, the name of the copyright holder(s)
25 * and author(s) shall not be used in advertising or otherwise to promote
26 * the sale, use or other dealings in this Software without prior written
27 * authorization from the copyright holder(s) and author(s).
28 */
29
30/* Option handling things that ModuleSetup procs can use */
31
32#ifndef _XF86_OPT_H_
33#define _XF86_OPT_H_
34
35typedef struct {
36 double freq;
37 int units;
38} OptFrequency;
39
40typedef union {
41 unsigned long num;
42 char * str;
43 double realnum;
44 Bool bool;
45 OptFrequency freq;
46} ValueUnion;
47
48typedef enum {
49 OPTV_NONE = 0,
50 OPTV_INTEGER,
51 OPTV_STRING, /* a non-empty string */
52 OPTV_ANYSTR, /* Any string, including an empty one */
53 OPTV_REAL,
54 OPTV_BOOLEAN,
55 OPTV_FREQ
56} OptionValueType;
57
58typedef enum {
59 OPTUNITS_HZ = 1,
60 OPTUNITS_KHZ,
61 OPTUNITS_MHZ
62} OptFreqUnits;
63
64typedef struct {
65 int token;
66 const char* name;
67 OptionValueType type;
68 ValueUnion value;
69 Bool found;
70} OptionInfoRec, *OptionInfoPtr;
71
72int xf86SetIntOption(pointer optlist, const char *name, int deflt);
73double xf86SetRealOption(pointer optlist, const char *name, double deflt);
74char *xf86SetStrOption(pointer optlist, const char *name, char *deflt);
75int xf86SetBoolOption(pointer list, const char *name, int deflt );
76int xf86CheckIntOption(pointer optlist, const char *name, int deflt);
77double xf86CheckRealOption(pointer optlist, const char *name, double deflt);
78char *xf86CheckStrOption(pointer optlist, const char *name, char *deflt);
79int xf86CheckBoolOption(pointer list, const char *name, int deflt );
80pointer xf86AddNewOption(pointer head, const char *name, const char *val );
81pointer xf86NewOption(char *name, char *value );
82pointer xf86NextOption(pointer list );
83pointer xf86OptionListCreate(const char **options, int count, int used);
84pointer xf86OptionListMerge(pointer head, pointer tail);
85void xf86OptionListFree(pointer opt);
86char *xf86OptionName(pointer opt);
87char *xf86OptionValue(pointer opt);
88void xf86OptionListReport(pointer parm);
89pointer xf86FindOption(pointer options, const char *name);
90char *xf86FindOptionValue(pointer options, const char *name);
91void xf86MarkOptionUsed(pointer option);
92void xf86MarkOptionUsedByName(pointer options, const char *name);
93Bool xf86CheckIfOptionUsed(pointer option);
94Bool xf86CheckIfOptionUsedByName(pointer options, const char *name);
95void xf86ShowUnusedOptions(int scrnIndex, pointer options);
96void xf86ProcessOptions(int scrnIndex, pointer options, OptionInfoPtr optinfo);
97OptionInfoPtr xf86TokenToOptinfo(const OptionInfoRec *table, int token);
98const char *xf86TokenToOptName(const OptionInfoRec *table, int token);
99Bool xf86IsOptionSet(const OptionInfoRec *table, int token);
100char *xf86GetOptValString(const OptionInfoRec *table, int token);
101Bool xf86GetOptValInteger(const OptionInfoRec *table, int token, int *value);
102Bool xf86GetOptValULong(const OptionInfoRec *table, int token, unsigned long *value);
103Bool xf86GetOptValReal(const OptionInfoRec *table, int token, double *value);
104Bool xf86GetOptValFreq(const OptionInfoRec *table, int token,
105 OptFreqUnits expectedUnits, double *value);
106Bool xf86GetOptValBool(const OptionInfoRec *table, int token, Bool *value);
107Bool xf86ReturnOptValBool(const OptionInfoRec *table, int token, Bool def);
108int xf86NameCmp(const char *s1, const char *s2);
109char *xf86NormalizeName(const char *s);
110pointer xf86ReplaceIntOption(pointer optlist, const char *name, const int val);
111pointer xf86ReplaceRealOption(pointer optlist, const char *name, const double val);
112pointer xf86ReplaceBoolOption(pointer optlist, const char *name, const Bool val);
113pointer xf86ReplaceStrOption(pointer optlist, const char *name, const char* val);
114#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette