Back to index

glibc  2.9
Defines | Typedefs | Variables
cp1258.c File Reference
#include <dlfcn.h>
#include <stdint.h>
#include <assert.h>
#include <stdlib.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Defines

#define NELEMS(arr)   (sizeof (arr) / sizeof (arr[0]))
#define CHARSET_NAME   "CP1258//"
#define FROM_LOOP   from_cp1258
#define TO_LOOP   to_cp1258
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define FROM_LOOP_MIN_NEEDED_FROM   1
#define FROM_LOOP_MAX_NEEDED_FROM   1
#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   2
#define PREPARE_LOOP
#define EXTRA_LOOP_ARGS   , statep
#define SAVE_RESET_STATE(Save)
#define EMIT_SHIFT_TO_INIT
#define COMP_TABLE_IDX_0300   0
#define COMP_TABLE_LEN_0300   31
#define COMP_TABLE_IDX_0301   (COMP_TABLE_IDX_0300 + COMP_TABLE_LEN_0300)
#define COMP_TABLE_LEN_0301   60
#define COMP_TABLE_IDX_0303   (COMP_TABLE_IDX_0301 + COMP_TABLE_LEN_0301)
#define COMP_TABLE_LEN_0303   34
#define COMP_TABLE_IDX_0309   (COMP_TABLE_IDX_0303 + COMP_TABLE_LEN_0303)
#define COMP_TABLE_LEN_0309   24
#define COMP_TABLE_IDX_0323   (COMP_TABLE_IDX_0309 + COMP_TABLE_LEN_0309)
#define COMP_TABLE_LEN_0323   50
#define COMP_TABLE_IDX_END   (COMP_TABLE_IDX_0323 + COMP_TABLE_LEN_0323)
#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 *statep
#define ONEBYTE_BODY
#define FROM_IDX_00   0
#define FROM_IDX_01   (FROM_IDX_00 + 78)
#define FROM_IDX_02   (FROM_IDX_01 + 95)
#define FROM_IDX_03   (FROM_IDX_02 + 23)
#define FROM_IDX_20   (FROM_IDX_03 + 36)
#define FROM_IDX_FF   (FROM_IDX_20 + 40)
#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 *statep

Typedefs

typedef int verify1 [(NELEMS(comp_table_data)==COMP_TABLE_IDX_END)-1]
typedef int verify2 [(NELEMS(from_ucs4)==FROM_IDX_FF)-1]

Variables

