Back to index

glibc  2.9
Defines | Enumerations
iso-2022-cn-ext.c File Reference
#include <dlfcn.h>
#include <gconv.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "gb2312.h"
#include "iso-ir-165.h"
#include "cns11643.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 SS3_0   ESC
#define SS3_1   0x4f
#define CHARSET_NAME   "ISO-2022-CN-EXT//"
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define FROM_LOOP   from_iso2022cn_ext_loop
#define TO_LOOP   to_iso2022cn_ext_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 X12345   '\0'
#define X7589   '\0'
#define X13131   '\0'
#define X7590   '\0'
#define X13132   '\0'
#define CURRENT_MASK   (SO_mask | SS2_mask | SS3_mask)
#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 EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS
#define UPDATE_PARAMS   *setp = (set | ann) << 3
#define LOOP_NEED_FLAGS
#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 EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS
#define REINIT_PARAMS
#define UPDATE_PARAMS   *setp = (set | ann) << 3
#define LOOP_NEED_FLAGS

Enumerations

enum  {
  ASCII_set = 0, GB2312_set, GB12345_set, CNS11643_1_set,
  ISO_IR_165_set, SO_mask = 7, GB7589_set = 1 << 3, GB13131_set = 2 << 3,
  CNS11643_2_set = 3 << 3, SS2_mask = 3 << 3, GB7590_set = 1 << 5, GB13132_set = 2 << 5,
  CNS11643_3_set = 3 << 5, CNS11643_4_set = 4 << 5, CNS11643_5_set = 5 << 5, CNS11643_6_set = 6 << 5,
  CNS11643_7_set = 7 << 5, SS3_mask = 7 << 5, GB2312_ann = 1 << 8, GB12345_ann = 2 << 8,
  CNS11643_1_ann = 3 << 8, ISO_IR_165_ann = 4 << 8, SO_ann = 7 << 8, GB7589_ann = 1 << 11,
  GB13131_ann = 2 << 11, CNS11643_2_ann = 3 << 11, SS2_ann = 3 << 11, GB7590_ann = 1 << 13,
  GB13132_ann = 2 << 13, CNS11643_3_ann = 3 << 13, CNS11643_4_ann = 4 << 13, CNS11643_5_ann = 5 << 13,
  CNS11643_6_ann = 6 << 13, CNS11643_7_ann = 7 << 13, SS3_ann = 7 << 13
}

Define Documentation

#define BODY

Definition at line 380 of file iso-2022-cn-ext.c.

#define BODY

Definition at line 380 of file iso-2022-cn-ext.c.

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

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

#define CURRENT_MASK   (SO_mask | SS2_mask | SS3_mask)

Definition at line 103 of file iso-2022-cn-ext.c.

#define DEFINE_FINI   1

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

#define DEFINE_INIT   1

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

Value:
if (data->__statep->__count >> 3 != 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 << 3;                     \
      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;                                                \
             if (data->__flags & __GCONV_IS_LAST)                           \
              *irreversible += 1;                                    \
             data->__statep->__count = ASCII_set << 3;                      \
           }                                                         \
       }                                                             \
    }

Definition at line 130 of file iso-2022-cn-ext.c.

#define ESC   0x1b

Definition at line 35 of file iso-2022-cn-ext.c.

#define EXTRA_LOOP_ARGS   , setp

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

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 624 of file iso-2022-cn-ext.c.

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 624 of file iso-2022-cn-ext.c.

#define FROM_LOOP   from_iso2022cn_ext_loop

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

#define FROM_LOOP_MAX_NEEDED_FROM   4

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

#define FROM_LOOP_MAX_NEEDED_TO   4

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

#define FROM_LOOP_MIN_NEEDED_FROM   1

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

#define FROM_LOOP_MIN_NEEDED_TO   4

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

#define INIT_PARAMS
Value:
int set = (*setp >> 3) & CURRENT_MASK; \
                            int ann = (*setp >> 3) & ~CURRENT_MASK

Definition at line 625 of file iso-2022-cn-ext.c.

#define INIT_PARAMS
Value:
int set = (*setp >> 3) & CURRENT_MASK; \
                            int ann = (*setp >> 3) & ~CURRENT_MASK

Definition at line 625 of file iso-2022-cn-ext.c.

#define LOOP_NEED_FLAGS

Definition at line 634 of file iso-2022-cn-ext.c.

#define LOOP_NEED_FLAGS

Definition at line 634 of file iso-2022-cn-ext.c.

#define LOOPFCT   FROM_LOOP

Definition at line 379 of file iso-2022-cn-ext.c.

#define LOOPFCT   TO_LOOP

Definition at line 379 of file iso-2022-cn-ext.c.

Definition at line 376 of file iso-2022-cn-ext.c.

