Back to index

glibc  2.9
Defines | Enumerations
iso-2022-kr.c File Reference
#include <dlfcn.h>
#include <gconv.h>
#include <stdint.h>
#include <string.h>
#include "ksc5601.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 CHARSET_NAME   "ISO-2022-KR//"
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define FROM_LOOP   from_iso2022kr_loop
#define TO_LOOP   to_iso2022kr_loop
#define MIN_NEEDED_FROM   1
#define MAX_NEEDED_FROM   4
#define MIN_NEEDED_TO   4
#define MAX_NEEDED_TO   4
#define PREPARE_LOOP
#define EXTRA_LOOP_ARGS   , setp
#define EMIT_SHIFT_TO_INIT
#define SAVE_RESET_STATE(Save)
#define MIN_NEEDED_INPUT   MIN_NEEDED_FROM
#define MAX_NEEDED_INPUT   MAX_NEEDED_FROM
#define MIN_NEEDED_OUTPUT   MIN_NEEDED_TO
#define LOOPFCT   FROM_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS   int set = *setp
#define UPDATE_PARAMS   *setp = set
#define MIN_NEEDED_INPUT   MIN_NEEDED_TO
#define MIN_NEEDED_OUTPUT   MIN_NEEDED_FROM
#define MAX_NEEDED_OUTPUT   MAX_NEEDED_FROM
#define LOOPFCT   TO_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define EXTRA_LOOP_DECLS   , int *setp
#define INIT_PARAMS   int set = *setp
#define REINIT_PARAMS   set = *setp
#define UPDATE_PARAMS   *setp = set

Enumerations

enum  { ASCII_set = 0, KSC5601_set = 8 }

Define Documentation

#define BODY

Definition at line 197 of file iso-2022-kr.c.

#define BODY

Definition at line 197 of file iso-2022-kr.c.

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

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

#define DEFINE_FINI   1

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

#define DEFINE_INIT   1

Definition at line 39 of file iso-2022-kr.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 &= 7;                                      \
         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 77 of file iso-2022-kr.c.

#define ESC   0x1b

Definition at line 31 of file iso-2022-kr.c.

#define EXTRA_LOOP_ARGS   , setp

Definition at line 62 of file iso-2022-kr.c.

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 257 of file iso-2022-kr.c.

#define EXTRA_LOOP_DECLS   , int *setp

Definition at line 257 of file iso-2022-kr.c.

#define FROM_LOOP   from_iso2022kr_loop

Definition at line 41 of file iso-2022-kr.c.

#define INIT_PARAMS   int set = *setp

Definition at line 258 of file iso-2022-kr.c.

#define INIT_PARAMS   int set = *setp

Definition at line 258 of file iso-2022-kr.c.

#define LOOP_NEED_FLAGS

Definition at line 256 of file iso-2022-kr.c.

#define LOOP_NEED_FLAGS

Definition at line 256 of file iso-2022-kr.c.

#define LOOPFCT   FROM_LOOP

Definition at line 196 of file iso-2022-kr.c.

#define LOOPFCT   TO_LOOP

Definition at line 196 of file iso-2022-kr.c.

#define MAX_NEEDED_FROM   4

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

Definition at line 113 of file iso-2022-kr.c.

Definition at line 195 of file iso-2022-kr.c.

#define MAX_NEEDED_TO   4

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

#define MIN_NEEDED_FROM   1

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

Definition at line 193 of file iso-2022-kr.c.

Definition at line 193 of file iso-2022-kr.c.

Definition at line 194 of file iso-2022-kr.c.

Definition at line 194 of file iso-2022-kr.c.

#define MIN_NEEDED_TO   4

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

#define PREPARE_LOOP
Value:
int save_set;                                                        \
  int *setp = &data->__statep->__count;                                     \
  if (!FROM_DIRECTION && !data->__internal_use                              \
      && data->__invocation_counter == 0)                            \
    {                                                                \
      /* Emit the designator sequence.  */                                  \
      if (outbuf + 4 > outend)                                              \
       return __GCONV_FULL_OUTPUT;                                   \
                                                                     \
      *outbuf++ = ESC;                                                      \
      *outbuf++ = '$';                                                      \
      *outbuf++ = ')';                                                      \
      *outbuf++ = 'C';                                                      \
    }

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

#define REINIT_PARAMS   set = *setp

Definition at line 259 of file iso-2022-kr.c.

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

Definition at line 104 of file iso-2022-kr.c.

#define SI   0x0f

Definition at line 34 of file iso-2022-kr.c.

#define SO   0x0e

Definition at line 35 of file iso-2022-kr.c.

#define TO_LOOP   to_iso2022kr_loop

Definition at line 42 of file iso-2022-kr.c.

#define UPDATE_PARAMS   *setp = set

Definition at line 260 of file iso-2022-kr.c.

#define UPDATE_PARAMS   *setp = set

Definition at line 260 of file iso-2022-kr.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
ASCII_set 
KSC5601_set 

Definition at line 67 of file iso-2022-kr.c.

{
  ASCII_set = 0,
  KSC5601_set = 8
};