XRes(3)
πΈ XRes β the X-Resource extension client library πΈ
okay bestie, gather round, because today we're talking about XRes, aka the X-Resource extension client library, and it lives in the Library Functions Manual section of your life (that's section 3, for the girlies keeping track). this whole page is your little guide to the libXres 1.2.2 era, X Version 11 vibes, and it's giving "let me peek at what the X server is actually doing" energy. π
β¨ NAME β¨
XRes β the X-Resource extension client library, no cap.
π SYNOPSIS π
first things first, you gotta pull in the header:
#include <X11/extensions/XRes.h>
then we got two lil structs that are basically the main characters:
typedef struct {
XID resource_base;
XID resource_mask;
} XResClient;
typedef struct {
Atom resource_type;
unsigned int count;
} XResType;
and here's the whole function lineup, bestie, every single one:
Bool XResQueryExtension(Display *dpy, int *event_base_return, int
*error_base_return);
Status XResQueryVersion(Display *dpy, int *major_version_return, int
*minor_version_return);
Status XResQueryClients(Display *dpy, int *num_clients, XResClient
**clients);
Status XResQueryClientResources(Display *dpy, XID xid, int *num_types,
XResType **types);
Status XResQueryClientPixmapBytes(Display *dpy, XID xid, unsigned long
*bytes);
π¦ DESCRIPTION π¦
so. X-Resource is an extension that lets a client ask the X server about how it's using its various resources. π«Ά and listen β do not confuse it with the X resource database access functions. different girl. totally different vibe. iykyk.
XResQueryExtensionreturnsTrueif the XRes extension is available on the given display. and bestie, you must callXResQueryExtensionbefore calling any other XRes function, because that's how you negotiate a compatible protocol version. if you don't? you get undefined behavior β XRes may or may not work, and honestly that's the scariest sentence on this whole page. πXResQueryVersionreturnsTrueif the request succeeded, and the major and minor protocol versions the server supports come back inmajor_version_returnandminor_version_return. slay.XResQueryClientsfills a list of clients of the given display. for each client it returns, inside theXResClientstructure, a mask and a base value of the resources those clients are using. returnsTrueon success orFalseon failure.XResQueryClientResourcesfills a list ofXResTypestructures, telling you for each resource type allocated by the client its name (as anAtom) and the number of resources of that type allocated. returnsTrueon success orFalseon failure.XResQueryClientPixmapBytesgives you, for resources of typePIXMAP, the total number of bytes allocated in the X server by the given client. returnsTrueon success orFalseon failure. it's giving memory accountability, honestly. π
π ERRORS π
XResQueryClientResources and XResQueryClientPixmapBytes will both return BadValue if you pass them an illegal client identifier. so like... don't do that. π
π SEE ALSO π
π AUTHOR π
Mark Vojkovich, originally for The XFree86 Project Inc. we stan. β¨
π§ STABILITY π§
okay so this is the part where i hold your hand, bestie: this API is considered experimental. the XRes library major revision may be incremented whenever incompatible changes are done to the API without notice. use with care. fr fr. π
and that's the whole page, babe β written up as part of X Version 11, libXres 1.2.2, and printed right there in the XRes(3) corner of the manual. go forth and query those resources responsibly. periodt. π
ππ¦
π¦ where this page comes from
- centos-stream 10: libXres-devel 1.2.2-5.el10 Β· X11
- fedora 43: libXres-devel 1.2.2-6.fc43 Β· X11
- fedora 43: libXres-devel 1.2.2-6.fc43 Β· X11
- fedora 44: libXres-devel 1.2.2-7.fc44 Β· X11
- fedora 44: libXres-devel 1.2.2-7.fc44 Β· X11
- opensuse-leap 16.0: libXres-devel 1.2.2-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXres-devel 1.2.2-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXres-devel 1.2.2-160000.3.2 Β· MIT
- opensuse-leap 16.0: libXres-devel 1.2.2-160000.3.2 Β· MIT
- Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms