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, _Xconst  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  re‐
44       move  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  op‐
50       tions  in the table are removed from argv, and entries are added to the
51       specified resource database in the order they occur in argv.  The table
52       entries  contain information on the option string, the option name, the
53       style of option, and a value to provide if the option  kind  is  Xrmop‐
54       tionNoArg.  The option names are compared byte-for-byte to arguments in
55       argv, independent of any locale.  The resource values given in the  ta‐
56       ble  are stored in the resource database without modification.  All re‐
57       source database entries are created  using  a  “String”  representation
58       type.   The argc argument specifies the number of arguments in argv and
59       is set on return to the remaining number of  arguments  that  were  not
60       parsed.   The  name argument should be the name of your application for
61       use in building the database entry.  The name argument is  prefixed  to
62       the  resourceName  in the option table before storing a database entry.
63       The name argument is treated as a single component, even if it has  em‐
64       bedded  periods.  No separating (binding) character is inserted, so the
65       table must contain either a period (.) or an asterisk (*) as the  first
66       character  in  each  resourceName  entry.  To specify a more completely
67       qualified resource name, the resourceName entry  can  contain  multiple
68       components.   If the name argument and the resourceNames are not in the
69       Host Portable Character Encoding, the result  is  implementation-depen‐
70       dent.
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.7.3.1                XrmInitialize(3)
Impressum