Back to index

glibc  2.9
Defines | Enumerations
iso-2022-cn.c File Reference
#include <dlfcn.h>
#include <gconv.h>
#include <stdint.h>
#include <string.h>
#include "gb2312.h"
#include "cns11643l1.h"
#include "cns11643l2.h"
#include <assert.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Defines

#define ESC   0x1b
#define SI   0x0f
#define SO   0x0e
#define SS2_0   ESC
#define SS2_1   0x4e
#define CHARSET_NAME   "ISO-2022-CN//"
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define FROM_LOOP   from_iso2022cn_loop
#define TO_LOOP   to_iso2022cn_loop
#define FROM_LOOP_MIN_NEEDED_FROM   1
#define FROM_LOOP_MAX_NEEDED_FROM   4
#define FROM_LOOP_MIN_NEEDED_TO   4
#define FROM_LOOP_MAX_NEEDED_TO   4
#define TO_LOOP_MIN_NEEDED_FROM   4
#define TO_LOOP_MAX_NEEDED_FROM   4
#define TO_LOOP_MIN_NEEDED_TO   1
#define TO_LOOP_MAX_NEEDED_TO   6
#define PREPARE_LOOP
#define EXTRA_LOOP_ARGS   , setp
#define EMIT_SHIFT_TO_INIT
#define SAVE_RESET_STATE(Save)
#define MIN_NEEDED_INPUT   FROM_LOOP_MIN_NEEDED_FROM
#define MAX_NEEDED_INPUT   FROM_LOOP_MAX_NEEDED_FROM
#define MIN_NEEDED_OUTPUT   FROM_LOOP_MIN_NEEDED_TO
#define MAX_NEEDED_OUTPUT   FROM_LOOP_MAX_NEEDED_TO
#define LOOPFCT   FROM_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS
#define UPDATE_PARAMS   *setp = set | ann
#define MIN_NEEDED_INPUT   TO_LOOP_MIN_NEEDED_FROM
#define MAX_NEEDED_INPUT   TO_LOOP_MAX_NEEDED_FROM
#define MIN_NEEDED_OUTPUT   TO_LOOP_MIN_NEEDED_TO
#define MAX_NEEDED_OUTPUT   TO_LOOP_MAX_NEEDED_TO
#define LOOPFCT   TO_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS
#define REINIT_PARAMS
#define UPDATE_PARAMS   *setp = set | ann

Enumerations

enum  {
  ASCII_set = 0, GB2312_set = 8, CNS11643_1_set = 16, CNS11643_2_set = 24,
  CURRENT_SEL_MASK = 24, GB2312_ann = 32, CNS11643_1_ann = 64, CNS11643_2_ann = 128,
  CURRENT_ANN_MASK = 224
}

Define Documentation

#define BODY

Definition at line 226 of file iso-2022-cn.c.

#define BODY

Definition at line 226 of file iso-2022-cn.c.

#define CHARSET_NAME   "ISO-2022-CN//"

Definition at line 43 of file iso-2022-cn.c.

#define DEFINE_FINI   1

Definition at line 45 of file iso-2022-cn.c.

#define DEFINE_INIT   1

Definition at line 44 of file iso-2022-cn.c.

Value:
if (data->__statep->__count != ASCII_set)                            \
    {                                                                \
      if (FROM_DIRECTION)                                            \
       /* It's easy, we don't have to emit anything, we just reset the             \
          state for the input.  */                                   \
       data->__statep->__count = ASCII_set;                                 \
      else                                                           \
       {                                                             \
         /* We are not in the initial state.  To switch back we have        \
            to emit `SI'.  */                                               \
         if (__builtin_expect (outbuf == outend, 0))                        \
           /* We don't have enough room in the output buffer.  */           \
           status = __GCONV_FULL_OUTPUT;                             \
         else                                                        \
           {                                                         \
             /* Write out the shift sequence.  */                           \
             *outbuf++ = SI;                                                \
             data->__statep->__count = ASCII_set;                           \
           }                                                         \
       }                                                             \
    }

Definition at line 81 of file iso-2022-cn.c.

#define ESC   0x1b

Definition at line 32 of file iso-2022-cn.c.

#define EXTRA_LOOP_ARGS   , setp

