1XrmInitialize(3)                XLIB FUNCTIONS                XrmInitialize(3)
2
3
4

NAME

6       XrmInitialize, XrmParseCommand, XrmValue, XrmOptionKind, XrmOptionDe‐
7       scRec - initialize the Resource Manager, Resource Manager structures,
8       and parse the command line
9

SYNTAX

11       #include <X11/Xresource.h>
12
13       void XrmInitialize(void);
14
15       void XrmParseCommand(XrmDatabase *database, XrmOptionDescList table,
16              int table_count, char *name, int *argc_in_out, char
17              **argv_in_out);
18

ARGUMENTS

20       argc_in_out
21                 Specifies the number of arguments and returns the number of
22                 remaining arguments.
23
24       argv_in_out
25                 Specifies the command line arguments and returns the remain‐
26                 ing arguments.
27
28       database  Specifies the resource database.
29
30       name      Specifies the application name.
31
32       table     Specifies the table of command line arguments to be parsed.
33
34       table_count
35                 Specifies the number of entries in the table.
36

DESCRIPTION

38       The XrmInitialize function initialize the resource manager.  It must be
39       called before any other Xrm functions are used.
40
41       The XrmParseCommand function parses an (argc, argv) pair according to
42       the specified option table, loads recognized options into the specified
43       database with type ``String,'' and modifies the (argc, argv) pair to
44       remove all recognized options.  If database contains NULL, XrmParseCom‐
45       mand creates a new database and returns a pointer to it.  Otherwise,
46       entries are added to the database specified.  If a database is created,
47       it is created in the current locale.
48
49       The specified table is used to parse the command line.  Recognized
50       options in the table are removed from argv, and entries are added to
51       the specified resource database in the order they occur in argv.  The
52       table entries contain information on the option string, the option
53       name, the style of option, and a value to provide if the option kind is
54       XrmoptionNoArg.  The option names are compared byte-for-byte to argu‐
55       ments in argv, independent of any locale.  The resource values given in
56       the table are stored in the resource database without modification.
57       All resource database entries are created using a ``String'' represen‐
58       tation type.  The argc argument specifies the number of arguments in
59       argv and is set on return to the remaining number of arguments that
60       were not parsed.  The name argument should be the name of your applica‐
61       tion for use in building the database entry.  The name argument is pre‐
62       fixed to the resourceName in the option table before storing a database
63       entry.  The name argument is treated as a single component, even if it
64       has embedded periods.  No separating (binding) character is inserted,
65       so the table must contain either a period (.) or an asterisk (*) as the
66       first character in each resourceName entry.  To specify a more com‐
67       pletely qualified resource name, the resourceName entry can contain
68       multiple components.  If the name argument and the resourceNames are
69       not in the Host Portable Character Encoding, the result is implementa‐
70       tion-dependent.
71

STRUCTURES

73       The XrmValue, XrmOptionKind, and XrmOptionDescRec structures contain:
74
75       typedef struct {
76               unsigned int size;
77               XPointer addr;
78       } XrmValue, *XrmValuePtr;
79
80       typedef enum {
81               XrmoptionNoArg, /* Value is specified in XrmOptionDescRec.value */
82               XrmoptionIsArg, /* Value is the option string itself */
83               XrmoptionStickyArg,     /* Value is characters immediately following option */
84               XrmoptionSepArg,        /* Value is next argument in argv */
85               XrmoptionResArg,        /* Resource and value in next argument in argv */
86               XrmoptionSkipArg,       /* Ignore this option and the next argument in argv */
87               XrmoptionSkipLine,      /* Ignore this option and the rest of argv */
88               XrmoptionSkipNArgs      /* Ignore this option and the next
89                          XrmOptionDescRec.value arguments in argv */
90       } XrmOptionKind;
91
92       typedef struct {
93               char *option;   /* Option specification string in argv                    */
94               char *specifier;        /* Binding and resource name (sans application name)    */
95               XrmOptionKind argKind;  /* Which style of option it is            */
96               XPointer value; /* Value to provide if XrmoptionNoArg or
97                          XrmoptionSkipNArgs   */
98       } XrmOptionDescRec, *XrmOptionDescList;
99

SEE ALSO

101       XrmGetResource(3), XrmMergeDatabases(3), XrmPutResource(3), XrmUnique‐
102       Quark(3)
103       Xlib - C Language X Interface
104
105
106
107X Version 11                     libX11 1.6.5                 XrmInitialize(3)
Impressum