XMCVTTEXTPROPERTYTOXMSTRINGTABLE(3)
β¨ NAME β¨
okay bestie, welcome to XmCvtTextPropertyToXmStringTable β she's a function that converts from a TextProperty Structure to a StringTable π and yes that's a mouthful, we're gonna get through it together.
πΈ SYNOPSIS πΈ
#include <Xm/Xm.h>
int XmCvtTextPropertyToXmStringTable (display, text_prop, string_table_return, count_return)
Display *display;
XTextProperty *text_prop;
XmStringTable *string_table_return;
int *count_return;
(void)
periodt. now let's break it down π
π¦ DESCRIPTION π¦
XmCvtTextPropertyToXmStringTable takes the XTextProperty structure you hand it and turns it into an XmStringTable, like so:
- If the
encodingmember oftext_propis the AtomSTRING, every returnedXmStringgets a tag of"ISO8859-1"and a text type ofXmCHARSET_TEXT. iconic. - If the
encodingmember oftext_propis the encoding of the current locale, and that encoding is notSTRING, then each returnedXmStringgets a tag of_MOTIF_DEFAULT_LOCALEand a text type ofXmMULTIBYTE_TEXT. very demure, very locale-aware π - If the
encodingmember oftext_propis anything other thanSTRINGor the encoding of the current locale, then the contents of the returned compound strings are implementation dependent π (i.e. whatever your implementation feels like, no promises).
If the conversion depends on the locale and the current locale isn't supported, the function returns XLocaleNotSupported. If conversion to the encoding of the current locale is required, and the locale is supported but there's no converter available for the encoding specified in text_prop, the function returns XConverterNotFound. For supported locales, the existence of a converter from COMPOUND_TEXT, STRING, UTF8_STRING, or the encoding of the current locale is guaranteed if XSupportsLocale returns True for the current locale β but heads up, the actual text may still contain unconvertible characters π. Converting other encodings to the encoding of the current locale is implementation dependent. And in all of these error cases, the function does not set any return values. not even one. zero. nada.
Also! If an element of thevaluemember oftext_propisn't convertible toXmString, the corresponding entry in the returnedXmStringTablewill beNULL, andXmCvtTextPropertyToXmStringTablestill returnsSuccess. she's forgiving like that π«Ά
Now, about freeing β because bestie, memory doesn't free itself:
To free the storage for the XmStringTable and its count_return compound strings returned by this function, first free each XmString in the table using XmStringFree, and then free the XmStringTable itself using XtFree. In that order, no skipping, no shortcuts β¨
displayβ Specifies the connection to the X server. hi X server πtext_propβ Specifies a pointer to theXTextProperty. Theformatmember oftext_propmust be8. that's a requirement, not a suggestion πstring_table_returnβ Specifies theXmStringTablearray into which the converted compound strings are placed. this is where the magic lands πcount_returnβ Specifies the number ofXmStringsreturned by this function. the receipts, basically.
π RETURN VALUES π
Upon success, this function returns the set of XmStrings in string_table_return, and it returns the number of XmStrings in count_return, and returns Success. ate. otherwise, it returns the following:
XLocaleNotSupportedβ Returned if conversion depends on the locale and the current locale is not supported. πXConverterNotFoundβ Returned if conversion to the encoding of the current locale is required and if the locale is supported but no converter is available for the encoding specified intext_prop. she looked everywhere, nothing. π
π RELATED INFORMATION π
XmCvtXmStringTableToTextProperty(3), XmText(3), and XmTextGetString(3). go read those too, iykyk π
and that's the whole page babes π
she lives in the (library call) manual, and ngl the footer doesn't hand over a date, so we're calling her timeless β¨ go forth and convert those TextProperties, you've got this πππ¦
π¦ where this page comes from
- alpine 3.24: motif-doc 2.5.2-r0 Β· LGPL-2.1-or-later
- 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