Definition at line 376 of file iso-2022-cn-ext.c.

Definition at line 378 of file iso-2022-cn-ext.c.

Definition at line 378 of file iso-2022-cn-ext.c.

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

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

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

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

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

Definition at line 61 of file iso-2022-cn-ext.c.

#define REINIT_PARAMS
Value:
do                                       \
                              {                                      \
                                set = (*setp >> 3) & CURRENT_MASK;          \
                                ann = (*setp >> 3) & ~CURRENT_MASK;         \
                              }                                      \
                            while (0)

Definition at line 627 of file iso-2022-cn-ext.c.

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

Definition at line 156 of file iso-2022-cn-ext.c.

#define SI   0x0f

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

#define SO   0x0e

Definition at line 41 of file iso-2022-cn-ext.c.

#define SS2_0   ESC

Definition at line 42 of file iso-2022-cn-ext.c.

#define SS2_1   0x4e

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

#define SS3_0   ESC

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

#define SS3_1   0x4f

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

#define TO_LOOP   to_iso2022cn_ext_loop

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

#define TO_LOOP_MAX_NEEDED_FROM   4

Definition at line 58 of file iso-2022-cn-ext.c.

#define TO_LOOP_MAX_NEEDED_TO   6

Definition at line 60 of file iso-2022-cn-ext.c.

#define TO_LOOP_MIN_NEEDED_FROM   4

Definition at line 57 of file iso-2022-cn-ext.c.

#define TO_LOOP_MIN_NEEDED_TO   1

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

#define UPDATE_PARAMS   *setp = (set | ann) << 3

Definition at line 633 of file iso-2022-cn-ext.c.

#define UPDATE_PARAMS   *setp = (set | ann) << 3

Definition at line 633 of file iso-2022-cn-ext.c.

#define X12345   '\0'

Definition at line 71 of file iso-2022-cn-ext.c.

#define X13131   '\0'

Definition at line 73 of file iso-2022-cn-ext.c.

#define X13132   '\0'

Definition at line 75 of file iso-2022-cn-ext.c.

#define X7589   '\0'

Definition at line 72 of file iso-2022-cn-ext.c.

#define X7590   '\0'

Definition at line 74 of file iso-2022-cn-ext.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
ASCII_set 
GB2312_set 
GB12345_set 
CNS11643_1_set 
ISO_IR_165_set 
SO_mask 
GB7589_set 
GB13131_set 
CNS11643_2_set 
SS2_mask 
GB7590_set 
GB13132_set 
CNS11643_3_set 
CNS11643_4_set 
CNS11643_5_set 
CNS11643_6_set 
CNS11643_7_set 
SS3_mask 
GB2312_ann 
GB12345_ann 
CNS11643_1_ann 
ISO_IR_165_ann 
SO_ann 
GB7589_ann 
GB13131_ann 
CNS11643_2_ann 
SS2_ann 
GB7590_ann 
GB13132_ann 
CNS11643_3_ann 
CNS11643_4_ann 
CNS11643_5_ann 
CNS11643_6_ann 
CNS11643_7_ann 
SS3_ann 

Definition at line 80 of file iso-2022-cn-ext.c.

{
  ASCII_set = 0,
  GB2312_set,
  GB12345_set,
  CNS11643_1_set,
  ISO_IR_165_set,
  SO_mask = 7,

  GB7589_set = 1 << 3,
  GB13131_set = 2 << 3,
  CNS11643_2_set = 3 << 3,
  SS2_mask = 3 << 3,

  GB7590_set = 1 << 5,
  GB13132_set = 2 << 5,
  CNS11643_3_set = 3 << 5,
  CNS11643_4_set = 4 << 5,
  CNS11643_5_set = 5 << 5,
  CNS11643_6_set = 6 << 5,
  CNS11643_7_set = 7 << 5,
  SS3_mask = 7 << 5,

#define CURRENT_MASK (SO_mask | SS2_mask | SS3_mask)

  GB2312_ann = 1 << 8,
  GB12345_ann = 2 << 8,
  CNS11643_1_ann = 3 << 8,
  ISO_IR_165_ann = 4 << 8,
  SO_ann = 7 << 8,

  GB7589_ann = 1 << 11,
  GB13131_ann = 2 << 11,
  CNS11643_2_ann = 3 << 11,
  SS2_ann = 3 << 11,

  GB7590_ann = 1 << 13,
  GB13132_ann = 2 << 13,
  CNS11643_3_ann = 3 << 13,
  CNS11643_4_ann = 4 << 13,
  CNS11643_5_ann = 5 << 13,
  CNS11643_6_ann = 6 << 13,
  CNS11643_7_ann = 7 << 13,
  SS3_ann = 7 << 13
};