15.4 Creating and Storing Databases

A resource database is an opaque type, XrmDatabase. Each database value is stored in an XrmValue structure. This structure consists of a size, an address, and a representation type. The size is specified in bytes. The representation type is a way for you to store data tagged by some application-defined type (for example, the strings ``font'' or ``color''). It has nothing to do with the C data type or with its class. The XrmValue structure is defined as:


typedef struct {
	unsigned int size;
	XPointer addr;
} XrmValue, *XrmValuePtr;

To initialize the resource manager, use XrmInitialize().

To retrieve a database from disk, use XrmGetFileDatabase().

To store a copy of a database to disk, use XrmPutFileDatabase().

To obtain a pointer to the screen independent resources of a display, use XResourceManagerString().

To obtain a pointer to the screen-specific resources of a screen, use XScreenResourceString().

To create a database from a string, use XrmGetStringDatabase().

To obtain locale name of a database, use XrmLocaleOfDatabase().

To destroy a resource database and free its allocated memory, use XrmDestroyDatabase().

To associate a resource database with a display, use XrmSetDatabase().

To get the resource database associated with a display, use XrmGetDatabase().

Next: Merging Resource Databases

Christophe Tronche, [email protected]