|
||||
File indexing completed on 2025-01-18 10:14:35
0001 0002 /*********************************************************** 0003 0004 Copyright 1987, 1988, 1998 The Open Group 0005 0006 Permission to use, copy, modify, distribute, and sell this software and its 0007 documentation for any purpose is hereby granted without fee, provided that 0008 the above copyright notice appear in all copies and that both that 0009 copyright notice and this permission notice appear in supporting 0010 documentation. 0011 0012 The above copyright notice and this permission notice shall be included in 0013 all copies or substantial portions of the Software. 0014 0015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0018 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 0019 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 0020 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 0021 0022 Except as contained in this notice, the name of The Open Group shall not be 0023 used in advertising or otherwise to promote the sale, use or other dealings 0024 in this Software without prior written authorization from The Open Group. 0025 0026 0027 Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. 0028 0029 All Rights Reserved 0030 0031 Permission to use, copy, modify, and distribute this software and its 0032 documentation for any purpose and without fee is hereby granted, 0033 provided that the above copyright notice appear in all copies and that 0034 both that copyright notice and this permission notice appear in 0035 supporting documentation, and that the name of Digital not be 0036 used in advertising or publicity pertaining to distribution of the 0037 software without specific, written prior permission. 0038 0039 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 0040 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 0041 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 0042 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 0043 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 0044 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 0045 SOFTWARE. 0046 0047 ******************************************************************/ 0048 0049 #ifndef _X11_XRESOURCE_H_ 0050 #define _X11_XRESOURCE_H_ 0051 0052 #ifndef _XP_PRINT_SERVER_ 0053 #include <X11/Xlib.h> 0054 #endif 0055 0056 /**************************************************************** 0057 **************************************************************** 0058 *** *** 0059 *** *** 0060 *** X Resource Manager Intrinsics *** 0061 *** *** 0062 *** *** 0063 **************************************************************** 0064 ****************************************************************/ 0065 0066 _XFUNCPROTOBEGIN 0067 0068 /**************************************************************** 0069 * 0070 * Memory Management 0071 * 0072 ****************************************************************/ 0073 0074 extern char *Xpermalloc( 0075 unsigned int /* size */ 0076 ); 0077 0078 /**************************************************************** 0079 * 0080 * Quark Management 0081 * 0082 ****************************************************************/ 0083 0084 typedef int XrmQuark, *XrmQuarkList; 0085 #define NULLQUARK ((XrmQuark) 0) 0086 0087 typedef char *XrmString; 0088 #define NULLSTRING ((XrmString) 0) 0089 0090 /* find quark for string, create new quark if none already exists */ 0091 extern XrmQuark XrmStringToQuark( 0092 _Xconst char* /* string */ 0093 ); 0094 0095 extern XrmQuark XrmPermStringToQuark( 0096 _Xconst char* /* string */ 0097 ); 0098 0099 /* find string for quark */ 0100 extern XrmString XrmQuarkToString( 0101 XrmQuark /* quark */ 0102 ); 0103 0104 extern XrmQuark XrmUniqueQuark( 0105 void 0106 ); 0107 0108 #define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0) 0109 0110 0111 /**************************************************************** 0112 * 0113 * Conversion of Strings to Lists 0114 * 0115 ****************************************************************/ 0116 0117 typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList; 0118 0119 extern void XrmStringToQuarkList( 0120 _Xconst char* /* string */, 0121 XrmQuarkList /* quarks_return */ 0122 ); 0123 0124 extern void XrmStringToBindingQuarkList( 0125 _Xconst char* /* string */, 0126 XrmBindingList /* bindings_return */, 0127 XrmQuarkList /* quarks_return */ 0128 ); 0129 0130 /**************************************************************** 0131 * 0132 * Name and Class lists. 0133 * 0134 ****************************************************************/ 0135 0136 typedef XrmQuark XrmName; 0137 typedef XrmQuarkList XrmNameList; 0138 #define XrmNameToString(name) XrmQuarkToString(name) 0139 #define XrmStringToName(string) XrmStringToQuark(string) 0140 #define XrmStringToNameList(str, name) XrmStringToQuarkList(str, name) 0141 0142 typedef XrmQuark XrmClass; 0143 typedef XrmQuarkList XrmClassList; 0144 #define XrmClassToString(c_class) XrmQuarkToString(c_class) 0145 #define XrmStringToClass(c_class) XrmStringToQuark(c_class) 0146 #define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class) 0147 0148 0149 0150 /**************************************************************** 0151 * 0152 * Resource Representation Types and Values 0153 * 0154 ****************************************************************/ 0155 0156 typedef XrmQuark XrmRepresentation; 0157 #define XrmStringToRepresentation(string) XrmStringToQuark(string) 0158 #define XrmRepresentationToString(type) XrmQuarkToString(type) 0159 0160 typedef struct { 0161 unsigned int size; 0162 XPointer addr; 0163 } XrmValue, *XrmValuePtr; 0164 0165 0166 /**************************************************************** 0167 * 0168 * Resource Manager Functions 0169 * 0170 ****************************************************************/ 0171 0172 typedef struct _XrmHashBucketRec *XrmHashBucket; 0173 typedef XrmHashBucket *XrmHashTable; 0174 typedef XrmHashTable XrmSearchList[]; 0175 typedef struct _XrmHashBucketRec *XrmDatabase; 0176 0177 0178 extern void XrmDestroyDatabase( 0179 XrmDatabase /* database */ 0180 ); 0181 0182 extern void XrmQPutResource( 0183 XrmDatabase* /* database */, 0184 XrmBindingList /* bindings */, 0185 XrmQuarkList /* quarks */, 0186 XrmRepresentation /* type */, 0187 XrmValue* /* value */ 0188 ); 0189 0190 extern void XrmPutResource( 0191 XrmDatabase* /* database */, 0192 _Xconst char* /* specifier */, 0193 _Xconst char* /* type */, 0194 XrmValue* /* value */ 0195 ); 0196 0197 extern void XrmQPutStringResource( 0198 XrmDatabase* /* database */, 0199 XrmBindingList /* bindings */, 0200 XrmQuarkList /* quarks */, 0201 _Xconst char* /* value */ 0202 ); 0203 0204 extern void XrmPutStringResource( 0205 XrmDatabase* /* database */, 0206 _Xconst char* /* specifier */, 0207 _Xconst char* /* value */ 0208 ); 0209 0210 extern void XrmPutLineResource( 0211 XrmDatabase* /* database */, 0212 _Xconst char* /* line */ 0213 ); 0214 0215 extern Bool XrmQGetResource( 0216 XrmDatabase /* database */, 0217 XrmNameList /* quark_name */, 0218 XrmClassList /* quark_class */, 0219 XrmRepresentation* /* quark_type_return */, 0220 XrmValue* /* value_return */ 0221 ); 0222 0223 extern Bool XrmGetResource( 0224 XrmDatabase /* database */, 0225 _Xconst char* /* str_name */, 0226 _Xconst char* /* str_class */, 0227 char** /* str_type_return */, 0228 XrmValue* /* value_return */ 0229 ); 0230 0231 extern Bool XrmQGetSearchList( 0232 XrmDatabase /* database */, 0233 XrmNameList /* names */, 0234 XrmClassList /* classes */, 0235 XrmSearchList /* list_return */, 0236 int /* list_length */ 0237 ); 0238 0239 extern Bool XrmQGetSearchResource( 0240 XrmSearchList /* list */, 0241 XrmName /* name */, 0242 XrmClass /* class */, 0243 XrmRepresentation* /* type_return */, 0244 XrmValue* /* value_return */ 0245 ); 0246 0247 /**************************************************************** 0248 * 0249 * Resource Database Management 0250 * 0251 ****************************************************************/ 0252 0253 #ifndef _XP_PRINT_SERVER_ 0254 0255 extern void XrmSetDatabase( 0256 Display* /* display */, 0257 XrmDatabase /* database */ 0258 ); 0259 0260 extern XrmDatabase XrmGetDatabase( 0261 Display* /* display */ 0262 ); 0263 0264 #endif /* !_XP_PRINT_SERVER_ */ 0265 0266 extern XrmDatabase XrmGetFileDatabase( 0267 _Xconst char* /* filename */ 0268 ); 0269 0270 extern Status XrmCombineFileDatabase( 0271 _Xconst char* /* filename */, 0272 XrmDatabase* /* target */, 0273 Bool /* override */ 0274 ); 0275 0276 extern XrmDatabase XrmGetStringDatabase( 0277 _Xconst char* /* data */ /* null terminated string */ 0278 ); 0279 0280 extern void XrmPutFileDatabase( 0281 XrmDatabase /* database */, 0282 _Xconst char* /* filename */ 0283 ); 0284 0285 extern void XrmMergeDatabases( 0286 XrmDatabase /* source_db */, 0287 XrmDatabase* /* target_db */ 0288 ); 0289 0290 extern void XrmCombineDatabase( 0291 XrmDatabase /* source_db */, 0292 XrmDatabase* /* target_db */, 0293 Bool /* override */ 0294 ); 0295 0296 #define XrmEnumAllLevels 0 0297 #define XrmEnumOneLevel 1 0298 0299 extern Bool XrmEnumerateDatabase( 0300 XrmDatabase /* db */, 0301 XrmNameList /* name_prefix */, 0302 XrmClassList /* class_prefix */, 0303 int /* mode */, 0304 Bool (*)( 0305 XrmDatabase* /* db */, 0306 XrmBindingList /* bindings */, 0307 XrmQuarkList /* quarks */, 0308 XrmRepresentation* /* type */, 0309 XrmValue* /* value */, 0310 XPointer /* closure */ 0311 ) /* proc */, 0312 XPointer /* closure */ 0313 ); 0314 0315 extern const char *XrmLocaleOfDatabase( 0316 XrmDatabase /* database */ 0317 ); 0318 0319 0320 /**************************************************************** 0321 * 0322 * Command line option mapping to resource entries 0323 * 0324 ****************************************************************/ 0325 0326 typedef enum { 0327 XrmoptionNoArg, /* Value is specified in OptionDescRec.value */ 0328 XrmoptionIsArg, /* Value is the option string itself */ 0329 XrmoptionStickyArg, /* Value is characters immediately following option */ 0330 XrmoptionSepArg, /* Value is next argument in argv */ 0331 XrmoptionResArg, /* Resource and value in next argument in argv */ 0332 XrmoptionSkipArg, /* Ignore this option and the next argument in argv */ 0333 XrmoptionSkipLine, /* Ignore this option and the rest of argv */ 0334 XrmoptionSkipNArgs /* Ignore this option and the next 0335 OptionDescRes.value arguments in argv */ 0336 } XrmOptionKind; 0337 0338 typedef struct { 0339 char *option; /* Option abbreviation in argv */ 0340 char *specifier; /* Resource specifier */ 0341 XrmOptionKind argKind; /* Which style of option it is */ 0342 XPointer value; /* Value to provide if XrmoptionNoArg */ 0343 } XrmOptionDescRec, *XrmOptionDescList; 0344 0345 0346 extern void XrmParseCommand( 0347 XrmDatabase* /* database */, 0348 XrmOptionDescList /* table */, 0349 int /* table_count */, 0350 _Xconst char* /* name */, 0351 int* /* argc_in_out */, 0352 char** /* argv_in_out */ 0353 ); 0354 0355 _XFUNCPROTOEND 0356 0357 #endif /* _X11_XRESOURCE_H_ */ 0358 /* DON'T ADD STUFF AFTER THIS #endif */
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |