---
name: "mtext_data"
section: "3m17n"
platform: "linux"
package: "m17n-docs"
version: "1.8.4-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mtext_data"
---

# mtext\_data(3m17n)

## NAME

mtext\_data -

## SYNOPSIS

void\* **mtext\_data** (**MText** \* *mt*, enum **MTextFormat** \* *fmt*, int \* *nunits*, int \* *pos\_idx*, int \* *unit\_idx*)

## DESCRIPTION

Get information about the text data in M-text. The **mtext\_data()** function returns a pointer to the text data of M-text **mt**. If **fmt** is not NULL, the format of the text data is stored in it. If **nunits** is not NULL, the number of units of the text data is stored in it.

If **pos\_idx** is not NULL and it points to a non-negative number, what it points to is a character position. In this case, the return value is a pointer to the text data of a character at that position.

Otherwise, if **unit\_idx** is not NULL, it points to a unit position. In this case, the return value is a pointer to the text data of a character containing that unit.

The character position and unit position of the return value are stored in **pos\_idx** and **unit\_idx** respectively if they are not NULL.

- •

  If the format of the text data is MTEXT\_FORMAT\_US\_ASCII or MTEXT\_FORMAT\_UTF\_8, one unit is unsigned char.

- •

  If the format is MTEXT\_FORMAT\_UTF\_16LE or MTEXT\_FORMAT\_UTF\_16BE, one unit is unsigned short.

- •

  If the format is MTEXT\_FORMAT\_UTF\_32LE or MTEXT\_FORMAT\_UTF\_32BE, one unit is unsigned int.

## COPYRIGHT

Copyright (C) 2001 Information-technology Promotion Agency (IPA)\
 Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)\
 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License  \<http://www.gnu.org/licenses/fdl.html\>.