Definition at line 59 of file iso-2022-cn.c.

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 374 of file iso-2022-cn.c.

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 374 of file iso-2022-cn.c.

#define FROM_LOOP   from_iso2022cn_loop

Definition at line 46 of file iso-2022-cn.c.

#define FROM_LOOP_MAX_NEEDED_FROM   4

Definition at line 49 of file iso-2022-cn.c.

#define FROM_LOOP_MAX_NEEDED_TO   4

Definition at line 51 of file iso-2022-cn.c.

#define FROM_LOOP_MIN_NEEDED_FROM   1

Definition at line 48 of file iso-2022-cn.c.

#define FROM_LOOP_MIN_NEEDED_TO   4

Definition at line 50 of file iso-2022-cn.c.

#define INIT_PARAMS
Value:
int set = *setp & CURRENT_SEL_MASK; \
                            int ann = *setp & CURRENT_ANN_MASK

Definition at line 375 of file iso-2022-cn.c.

#define INIT_PARAMS
Value:
int set = *setp & CURRENT_SEL_MASK; \
                            int ann = *setp & CURRENT_ANN_MASK

Definition at line 375 of file iso-2022-cn.c.

#define LOOP_NEED_FLAGS

Definition at line 373 of file iso-2022-cn.c.

#define LOOP_NEED_FLAGS

Definition at line 373 of file iso-2022-cn.c.

#define LOOPFCT   FROM_LOOP

Definition at line 225 of file iso-2022-cn.c.

#define LOOPFCT   TO_LOOP

Definition at line 225 of file iso-2022-cn.c.

Definition at line 222 of file iso-2022-cn.c.

Definition at line 222 of file iso-2022-cn.c.

Definition at line 224 of file iso-2022-cn.c.

Definition at line 224 of file iso-2022-cn.c.

Definition at line 221 of file iso-2022-cn.c.

Definition at line 221 of file iso-2022-cn.c.

Definition at line 223 of file iso-2022-cn.c.

Definition at line 223 of file iso-2022-cn.c.

#define PREPARE_LOOP
Value:
int save_set;                                                        \
  int *setp = &data->__statep->__count;

Definition at line 56 of file iso-2022-cn.c.

#define REINIT_PARAMS
Value:
do                                       \
                              {                                      \
                                set = *setp & CURRENT_SEL_MASK;             \
                                ann = *setp & CURRENT_ANN_MASK;             \
                              }                                      \
                            while (0)

Definition at line 377 of file iso-2022-cn.c.

#define SAVE_RESET_STATE (   Save)
Value:
if (Save)                                                            \
    save_set = *setp;                                                       \
  else                                                               \
    *setp = save_set

Definition at line 105 of file iso-2022-cn.c.

#define SI   0x0f

Definition at line 37 of file iso-2022-cn.c.

#define SO   0x0e

Definition at line 38 of file iso-2022-cn.c.

#define SS2_0   ESC

Definition at line 39 of file iso-2022-cn.c.

#define SS2_1   0x4e

Definition at line 40 of file iso-2022-cn.c.

#define TO_LOOP   to_iso2022cn_loop

Definition at line 47 of file iso-2022-cn.c.

#define TO_LOOP_MAX_NEEDED_FROM   4

Definition at line 53 of file iso-2022-cn.c.

#define TO_LOOP_MAX_NEEDED_TO   6

Definition at line 55 of file iso-2022-cn.c.

#define TO_LOOP_MIN_NEEDED_FROM   4

Definition at line 52 of file iso-2022-cn.c.

#define TO_LOOP_MIN_NEEDED_TO   1

Definition at line 54 of file iso-2022-cn.c.

#define UPDATE_PARAMS   *setp = set | ann

Definition at line 383 of file iso-2022-cn.c.

#define UPDATE_PARAMS   *setp = set | ann

Definition at line 383 of file iso-2022-cn.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
ASCII_set 
GB2312_set 
CNS11643_1_set 
CNS11643_2_set 
CURRENT_SEL_MASK 
GB2312_ann 
CNS11643_1_ann 
CNS11643_2_ann 
CURRENT_ANN_MASK 

Definition at line 64 of file iso-2022-cn.c.