_XParseISOEncoding(3X11) — Subroutines
X11R5
NAME
_XParseISOEncoding − parse compound text encoding(ISO 2022)
SYNOPSIS
Status _XParseISOEncoding(ct_str, ct_bytes, scanned_bytes, isoinfo)
char ∗ct_str;
int ct_bytes;
int ∗scanned_bytes;
ISOStateInfo ∗isoinfo;
ARGUMENTS
ct_strIn: CT string.
ct_bytesIn: length of CT strings, counted in bytes.
scanned_bytes
Out: Number of CT bytes has scanned.
isoinfoOut: the information about CT encoding.
DESCRIPTION
The _XParseISOEncoding parses escape control sequence of compound text(ISO 2022), then return the following information about it to isoinfo:
a. number of code bytes.
b. minimum & maximum of encoding. (0x21, 0x7E) for 94-GL; (0xA0, 0xFF) for 96-GR; (0xA1, 0xFE) for 94-GR.
The data type of isoinfo is defined:
typedef struct {
int code_bytes;
unsigned char code_min, code_max;
} ISOStateInfo;
All error status are defined to be less than zero, i.e.:
#define Success 0
#define BadBuffer -1
#define BadTerminate -2
#define BadEncoding -3
The ct_str points to the escape sequence of string, the ct_bytes is the length of ct_str in bytes. The function will also return the scanned number of bytes of ct_str to the variable scanned_bytes.
The CT encoding non-registered by X is treated as BadEncoding.
RETURNED VALUE
The _XParseISOEncoding will return the following values:
Success
successful parsing.
BadTerminate
CT string was terminated uncompletely.
BadEncoding
wrong escape sequence of the CT encoding.
SEE ALSO
Refer to "CT and WC" for CT definition.