NAME
XrmQPutResource − 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
databaseSpecifies 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 created, it is created in the current locale.
bindingsSpecifies a list of bindings for binding together the quarks argument.
quarksSpecifies the complete or partial name or class list of the resource to be stored.
typeSpecifies the type of the resource.
valueSpecifies the value of the resource.
Description
XrmQPutResource() 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 specified value. The value is stored in the database without modification. database can be a previously defined database, as returned by XrmGetStringDatabase(), 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 distinguish 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 representation type would distinguish between these two. Representation types are created from simple character strings by using the macro XrmStringToRepresentation. 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 returns 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 11, Managing User Preferences.
Structures
XrmDatabase is a pointer to an opaque data type.
typedef enum {
XrmBindTightly, XrmBindLoosely
} XrmBinding, *XrmBindingList;
typedef int XrmQuark, *XrmQuarkList;
typedef XrmQuark XrmRepresentation;
typedef struct {
unsigned int size;
XPointer addr;
} XrmValue, *XrmValuePtr;
See Also
XrmDestroyDatabase(), XrmGetFileDatabase(), XrmGetResource(), XrmGetStringDatabase(), XrmInitialize(), XrmMergeDatabases(), XrmParseCommand(), XrmPutFileDatabase(), XrmPutLineResource(), XrmPutResource(), XrmPutStringResource(), XrmQGetResource(), XrmQGetSearchList(), XrmQGetSearchResource(), XrmQPutStringResource(), XrmQuarkToString(), XrmStringToBindingQuarkList(), XrmStringToQuarkList(), XrmStringToQuark(), XrmUniqueQuark().
Copyright O’Reilly & Assoc. —