XGetDefault

Syntax

char *XGetDefault(display, program, option)
      Display *display;
      char *program;
      char *option;

Arguments

display

Specifies the connection to the X server.

program

Specifies the program name for the Xlib defaults (usually argv[0] of the main program).

option

Specifies the option name.

Description

The XGetDefault() function returns the value of the resource prog.option, where prog is the program argument with the directory prefix removed and option must be a single component. Note that multilevel resources cannot be used with XGetDefault(). The class "Program.Name" is always used for the resource lookup. If the specified option name does not exist for this program, XGetDefault() returns NULL. The strings returned by XGetDefault() are owned by Xlib and should not be modified or freed by the client.

If a database has been set with XrmSetDatabase(), that database is used for the lookup. Otherwise, a database is created and is set in the display (as if by calling XrmSetDatabase()). The database is created in the current locale. To create a database, XGetDefault() uses resources from the RESOURCE_MANAGER property on the root window of screen zero. If no such property exists, a resource file in the user's home directory is used. On a POSIX-conformant system, this file is "$HOME/.Xdefaults". After loading these defaults, XGetDefault() merges additional defaults specified by the XENVIRONMENT environment variable. If XENVIRONMENT is defined, it contains a full path name for the additional resource file. If XENVIRONMENT is not defined, XGetDefault() looks for "$HOME/.Xdefaults-name", where name specifies the name of the machine on which the application is running.

See also

"Compatibility Functions".
Christophe Tronche, ch@tronche.com