---
name: "XmStringParseText"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmStringParseText"
---

# XmStringParseText(3)

A function that converts a character string to a compound string

## NAME

**XmStringParseText** — A function that converts a character string to a compound string

## SYNOPSIS

```
#include <Xm/Xm.h>
XmString XmStringParseText(
XtPointer text,
XtPointer *text_end,
XmStringTag tag,
XmTextType type,
XmParseTable parse_table,
Cardinal parse_count,
XtPointer call_data);
```

## DESCRIPTION

**XmStringParseText** converts characters specified in *text* to corresponding components in the returned compound string. The resulting compound string consists of at least one locale or charset tag component and a series of **XmString** text components and other components. The conversion proceeds according to the parse information contained in *parse\_table*. See the *Motif Programmer's Guide* for more information about parsing and parse tables.

- •

  If *type* is **XmCHARSET\_TEXT**, the associated *tag* is interpreted as a charset name. If *tag* has a value of NULL, a charset component whose value is the result of mapping **XmFONTLIST\_DEFAULT\_TAG** is created.

- •

  If *type* is **XmMULTIBYTE\_TEXT** or **XmWIDECHAR\_TEXT**, the associated *tag* is interpreted as a language environment name. If *tag* has a value of NULL, a locale component with a value of **\_MOTIF\_DEFAULT\_LOCALE** is created. If *type* is **XmMULTIBYTE\_TEXT** or **XmWIDECHAR\_TEXT**, *tag* must be NULL or **\_MOTIF\_DEFAULT\_LOCALE**.

**XmStringParseText** also scans the string for characters that have matches in *parse\_table*. Whenever a match is found, the text up to that point is concatenated with the mapped component.

- *text*

  Specifies the NULL-terminated string containing characters of a type determined by *type*. This is updated to point to after the last character scanned.

- *text\_end*

  Specifies a pointer into *text*. If a NULL is supplied to the *text\_end* parameter, then **XmStringParseText** parses *text* until NULL is encountered, or until it reaches a point in *text* where it is directed to stop (for example, by a **parse\_proc**). Otherwise, the value supplied to the *text\_end* parameter is the pointer into *text* where parsing is to stop, and the returned character is the one where parsing did stop.

- *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 in *tag* value. If the *tag* value is NULL and if *type* indicates that a charset string tag should be created, the string tag has the value that is the result of mapping **XmFONTLIST\_DEFAULT\_TAG**. If *type* indicates a locale string tag, the string tag has the value **\_MOTIF\_DEFAULT\_LOCALE**.

- *type*

  Specifies the type of text and the tag type. If a locale tag should be created, *type* has a value of either **XmMULTIBYTE\_TEXT** or **XmWIDECHAR\_TEXT**. If *type* has value of **XmCHARSET\_TEXT**, a charset tag will be created.

- *parse\_table*

  Specifies the parse table to be used in scanning for characters to be converted to other compound string components.

- *parse\_count*

  Specifies the number of entries in *parse\_table*.

- *call\_data*

  Specifies data to be passed to the parse procedures.

## RETURN

Returns a new compound string. The function allocates space to hold the returned compound string. When the application no longer needs the returned compound string, the application should call **XmStringFree**.

## RELATED

[**XmString**(3)](/XmString/3.md), [**XmStringFree**(3)](/XmStringFree/3.md), [**XmParseTable**(3)](/XmParseTable/3.md), [**XmParseMapping**(3)](/XmParseMapping/3.md).
