XMSTRINGGETNEXTCOMPONENT(3)
π XmStringGetNextComponent π
okay bestie, welcome to the library call manual page for XmStringGetNextComponent β a compound string function that returns the type and value of the next component in a compound string. yes it's a mouthful, no we are not skipping any of it π«Ά
πΈ NAME πΈ
XmStringGetNextComponent β A compound string function that returns the type and value of the next component in a compound string
β¨ SYNOPSIS β¨
#include <Xm/Xm.h>
XmStringComponentType XmStringGetNextComponent(
XmStringContext context,
char **text,
XmStringTag *tag,
XmStringDirection *direction,
XmStringComponentType *unknown_tag,
unsigned short *unknown_length,
unsigned char **unknown_value);
π DESCRIPTION π
ngl, first thing's first and it's a little sad: this function is obsolete and it only exists for compatibility with previous releases. it has been replaced by XmStringGetNextTriple. periodt. π
XmStringGetNextComponent returns the type and value of the next component in the compound string identified by context. Components come back one at a time, like a lil conga line π. And here's the tea: on return, only some of the output parameters will actually be valid. which ones? you gotta look at the returned component type to figure that out. it's giving "mystery box, but make it C" π
so here's the vibe check on which fields are valid for which component type π
tagβ valid forXmSTRING_COMPONENT_LOCALEandXmSTRING_COMPONENT_TAGtextβ valid forXmSTRING_COMPONENT_LOCALE_TEXT,XmSTRING_COMPONENT_TEXT, andXmSTRING_COMPONENT_WIDECHAR_TEXTdirectionβ valid forXmSTRING_COMPONENT_DIRECTIONunknown_tag,unknown_length,unknown_valueβ valid forXmSTRING_COMPONENT_LAYOUT_POP,XmSTRING_COMPONENT_LAYOUT_PUSH,XmSTRING_COMPONENT_TAB,XmSTRING_COMPONENT_RENDITION_BEGIN, andXmSTRING_COMPONENT_RENDITION_END- no valid field β for
XmSTRING_COMPONENT_SEPARATOR,XmSTRING_COMPONENT_END, andXmSTRING_COMPONENT_UNKNOWN
okay so lowkey a bunch of components produce a return value ofXmSTRING_COMPONENT_UNKNOWN. the data from those comes back in theunknown_tag,unknown_length, andunknown_valuefields instead. this apparent inconsistency is designed to accomodate older applications that may not be equipped to handle the newer component types of Motif version 2.0 and beyond. so yeah β the use of this procedure is not recommended. instead, use theXmStringGetNextTripleprocedure, which provides all the functionality ofXmStringGetNextComponentand is fully compatible with the newer component types. the more you know β¨
and now the memory-management part, pay attention bestie, this one's important π :
if the function return value is XmSTRING_COMPONENT_LOCALE_TEXT or XmSTRING_COMPONENT_TEXT, then the function allocates space to hold the returned text. and if the function return value is XmSTRING_COMPONENT_FONTLIST_ELEMENT_TAG, or XmSTRING_COMPONENT_TAG, then the function allocates space to hold the returned tag. the application is responsible for managing that allocated space. you can recover it by calling XtFree. don't just leave it floating there, that's not main character energy π§
π¦ the parameters π¦
contextβ Specifies the string context structure that was allocated by theXmStringInitContextfunction.textβ Specifies a pointer to a NULL terminated string.tagβ Specifies a pointer to the tag component associated with the text. The valueXmFONTLIST_DEFAULT_TAGidentifies a locale text segment.directionβ Specifies a pointer to the direction of the text.unknown_tagβ Specifies a pointer to the tag of an unknown component.unknown_lengthβ Specifies a pointer to the length of an unknown component.unknown_valueβ Specifies a pointer to the value of an unknown component.
π« RETURN π«
Returns the type of component found. Refer to the XmStringComponentType(3) reference page for a list of component types. slay π
π«Ά RELATED π«Ά
XmStringComponentType(3), XmStringCreate(3), and XmStringInitContext(3).
and that's the whole page babes, no cap π straight from the library call manual β the XmStringGetNextComponent(library call) source and version, as printed on the page itself. go forth and XtFree responsibly ππ
π¦ where this page comes from
- arch rolling: openmotif 2.3.8-4 Β· LGPL-2.1-or-later
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- centos-stream 9: motif-devel 2.3.4-32.el9 Β· LGPLv2+
- epel 10: motif-devel 2.3.8-2.el10_2 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-1.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: motif-devel 2.3.8-2.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: motif-devel 2.3.8-3.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixos 26.05: motif 2.3.8
- nixpkgs unstable: motif 2.3.8
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: motif-devel 2.3.8-bp160.1.1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms