XStringListToTextProperty(3)
π¦ string lists + text properties: the libX11 page π¦
okay bestie, this is the libX11 / XLIB FUNCTIONS manual page for XStringListToTextProperty(3), and it's literally about converting string lists and text property structures. No cap, it's giving βC API but make it group chat.β π
πΈ NAME πΈ
XStringListToTextProperty, XTextPropertyToStringList, XFreeStringList, XTextProperty β convert string lists and text property structure. That's the whole squad, and yes, some of these are functions and one is the structure. β¨
π SYNTAX π
Status XStringListToTextProperty(char **list, int count, XTextProperty
*text_prop_return);
Status XTextPropertyToStringList(XTextProperty *text_prop, char
***list_return, int *count_return);
void XFreeStringList(char **list);
π ARGUMENTS π
countβ specifies the number of strings. π’count_returnβ returns the number of strings. she gives you the count back, queen.listβ specifies the list of strings to be freed. π§Ήlistβ specifies a list of null-terminated character strings. yes, same arg name, different job β not me having twolists in the same section πlist_returnβ returns a list of null-terminated character strings. πtext_propβ specifies theXTextPropertystructure to be used.text_prop_returnβ returns theXTextPropertystructure. π¦
π₯ DESCRIPTION π₯
So XStringListToTextProperty sets the specified XTextProperty to be of type STRING (format 8) with a value representing the concatenation of the specified list of null-separated character strings. It also stores an extra null byte at the end of the value field of text_prop_return β and that extra null byte is not included in the nitems member. The strings are assumed (without verification!) to be in the STRING encoding. If insufficient memory is available for the new value string, XStringListToTextProperty does not set any fields in the XTextProperty structure and returns a zero status. Otherwise, it returns a nonzero status. To free the storage for the value field, use XFree. β¨
XTextPropertyToStringList returns a list of strings representing the null-separated elements of the specified XTextProperty structure. Important vibe check: the data in text_prop must be of type STRING and format 8. Multiple elements of the property β for example, the strings in a disjoint text selection β are separated by NULL (encoding 0). The contents of the property are not null-terminated. If insufficient memory is available for the list and its elements, XTextPropertyToStringList sets no return values and returns a zero status. Otherwise, it returns a nonzero status. To free the storage for the list and its contents, use XFreeStringList. π
XFreeStringList releases memory allocated by XmbTextPropertyToTextList, Xutf8TextPropertyToTextList and XTextPropertyToStringList, plus the missing charset list allocated by XCreateFontSet. So it's the cleanup bestie for those specific allocations. π§Ήπ«Ά
π§ STRUCTURES π§
The XTextProperty structure contains:
typedef struct {
unsigned char *value; /* property data */
Atom encoding; /* type of property */
int format; /* 8, 16, or 32 */
unsigned long nitems; /* number of items in value */
} XTextProperty;
π SEE ALSO π
go read these too, bestie:
XAllocClassHint(3)XAllocIconSize(3)XAllocSizeHints(3)XAllocWMHints(3)XFree(3)XSetCommand(3)XSetTransientForHint(3)XSetTextProperty(3)XSetWMClientMachine(3)XSetWMColormapWindows(3)XSetWMIconName(3)XSetWMName(3)XSetWMProperties(3)XSetWMProtocols(3)Xlib - C Language X Interface
k bye bestie π this page comes from X Version 11, libX11 1.8.14, and the footer tag is XStringListToTextProperty(3). The footer doesn't list a separate date, so no invented date here β no cap. π«Άβ¨
π¦ 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