static const uint16_t to_ucs4 [128]
struct {
uint16_t base
uint16_t composed
comp_table_data []
struct {
unsigned int idx
unsigned int len
comp_table [5]
static const unsigned char from_ucs4 []
struct {
uint16_t composed
uint32_t base:8
uint32_t comb1:8
decomp_table []

Define Documentation

#define BODY

Definition at line 769 of file cp1258.c.

#define BODY

Definition at line 769 of file cp1258.c.

#define CHARSET_NAME   "CP1258//"

Definition at line 30 of file cp1258.c.

#define COMP_TABLE_IDX_0300   0
#define COMP_TABLE_LEN_0300   31
#define COMP_TABLE_LEN_0301   60
#define COMP_TABLE_LEN_0303   34
#define COMP_TABLE_LEN_0309   24
#define COMP_TABLE_LEN_0323   50
#define DEFINE_FINI   1

Definition at line 34 of file cp1258.c.

#define DEFINE_INIT   1

Definition at line 33 of file cp1258.c.

Value:
if (data->__statep->__count != 0)                                    \
    {                                                                \
      if (FROM_DIRECTION)                                            \
       {                                                             \
         if (__builtin_expect (outbuf + 4 <= outend, 1))                    \
           {                                                         \
             /* Write out the last character.  */                           \
             *((uint32_t *) outbuf) = data->__statep->__count >> 3;         \
             outbuf += sizeof (uint32_t);                            \
             data->__statep->__count = 0;                            \
           }                                                         \
         else                                                        \
           /* We don't have enough room in the output buffer.  */           \
           status = __GCONV_FULL_OUTPUT;                             \
       }                                                             \
      else                                                           \
       /* We don't use shift states in the TO_DIRECTION.  */                \
       data->__statep->__count = 0;                                         \
    }

Definition at line 65 of file cp1258.c.

#define EXTRA_LOOP_ARGS   , statep

Definition at line 46 of file cp1258.c.

#define EXTRA_LOOP_DECLS   , int *statep

Definition at line 869 of file cp1258.c.

#define EXTRA_LOOP_DECLS   , int *statep

Definition at line 869 of file cp1258.c.

#define FROM_IDX_00   0
#define FROM_IDX_01   (FROM_IDX_00 + 78)
#define FROM_IDX_02   (FROM_IDX_01 + 95)
#define FROM_IDX_03   (FROM_IDX_02 + 23)
#define FROM_IDX_20   (FROM_IDX_03 + 36)
#define FROM_IDX_FF   (FROM_IDX_20 + 40)
#define FROM_LOOP   from_cp1258

Definition at line 31 of file cp1258.c.

#define FROM_LOOP_MAX_NEEDED_FROM   1

Definition at line 36 of file cp1258.c.

#define FROM_LOOP_MAX_NEEDED_TO   4

Definition at line 38 of file cp1258.c.

#define FROM_LOOP_MIN_NEEDED_FROM   1

Definition at line 35 of file cp1258.c.

#define FROM_LOOP_MIN_NEEDED_TO   4

Definition at line 37 of file cp1258.c.

#define LOOP_NEED_FLAGS

Definition at line 868 of file cp1258.c.

#define LOOP_NEED_FLAGS

Definition at line 868 of file cp1258.c.

#define LOOPFCT   FROM_LOOP

Definition at line 768 of file cp1258.c.

#define LOOPFCT   TO_LOOP

Definition at line 768 of file cp1258.c.

Definition at line 765 of file cp1258.c.

Definition at line 765 of file cp1258.c.

Definition at line 767 of file cp1258.c.

Definition at line 767 of file cp1258.c.

Definition at line 764 of file cp1258.c.

Definition at line 764 of file cp1258.c.

Definition at line 766 of file cp1258.c.

Definition at line 766 of file cp1258.c.

#define NELEMS (   arr)    (sizeof (arr) / sizeof (arr[0]))

Definition at line 27 of file cp1258.c.

#define ONEBYTE_BODY
Value:
{                                                                    \
    uint32_t ch;                                                     \
                                                                     \
    if (c < 0x80)                                                    \
      ch = c;                                                        \
    else                                                             \
      {                                                                     \
       ch = to_ucs4[c - 0x80];                                              \
       if (ch == L'\0')                                              \
         return WEOF;                                                       \
      }                                                                     \
    if (ch >= 0x0041 && ch <= 0x01b0)                                       \
      return WEOF;                                                   \
    return ch;                                                              \
  }

Definition at line 483 of file cp1258.c.

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

Definition at line 43 of file cp1258.c.

#define SAVE_RESET_STATE (   Save)
Value:
if (Save)                                                            \
    saved_state = *statep;                                           \
  else                                                               \
    *statep = saved_state

Definition at line 51 of file cp1258.c.

#define TO_LOOP   to_cp1258

Definition at line 32 of file cp1258.c.

#define TO_LOOP_MAX_NEEDED_FROM   4

Definition at line 40 of file cp1258.c.

#define TO_LOOP_MAX_NEEDED_TO   2

Definition at line 42 of file cp1258.c.

#define TO_LOOP_MIN_NEEDED_FROM   4

Definition at line 39 of file cp1258.c.

#define TO_LOOP_MIN_NEEDED_TO   1

Definition at line 41 of file cp1258.c.


Typedef Documentation

Definition at line 351 of file cp1258.c.

Definition at line 553 of file cp1258.c.


Variable Documentation

struct { ... } comp_table[5] [static]
struct { ... } comp_table_data[] [static]
struct { ... } decomp_table[] [static]
const unsigned char from_ucs4[] [static]

Definition at line 504 of file cp1258.c.

const uint16_t to_ucs4[128] [static]
Initial value:
  {
    
    0x20AC,      0, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
    0x02C6, 0x2030,      0, 0x2039, 0x0152,      0,      0,      0,
    
         0, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
    0x02DC, 0x2122,      0, 0x203A, 0x0153,      0,      0, 0x0178,
    
    0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
    0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
    
    0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
    0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
    
    0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
    0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
    
    0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7,
    0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
    
    0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
    0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
    
    0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7,
    0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF,
  }

Definition at line 89 of file cp1258.c.