


_XParseISOEncoding(3X11)			     _XParseISOEncoding(3X11)
X11R5									X11R5



NAME
  _XParseISOEncoding - parse compound text encoding(ISO	2022)

SYNOPSIS
  SSttaattuuss __XXPPaarrsseeIISSOOEEnnccooddiinngg(_c_t__s_t_r, _c_t__b_y_t_e_s, _s_c_a_n_n_e_d__b_y_t_e_s, _i_s_o_i_n_f_o)
  cchhaarr *_c_t__s_t_r;;
  iinntt _c_t__b_y_t_e_s;;
  iinntt *_s_c_a_n_n_e_d__b_y_t_e_s;;
  IISSOOSSttaatteeIInnffoo *_i_s_o_i_n_f_o;;

ARGUMENTS

  _c_t__s_t_r    In:	CT string.

  _c_t__b_y_t_e_s  In:	length of CT strings, counted in bytes.

  _s_c_a_n_n_e_d__b_y_t_e_s
	    Out: Number	of CT bytes has	scanned.

  _i_s_o_i_n_f_o   Out: the information about CT encoding.

DESCRIPTION
  The __XXPPaarrsseeIISSOOEEnnccooddiinngg 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 __XXPPaarrsseeIISSOOEEnnccooddiinngg will return the following values:

  SSuucccceessss
       successful parsing.

  BBaaddTTeerrmmiinnaattee
       CT string was terminated	uncompletely.

  BBaaddEEnnccooddiinngg
       wrong escape sequence of	the CT encoding.

SEE ALSO
  Refer	to "CT and WC" for CT definition.  delim off


























































