Back to index

glibc  2.9
Defines | Functions
euc-kr.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   "EUC-KR//"
#define FROM_LOOP   from_euc_kr
#define TO_LOOP   to_euc_kr
#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 void __attribute ((always_inline))

Define Documentation

#define BODY

Definition at line 126 of file euc-kr.c.

#define BODY

Definition at line 126 of file euc-kr.c.

#define CHARSET_NAME   "EUC-KR//"

Definition at line 63 of file euc-kr.c.

#define DEFINE_FINI   1

Definition at line 67 of file euc-kr.c.

#define DEFINE_INIT   1

Definition at line 66 of file euc-kr.c.

#define FROM_LOOP   from_euc_kr

Definition at line 64 of file euc-kr.c.

#define LOOP_NEED_FLAGS

Definition at line 158 of file euc-kr.c.

#define LOOP_NEED_FLAGS

Definition at line 158 of file euc-kr.c.

#define LOOPFCT   FROM_LOOP

Definition at line 125 of file euc-kr.c.

#define LOOPFCT   TO_LOOP

Definition at line 125 of file euc-kr.c.

#define MAX_NEEDED_FROM   2

Definition at line 69 of file euc-kr.c.

Definition at line 75 of file euc-kr.c.

Definition at line 124 of file euc-kr.c.

#define MIN_NEEDED_FROM   1

Definition at line 68 of file euc-kr.c.

Definition at line 122 of file euc-kr.c.

Definition at line 122 of file euc-kr.c.

Definition at line 123 of file euc-kr.c.

Definition at line 123 of file euc-kr.c.

#define MIN_NEEDED_TO   4

Definition at line 70 of file euc-kr.c.

#define ONEBYTE_BODY
Value:
{                                                                    \
    if (c <= 0x9f)                                                   \
      return c;                                                             \
    else                                                             \
      return WEOF;                                                   \
  }

Definition at line 111 of file euc-kr.c.

#define TO_LOOP   to_euc_kr

Definition at line 65 of file euc-kr.c.


Function Documentation

static void __attribute ( (always_inline)  ) [inline, static]

Definition at line 29 of file euc-kr.c.

{
  if (ch > 0x9f)
    {
      if (__builtin_expect (ch, 0) == 0x20a9)
       {
         /* Half-width Korean Currency WON sign.  There is no
             equivalent in EUC-KR.  Some mappings use \x5c because
             this is what some old Korean ASCII variants used but this
             is causing problems.  We map it to the FULL WIDTH WON SIGN.  */
         cp[0] = '\xa3';
         cp[1] = '\xdc';
       }
      else if (__builtin_expect (ucs4_to_ksc5601 (ch, cp, 2), 0)
         != __UNKNOWN_10646_CHAR)
       {
         cp[0] |= 0x80;
         cp[1] |= 0x80;
       }
      else
       cp[0] = cp[1] = '\0';
    }
  else
    {
      /* There is no mapping for U005c but we nevertheless map it to
        \x5c.  */
      cp[0] = (unsigned char) ch;
      cp[1] = '\0';
    }
}