13.5 Other Resource Manager Routines

The resource manager includes a number of other routines that will be of limited use to most application developers. They are discussed briefly here for the sake of completeness.

13.5.1 Putting Resources into the Database

While all most applications will need to do is to merge various sources of user preferences into a database and then read individual values, routines also exist for putting explicit resource values into the database or writing out the database into a file. For example, the xrdb program allows a user to write out the current contents of the resource manager database into a file. An application could allow users to modify the application resource specifications file and would then need those routines.

Routines for putting resources include:

XrmPutResource()

Stores preference data into a resource database.

XrmPutLineResource()

Stores a single line of preference data into a resource database.

XrmPutStringResource()

Stores a preference string into a resource database.

XrmPutFileDatabase()

Writes a resource database into a file.

The resource manager only frees or overwrites entries when new data is stored into a database with XrmMergeDatabases() or XrmPutResource() and related routines. A client that does not use these functions should be safe using the addresses to strings returned by routines like XrmGetResource().

13.5.2 Combining the Contents of Databases

The pre-R5 function XrmMergeDatabases() combines the contents of a “source” database and ...

Get XLIB Programming Manual, Rel. 5, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.