XrmPutResource(3)
π XrmPutResource β store database resources (bestie edition)
okay so this is a whole family of libX11 functions from <X11/Xresource.h> that literally just put resources into your XrmDatabase. five functions, one mission: get that data in. it's giving "I'm the write half of the database API." let's go π
β¨ SYNTAX β¨
#include <X11/Xresource.h>
void XrmPutResource(XrmDatabase *database, char *specifier, char *type,
XrmValue *value);
void XrmQPutResource(XrmDatabase *database, XrmBindingList bindings,
XrmQuarkList quarks, XrmRepresentation type, XrmValue *value);
void XrmPutStringResource(XrmDatabase *database, _Xconst char
*specifier, _Xconst char *value);
void XrmQPutStringResource(XrmDatabase *database, XrmBindingList
bindings, XrmQuarkList quarks, _Xconst char *value);
void XrmPutLineResource(XrmDatabase *database, _Xconst char *line);
π ARGUMENTS π
bindingsβ a list of bindings, periodt.databaseβ the resource database in question. iconic.lineβ the resource name and value pair, but as one single string. lowkey efficient.quarksβ the complete or partial name, or the class list, of the resource (as quarks, obviously π¦).specifierβ a complete or partial specification of the resource.typeβ the type of the resource.valueβ the value of the resource, and it's specified as a string, no cap.
πΈ DESCRIPTION πΈ
π XrmPutResource
if database contains NULL, XrmPutResource creates a new database and returns a pointer to it (main character energy fr fr). it's a convenience function that calls XrmStringToBindingQuarkList and then hits you with:
XrmQPutResource(database, bindings, quarks, XrmStringToQuark(type), value)
if the specifier and type are not in the Host Portable Character Encoding, the result is implementation-dependent π. the value is stored in the database without modification β no edits, no notes, just vibes preserved.
π¦ XrmQPutResource
if database contains NULL, XrmQPutResource creates a new database and returns a pointer to it. and listen: if a resource entry with the identical bindings and quarks already exists in the database, the previous type and value get replaced by the new specified type and value. it ate and left no crumbs π
. the value is stored in the database without modification.
π XrmPutStringResource
if database contains NULL, XrmPutStringResource creates a new database and returns a pointer to it. it adds a resource with the specified value to the specified database. it's a convenience function that first calls XrmStringToBindingQuarkList on the specifier and then calls XrmQPutResource, using a "String" representation type. if the specifier is not in the Host Portable Character Encoding, the result is implementation-dependent π. the value is stored in the database without modification.
β XrmQPutStringResource
if database contains NULL, XrmQPutStringResource creates a new database and returns a pointer to it. it's a convenience routine that constructs an XrmValue for the value string (by calling strlen to compute the size, look at her go) and then calls XrmQPutResource, using a "String" representation type. the value is stored in the database without modification.
π XrmPutLineResource
if database contains NULL, XrmPutLineResource creates a new database and returns a pointer to it. it adds a single resource entry to the specified database. the line should be in valid ResourceLine format (see section 15.1) terminated by a newline or null character.
β οΈ bestie be careful: the database that results from using a string with incorrect syntax is implementation-dependent. live your truth but maybe validate first π
the string is parsed in the locale of the database. if the ResourceName is not in the Host Portable Character Encoding, the result is implementation-dependent. and don't forget: comment lines are not stored π.
π₯ SEE ALSO π₯
XrmGetResource(3)XrmInitialize(3)XrmMergeDatabases(3)XrmUniqueQuark(3)Xlib - C Language X Interface
that's the whole lore, bestie π«Ά. this page is from X Version 11, libX11 1.8.14 β yeah, that libX11, the iconic one. mwah, go populate some databases πβ¨π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms