XrmQPutResource()XrmQPutResource()NameXrmQPutResource – store a resource specification into a database using
quarks.
Synopsis
void XrmQPutResource(database, bindings, quarks, type, value)
XrmDatabase *database;
XrmBindingList bindings;
XrmQuarkList quarks;
XrmRepresentation type;
XrmValue *value;
Arguments
database
Specifies a pointer to the resource database. If database
contains NULL, a new resource database is created and a
pointer to it is returned in database. If a database is cre‐
ated, it is created in the current locale.
bindings
Specifies a list of bindings for binding together the quarks
argument.
quarks Specifies the complete or partial name or class list of the
resource to be stored.
type Specifies the type of the resource.
value Specifies the value of the resource.
DescriptionXrmQPutResource() stores a resource specification into the database.
If a resource entry with the identical bindings and quarks already
exists in the database, the previous value is replaced by the new spec‐
ified value. The value is stored in the database without modification.
database can be a previously defined database, as returned by XrmGet‐
StringDatabase(), XrmGetFileDatabase(), or from XrmMergeDatabases().
If database is NULL, a new database is created and a pointer to it
returned in database.
bindings and quarks together specify where the value should be stored
in the database. See XrmStringToBindingQuarkList() for a brief
description of binding and quark lists. See XrmGetResource() for a
description of the resource manager naming conventions and lookup
rules.
type is the representation type of value. This provides a way to dis‐
tinguish between different representations of the same information.
Representation types are user-defined character strings describing the
way the data is represented. For example, a color may be specified by
a color name ("red"), or be coded in a hexadecimal string ("#4f6c84")
(if it is to be used as an argument to XParseColor().) The representa‐
tion type would distinguish between these two. Representation types
are created from simple character strings by using the macro XrmString‐
ToRepresentation. The type XrmRepresentation is actually the same type
as XrmQuark, since it is an ID for a string. The representation is
stored along with the value in the database, and is returned when the
database is accessed.
value specifies the value of the resource, specified as an XrmValue.
XrmGetResource() contains the complete description of how data is
accessed from the database, and so provides a good perspective on how
it is stored.
For more information, see Volume One, Chapter 13, Managing User Prefer‐
ences.
Structures
XrmDatabase is a pointer to an opaque data type.
typedef enum {
XrmBindTightly, XrmBindLoosely
} XrmBinding, *XrmBindingList;
typedef int XrmQuark, *XrmQuarkList;
typedef XrmQuarkList XrmNameList;
typedef XrmQuark XrmRepresentation;
typedef struct {
unsigned int size;
XPointer addr;
} XrmValue, *XrmValuePtr;
See AlsoXrmDestroyDatabase(), XrmGetFileDatabase(), XrmGetResource(), XrmGet‐
StringDatabase(), XrmInitialize(), XrmMergeDatabases(), XrmParseCom‐
mand(), XrmPutFileDatabase(), XrmPutLineResource(), XrmPutResource(),
XrmPutStringResource(), XrmQGetResource(), XrmQGetSearchList(),
XrmQGetSearchResource(), XrmQPutStringResource(), XrmQuarkToString(),
XrmStringToBindingQuarkList(), XrmStringToQuarkList(), XrmStringTo‐
Quark(), XrmUniqueQuark().
Xlib - Resource Manager XrmQPutResource()