X Resources - Client Libraries

Client Libraries

Xlib contains a number of convenience functions for accessing the resources on the server and manipulating them locally. These functions are used both by xrdb and by every other program that needs these resources. Most of these functions manipulate a resource database, which is a local data structure representing a set of resource specifications. The Xlib functions for resource management are:

  • functions for reading the resources on the server into a local string (XResourceManagerString and XScreenResourceString)
  • functions for creating, manipulating, and destroying a local resource database (XrmInitialize, XrmDestroyDatabase, XrmGetFileDatabase, XrmPutFileDatabase, XrmGetStringDatabase, XrmLocaleOfDatabase, XrmSetDatabase, XrmGetDatabase, XrmCombineFileDatabase, XrmCombineDatabase, XrmMergeDatabases, XrmParseCommand)
  • functions for looking up resources and storing new ones (XrmGetResource, XrmQGetResource, XrmQGetSearchList, XrmQGetSearchResource, XrmPutResource, XrmQPutResource, XrmPutStringResource, XrmQPutStringResource, XrmPutLineResource, XrmEnumerateDatabase)

In particular, the function XrmParseCommand allow parsing the command line arguments, reading resources that are then added to a local resource database. This way, the resources can be read from the server and used as defaults that are overridden by command line arguments.

For the sake of efficiency, integers called quarks are defined to represent local strings. Quarks are similar to atoms, but they represent strings stored locally rather than on the server. A number of Xlib functions create an association between strings and quarks. Quarks can be used in place of component names when using one of the above functions; resource names therefore correspond to quark lists.

Read more about this topic:  X Resources

Famous quotes containing the words client and/or libraries:

    A client is to me a mere unit, a factor in a problem.
    Sir Arthur Conan Doyle (1859–1930)

    riding flatcars to Fresno,
    Across the whole country
    Steep towns, flat towns, even New York,
    And oceans and Europe & libraries & galleries
    And the factories they make rubbers in
    Gary Snyder (b. 1930)