Back to index

glibc  2.9
Classes | Defines
8bit-gap.c File Reference
#include <dlfcn.h>
#include <stdint.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Classes

struct  gap

Defines

#define NONNUL(c)   ((c) != '\0')
#define FROM_LOOP   from_gap
#define TO_LOOP   to_gap
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define MIN_NEEDED_FROM   1
#define MIN_NEEDED_TO   4
#define MIN_NEEDED_INPUT   MIN_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 LOOPFCT   TO_LOOP
#define BODY
#define LOOP_NEED_FLAGS

Class Documentation

struct gap

Definition at line 25 of file 8bit-gap.c.

Class Members
uint32_t end
uint16_t end
int32_t idx
uint32_t start
uint16_t start

Define Documentation

#define BODY
Value:
{                                                                    \
    uint32_t ch = to_ucs4[*inptr];                                   \
                                                                     \
    if (HAS_HOLES && __builtin_expect (ch == L'\0', 0) && NONNUL (*inptr))    \
      {                                                                     \
       /* This is an illegal character.  */                                 \
       STANDARD_FROM_LOOP_ERR_HANDLER (1);                                  \
      }                                                                     \
    else                                                             \
      {                                                                     \
       put32 (outptr, ch);                                           \
       outptr += 4;                                                  \
      }                                                                     \
                                                                     \
    ++inptr;                                                         \
  }

Definition at line 86 of file 8bit-gap.c.

#define BODY
Value:
{                                                                    \
    const struct gap *rp = from_idx;                                        \
    uint32_t ch = get32 (inptr);                                     \
    unsigned char res;                                                      \
                                                                     \
    if (__builtin_expect (ch >= 0xffff, 0))                                 \
      {                                                                     \
       UNICODE_TAG_HANDLER (ch, 4);                                         \
       rp = NULL;                                                    \
      }                                                                     \
    else                                                             \
      while (ch > rp->end)                                           \
       ++rp;                                                         \
    if (__builtin_expect (rp == NULL, 0)                             \
       || __builtin_expect (ch < rp->start, 0)                              \
       || (res = from_ucs4[ch + rp->idx],                            \
           __builtin_expect (res, '\1') == '\0' && ch != 0))                \
      {                                                                     \
       /* This is an illegal character.  */                                 \
       STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
      }                                                                     \
                                                                     \
    *outptr++ = res;                                                 \
    inptr += 4;                                                             \
  }

Definition at line 86 of file 8bit-gap.c.

#define DEFINE_FINI   1

Definition at line 43 of file 8bit-gap.c.

#define DEFINE_INIT   1

Definition at line 42 of file 8bit-gap.c.

#define FROM_LOOP   from_gap

Definition at line 40 of file 8bit-gap.c.

#define LOOP_NEED_FLAGS

Definition at line 112 of file 8bit-gap.c.

#define LOOP_NEED_FLAGS

Definition at line 112 of file 8bit-gap.c.

#define LOOPFCT   FROM_LOOP

Definition at line 85 of file 8bit-gap.c.

#define LOOPFCT   TO_LOOP

Definition at line 85 of file 8bit-gap.c.

#define MIN_NEEDED_FROM   1

Definition at line 44 of file 8bit-gap.c.

Definition at line 83 of file 8bit-gap.c.

Definition at line 83 of file 8bit-gap.c.

Definition at line 84 of file 8bit-gap.c.

Definition at line 84 of file 8bit-gap.c.

#define MIN_NEEDED_TO   4

Definition at line 45 of file 8bit-gap.c.

#define NONNUL (   c)    ((c) != '\0')

Definition at line 36 of file 8bit-gap.c.

#define ONEBYTE_BODY
Value:
{                                                                    \
    uint32_t ch = to_ucs4[c];                                               \
                                                                     \
    if (HAS_HOLES && __builtin_expect (ch == L'\0', 0) && NONNUL (c))       \
      return WEOF;                                                   \
    else                                                             \
      return ch;                                                     \
  }

Definition at line 70 of file 8bit-gap.c.

#define TO_LOOP   to_gap

Definition at line 41 of file 8bit-gap.c.