1XrmInitialize(3X11) XLIB FUNCTIONS XrmInitialize(3X11)
2
3
4
6 XrmInitialize, XrmParseCommand, XrmValue, XrmOptionKind, XrmOptionDe‐
7 scRec - initialize the Resource Manager, Resource Manager structures,
8 and parse the command line
9
11 void XrmInitialize(void);
12
13 void XrmParseCommand(XrmDatabase *database, XrmOptionDescList table,
14 int table_count, char *name, int *argc_in_out, char
15 **argv_in_out);
16
18 argc_in_out
19 Specifies the number of arguments and returns the number of
20 remaining arguments.
21
22 argv_in_out
23 Specifies the command line arguments and returns the remain‐
24 ing arguments.
25
26 database Specifies the resource database.
27
28 name Specifies the application name.
29
30 table Specifies the table of command line arguments to be parsed.
31
32 table_count
33 Specifies the number of entries in the table.
34
36 The XrmInitialize function initialize the resource manager. It must be
37 called before any other Xrm functions are used.
38
39 The XrmParseCommand function parses an (argc, argv) pair according to
40 the specified option table, loads recognized options into the specified
41 database with type ``String,'' and modifies the (argc, argv) pair to
42 remove all recognized options. If database contains NULL, XrmParseCom‐
43 mand creates a new database and returns a pointer to it. Otherwise,
44 entries are added to the database specified. If a database is created,
45 it is created in the current locale.
46
47 The specified table is used to parse the command line. Recognized
48 options in the table are removed from argv, and entries are added to
49 the specified resource database in the order they occur in argv. The
50 table entries contain information on the option string, the option
51 name, the style of option, and a value to provide if the option kind is
52 XrmoptionNoArg. The option names are compared byte-for-byte to argu‐
53 ments in argv, independent of any locale. The resource values given in
54 the table are stored in the resource database without modification.
55 All resource database entries are created using a ``String'' represen‐
56 tation type. The argc argument specifies the number of arguments in
57 argv and is set on return to the remaining number of arguments that
58 were not parsed. The name argument should be the name of your applica‐
59 tion for use in building the database entry. The name argument is pre‐
60 fixed to the resourceName in the option table before storing a database
61 entry. The name argument is treated as a single component, even if it
62 has embedded periods. No separating (binding) character is inserted,
63 so the table must contain either a period (.) or an asterisk (*) as the
64 first character in each resourceName entry. To specify a more com‐
65 pletely qualified resource name, the resourceName entry can contain
66 multiple components. If the name argument and the resourceNames are
67 not in the Host Portable Character Encoding, the result is implementa‐
68 tion-dependent.
69
71 The XrmValue, XrmOptionKind, and XrmOptionDescRec structures contain:
72
73 typedef struct {
74 unsigned int size;
75 XPointer addr;
76 } XrmValue, *XrmValuePtr;
77
78 typedef enum {
79 XrmoptionNoArg, /∗ Value is specified in XrmOptionDescRec.value */
80 XrmoptionIsArg, /∗ Value is the option string itself */
81 XrmoptionStickyArg, /∗ Value is characters immediately following option */
82 XrmoptionSepArg, /∗ Value is next argument in argv */
83 XrmoptionResArg, /∗ Resource and value in next argument in argv */
84 XrmoptionSkipArg, /∗ Ignore this option and the next argument in argv */
85 XrmoptionSkipLine, /∗ Ignore this option and the rest of argv */
86 XrmoptionSkipNArgs /∗ Ignore this option and the next
87 XrmOptionDescRec.value arguments in argv */
88 } XrmOptionKind;
89
90 typedef struct {
91 char *option; /∗ Option specification string in argv */
92 char *specifier; /∗ Binding and resource name (sans application name) */
93 XrmOptionKind argKind;/∗ Which style of option it is */
94 XPointer value; /∗ Value to provide if XrmoptionNoArg or
95 XrmoptionSkipNArgs */
96 } XrmOptionDescRec, *XrmOptionDescList;
97
99 XrmGetResource(3X11), XrmMergeDatabases(3X11), XrmPutResource(3X11),
100 XrmUniqueQuark(3X11)
101 Xlib - C Language X Interface
102
103
104
105X Version 11 libX11 1.0.3 XrmInitialize(3X11)