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

# XmStringGetNextComponent(3)

A compound string function that returns the type and value of the next component in a compound string

## 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

This function is obsolete and exists for compatibility with previous releases. It is replaced by **XmStringGetNextTriple**. **XmStringGetNextComponent** returns the type and value of the next component in the compound string identified by *context*. Components are returned one at a time. On return, only some output parameters will be valid; which ones can be determined by examining the returned component type. The following table describes the valid returns for each component type.

| | | |
| --- | --- | --- |
| **Valid Fields** | **Component Type** |
|  |  |  |
| *tag* | **XmSTRING\_COMPONENT\_LOCALE, XmSTRING\_COMPONENT\_TAG** |
|  |  |  |
| *text* | **XmSTRING\_COMPONENT\_LOCALE\_TEXT, XmSTRING\_COMPONENT\_TEXT,** XmSTRING\_COMPONENT\_WIDECHAR\_TEXT |
|  |  |  |
| *direction* | **XmSTRING\_COMPONENT\_DIRECTION** |
|  |  |  |
| *unknown\_tag, unknown\_length, unknown\_value* | **XmSTRING\_COMPONENT\_LAYOUT\_POP, XmSTRING\_COMPONENT\_LAYOUT\_PUSH,** XmSTRING\_COMPONENT\_TAB, XmSTRING\_COMPONENT\_RENDITION\_BEGIN, XmSTRING\_COMPONENT\_RENDITION\_END |
|  |  |  |
| *no valid field* | **XmSTRING\_COMPONENT\_SEPARATOR, XmSTRING\_COMPONENT\_END,** XmSTRING\_COMPONENT\_UNKNOWN |
|  |  |  |

Note that several components produce a return value of **XmSTRING\_COMPONENT\_UNKNOWN**. The data returned by these components is returned in the *unknown\_tag*, *unknown\_length*, and *unknown\_value* fields. 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. Consequently, the use of this procedure is not recommended. Instead, use the **XmStringGetNextTriple** procedure, which provides all the functionality of **XmStringGetNextComponent**, and is fully compatible with the newer component types.

If the function return value is **XmSTRING\_COMPONENT\_LOCALE\_TEXT** or **XmSTRING\_COMPONENT\_TEXT**, the the function allocates space to hold the returned *text*. 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 the allocated space. The application can recover the allocated space by calling **XtFree**.

- *context*

  Specifies the string context structure that was allocated by the **XmStringInitContext** function.

- *text*

  Specifies a pointer to a NULL terminated string.

- *tag*

  Specifies a pointer to the tag component associated with the text. The value **XmFONTLIST\_DEFAULT\_TAG** identifies 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)](/XmStringComponentType/3.md) reference page for a list of component types.

## RELATED

[**XmStringComponentType**(3)](/XmStringComponentType/3.md), [**XmStringCreate**(3)](/XmStringCreate/3.md), and [**XmStringInitContext**(3)](/XmStringInitContext/3.md).
