Back to index

glibc  2.9
Defines | Functions | Variables
johab.c File Reference
#include <dlfcn.h>
#include <stdint.h>
#include <ksc5601.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Defines

#define CHARSET_NAME   "JOHAB//"
#define FROM_LOOP   from_johab
#define TO_LOOP   to_johab
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define MIN_NEEDED_FROM   1
#define MAX_NEEDED_FROM   2
#define MIN_NEEDED_TO   4
#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 ONEBYTE_BODY
#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

Functions

static uint32_t johab_sym_hanja_to_ucs (uint_fast32_t idx, uint_fast32_t c1, uint_fast32_t c2)

Variables

static const int init [32]
static const int mid [32]
static const int final [32]
static const uint32_t init_to_ucs [19]
static const uint32_t final_to_ucs [31]
static const int init_to_bit [19]
static const int mid_to_bit [21]
static const int final_to_bit [28]
static const uint16_t jamo_from_ucs_table [51]

Define Documentation

#define BODY

Definition at line 278 of file johab.c.

#define BODY

Definition at line 278 of file johab.c.

#define CHARSET_NAME   "JOHAB//"

Definition at line 146 of file johab.c.

#define DEFINE_FINI   1

Definition at line 150 of file johab.c.

#define DEFINE_INIT   1

Definition at line 149 of file johab.c.

#define FROM_LOOP   from_johab

Definition at line 147 of file johab.c.

#define LOOP_NEED_FLAGS

Definition at line 377 of file johab.c.

#define LOOP_NEED_FLAGS

Definition at line 377 of file johab.c.

#define LOOPFCT   FROM_LOOP

Definition at line 277 of file johab.c.

#define LOOPFCT   TO_LOOP

Definition at line 277 of file johab.c.

#define MAX_NEEDED_FROM   2

Definition at line 152 of file johab.c.

Definition at line 158 of file johab.c.

Definition at line 276 of file johab.c.

#define MIN_NEEDED_FROM   1

Definition at line 151 of file johab.c.

Definition at line 274 of file johab.c.

Definition at line 274 of file johab.c.

Definition at line 275 of file johab.c.

Definition at line 275 of file johab.c.

#define MIN_NEEDED_TO   4

Definition at line 153 of file johab.c.

#define ONEBYTE_BODY
Value:
{                                                                    \
    if (c <= 0x7f)                                                   \
      return (c == 0x5c ? 0x20a9 : c);                                      \
    else                                                             \
      return WEOF;                                                   \
  }

Definition at line 263 of file johab.c.

#define TO_LOOP   to_johab

Definition at line 148 of file johab.c.


Function Documentation

static uint32_t johab_sym_hanja_to_ucs ( uint_fast32_t  idx,
uint_fast32_t  c1,
uint_fast32_t  c2 
) [inline, static]

Definition at line 136 of file johab.c.

{
  if (idx <= 0xdefe)
    return (uint32_t) __ksc5601_sym_to_ucs[(c1 - 0xd9) * 188 + c2
                                      - (c2 > 0x90 ? 0x43 : 0x31)];
  else
    return (uint32_t) __ksc5601_hanja_to_ucs[(c1 - 0xe0) * 188 + c2
                                        - (c2 > 0x90 ? 0x43 : 0x31)];
}

Variable Documentation

const int final[32] [static]
Initial value:
{
  -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
  -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, -1, -1
}

Definition at line 47 of file johab.c.

const int final_to_bit[28] [static]
Initial value:
{
  1, 2, 3, 4, 5, 6, 7, 8, 9, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11,
  0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d
}

Definition at line 102 of file johab.c.

const uint32_t final_to_ucs[31] [static]
Initial value:
{
  L'\0', L'\0', 0x3133, L'\0', 0x3135, 0x3136, L'\0', L'\0',
  0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f,
  0x3140, L'\0', L'\0', 0x3144, L'\0', L'\0', L'\0', L'\0',
  L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0', L'\0'
}

Definition at line 68 of file johab.c.

const int init[32] [static]
Initial value:
{
  -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
  19, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
}

Definition at line 35 of file johab.c.

const int init_to_bit[19] [static]
Initial value:
{
  0x8800, 0x8c00, 0x9000, 0x9400, 0x9800, 0x9c00,
  0xa000, 0xa400, 0xa800, 0xac00, 0xb000, 0xb400,
  0xb800, 0xbc00, 0xc000, 0xc400, 0xc800, 0xcc00,
  0xd000
}

Definition at line 86 of file johab.c.

const uint32_t init_to_ucs[19] [static]
Initial value:
{
  0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, 0x3141, 0x3142,
  0x3143, 0x3145, 0x3146, 0x3147, 0x3148, 0x3149, 0x314a, 0x314b,
  0x314c, 0x314d, 0x314e
}

Definition at line 61 of file johab.c.

Initial value:
{
  0x8841, 0x8c41,
  0x8444,
  0x9041,
  0x8446, 0x8447,
  0x9441, 0x9841, 0x9c41,
  0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f, 0x8450,
  0xa041, 0xa441, 0xa841,
  0x8454,
  0xac41, 0xb041, 0xb441, 0xb841, 0xbc41,
  0xc041, 0xc441, 0xc841, 0xcc41, 0xd041,
  0x8461, 0x8481, 0x84a1, 0x84c1, 0x84e1,
  0x8541, 0x8561, 0x8581, 0x85a1, 0x85c1, 0x85e1,
  0x8641, 0x8661, 0x8681, 0x86a1, 0x86c1, 0x86e1,
  0x8741, 0x8761, 0x8781, 0x87a1
}

Definition at line 116 of file johab.c.

const int mid[32] [static]
Initial value:
{
  -1, -1, 0, 1, 2, 3, 4, 5,
  -1, -1, 6, 7, 8, 9, 10, 11,
  -1, -1, 12, 13, 14, 15, 16, 17,
  -1, -1, 18, 19, 20, 21, -1, -1
}

Definition at line 40 of file johab.c.

const int mid_to_bit[21] [static]
Initial value:
{
          0x0060, 0x0080, 0x00a0, 0x00c0, 0x00e0,
  0x0140, 0x0160, 0x0180, 0x01a0, 0x01c0, 0x1e0,
  0x0240, 0x0260, 0x0280, 0x02a0, 0x02c0, 0x02e0,
  0x0340, 0x0360, 0x0380, 0x03a0
}

Definition at line 94 of file johab.c.