XMPARSEMAPPING(3)
π XmParseMapping π
okay bestie, welcome to the XmParseMapping page from the library call manual. Buckle up, because this is the data type for a compound string parse mapping, and it's lowkey iconic. π«Ά
β¨ NAME β¨
XmParseMapping β Data type for a compound string parse mapping. It's the opaque bestie holding the pattern-matching tea for XmStringParseText. π
πΈ SYNOPSIS πΈ
#include <Xm/Xm.h>
π DESCRIPTION π
XmParseMapping is an opaque data type for a parse mapping used by XmStringParseText to create a compound string. A parse mapping contains a pattern to be matched in text being parsed to create a compound string. It also contains a compound string, or a function to be invoked to provide a compound string, to be included in the compound string being created whenever the pattern is matched.
An application uses a resource-style interface to specify components for an XmParseMapping. XmParseMappingCreate creates a parse mapping, using a resource-style argument list. XmParseMappingGetValues and XmParseMappingSetValues retrieve and set the components of a parse mapping. XmParseMappingFree recovers memory used by a parse mapping. XmParseTable is an array of XmParseMapping objects.
The XmNinvokeParseProc resource is a function of type XmParseProc, which is defined as follows:
XmIncludeStatus (*XmParseProc) (text_in_out, text_end, type, tag, entry, pattern_length,
str_include, call_data)
XtPointer *text_in_out;
XtPointer text_end;
XmTextType type;
XmStringTag tag;
XmParseMapping entry;
int pattern_length;
XmString *str_include;
XtPointer call_data;
A parse procedure provides an escape mechanism for arbitrarily complex parsing. This procedure is invoked when a pattern in the input text is matched with a pattern in a parse mapping whose XmNincludeStatus is XmINVOKE.
The input text is a pointer to the first byte of the pattern that was matched to trigger the call to the parse procedure. The parse procedure consumes as many bytes of the input string as it needs and sets the input text pointer to the following byte. It returns a compound string to be included in the compound string being constructed, and it also returns an XmIncludeStatus indicating how the returned compound string should be handled. If the parse procedure does not set the input text pointer ahead by at least one byte, the parsing routine continues trying to match the input text with the patterns in the remaining parse mappings in the parse table. Otherwise, the parsing routine begins with the new input text pointer and tries to match the input text with patterns in the parse mappings starting at the beginning of the parse table.
Here's the arg-by-arg breakdown, bestie:
text_in_outβ Specifies the text being parsed. The value is a pointer to the first byte of text matching the pattern that triggered the call to the parse procedure. When the parse procedure returns, this argument is set to the position in the text where parsing should resumeβthat is, to the byte following the last character parsed by the parse procedure.text_endβ Specifies a pointer to the end of thetext_in_outstring. Iftext_endisNULL, the string is scanned until aNULLcharacter is found. Otherwise, the string is scanned up to but not including the character whose address istext_end.typeβ Specifies the type of text and the tag type. If a locale tag should be created,typehas a value of eitherXmMULTIBYTE_TEXTorXmWIDECHAR_TEXT. If a charset should be created,typehas a value ofXmCHARSET_TEXT.tagβ Specifies the tag to be used in creating the result. The type of string tag created (charset or locale) depends on the text type and the passed intagvalue. If thetagvalue isNULLand iftypeindicates that a charset string tag should be created, the string tag has the value that is the result of mappingXmSTRING_DEFAULT_CHARSET. Iftypeindicates a locale string tag, the string tag has the value_MOTIF_DEFAULT_LOCALE.entryβ Specifies the parse mapping that triggered the call to the parse procedure.pattern_lengthβ Specifies the number of bytes in the input text, followingtext_in_out, that constitute the matched pattern.str_includeβ Specifies a pointer to a compound string. The parse procedure creates a compound string to be included in the compound string being constructed. The parse procedure then returns the compound string in this argument.call_dataβ Specifies data passed by the application to the parsing routine.
The parse procedure returns an XmIncludeStatus indicating how str_include is to be included in the compound string being constructed. Following are the possible values:
XmINSERTβ Concatenate the result to the compound string being constructed and continue parsing.XmTERMINATEβ Concatenate the result to the compound string being constructed and terminate parsing.
π New Resources π
The following table defines a set of resources used by the programmer to specify data. The codes in the access column indicate if the given resource can be set at creation time (C), set by using XmParseMappingSetValues (S), retrieved by using XmParseMappingGetValues (G), or is not applicable (N/A).
β¨ XmParseMapping Resource Set β¨
Because we can't do tables in this terminal glow-up, here's the same set as a list. The Class column is blank for every row, so I'm tagging it (blank). π
XmNclientDataβ Class: (blank) Β· Type:XtPointerΒ· Default:NULLΒ· Access:CSGXmNincludeStatusβ Class: (blank) Β· Type:XmIncludeStatusΒ· Default:XmINSERTΒ· Access:CSGXmNinvokeParseProcβ Class: (blank) Β· Type:XmParseProcΒ· Default:NULLΒ· Access:CSGXmNpatternβ Class: (blank) Β· Type:XtPointerΒ· Default:NULLΒ· Access:CSGXmNpatternTypeβ Class: (blank) Β· Type:XmTextTypeΒ· Default:XmCHARSET_TEXTΒ· Access:CSGXmNsubstituteβ Class: (blank) Β· Type:XmStringΒ· Default:NULLΒ· Access:CSG
XmNclientData β Specifies data to be used by the parse procedure.
XmNincludeStatus β Specifies how the result of the mapping is to be included in the compound string being constructed. Unless the value is XmINVOKE, the result of the mapping is the value of XmNsubstitute. Following are the possible values for XmNincludeStatus:
XmINSERTβ Concatenate the result to the compound string being constructed and continue parsing.XmINVOKEβ Invoke theXmNinvokeParseProcon the text being parsed and use the returned compound string instead ofXmNsubstituteas the result to be inserted into the compound string being constructed. The include status returned by the parse procedure (XmINSERTorXmTERMINATE) determines how the returned compound string is included.XmTERMINATEβ Concatenate the result to the compound string being constructed and terminate parsing.
XmNinvokeParseProc β Specifies the parse procedure to be invoked when XmNincludeStatus is XmINVOKE.
XmNpattern β Specifies a pattern to be matched in the text being parsed. This is a maximum of one character.
XmNpatternType β Specifies the type of the pattern that is the value of XmNpattern. Following are the possible values:
XmCHARSET_TEXTXmMULTIBYTE_TEXTXmWIDECHAR_TEXT
XmNsubstitute β Specifies the compound string to be included in the compound string being constructed when XmNincludeStatus is XmINSERT or XmTERMINATE.
π RELATED π
XmParseMappingCreate(3)XmParseMappingFree(3)XmParseMappingGetValues(3)XmParseMappingSetValues(3)XmParseTable(3)XmString(3)
That's the whole XmParseMapping situation, bestie. This page came from the library call manual, and the footer didn't give a separate date, so that's the source/version/date tea. Go parse something cute. πβ¨
π¦ 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