Back to index

glibc  2.9
Defines | Functions
gconv_simple.c File Reference
#include <byteswap.h>
#include <dlfcn.h>
#include <endian.h>
#include <errno.h>
#include <gconv.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <sys/param.h>
#include <gconv_int.h>
#include "gconv_builtin.h"
#include <iconv/skeleton.c>
#include <iconv/loop.c>

Go to the source code of this file.

Defines

#define BUILTIN_ALIAS(s1, s2)   /* nothing */
#define BUILTIN_TRANSFORMATION(From, To, Cost, Name, Fct, BtowcFct, MinF, MaxF, MinT, MaxT)
#define EILSEQ   EINVAL
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_ucs4_loop
#define TO_LOOP   internal_ucs4_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_internal_ucs4
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   ucs4_internal_loop
#define TO_LOOP   ucs4_internal_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_ucs4_internal
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_ucs4le_loop
#define TO_LOOP   internal_ucs4le_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_internal_ucs4le
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   ucs4le_internal_loop
#define TO_LOOP   ucs4le_internal_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_ucs4le_internal
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   1
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   ascii_internal_loop
#define TO_LOOP   ascii_internal_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_ascii_internal
#define ONE_DIRECTION   1
#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 DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   1
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_ascii_loop
#define TO_LOOP   internal_ascii_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_internal_ascii
#define ONE_DIRECTION   1
#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 DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   1
#define MAX_NEEDED_TO   6
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_utf8_loop
#define TO_LOOP   internal_utf8_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_internal_utf8
#define ONE_DIRECTION   1
#define MIN_NEEDED_INPUT   MIN_NEEDED_FROM
#define MIN_NEEDED_OUTPUT   MIN_NEEDED_TO
#define MAX_NEEDED_OUTPUT   MAX_NEEDED_TO
#define LOOPFCT   FROM_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   1
#define MAX_NEEDED_FROM   6
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   utf8_internal_loop
#define TO_LOOP   utf8_internal_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_utf8_internal
#define ONE_DIRECTION   1
#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 STORE_REST
#define UNPACK_BYTES
#define CLEAR_STATE   state->__count = 0
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   2
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   ucs2_internal_loop
#define TO_LOOP   ucs2_internal_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_ucs2_internal
#define ONE_DIRECTION   1
#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 DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   2
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_ucs2_loop
#define TO_LOOP   internal_ucs2_loop /* This is not used. */
#define FUNCTION_NAME   __gconv_transform_internal_ucs2
#define ONE_DIRECTION   1
#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 DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   2
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   1
#define FROM_LOOP   ucs2reverse_internal_loop
#define TO_LOOP   ucs2reverse_internal_loop/* This is not used.*/
#define FUNCTION_NAME   __gconv_transform_ucs2reverse_internal
#define ONE_DIRECTION   1
#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 DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   4
#define MIN_NEEDED_TO   2
#define FROM_DIRECTION   1
#define FROM_LOOP   internal_ucs2reverse_loop
#define TO_LOOP   internal_ucs2reverse_loop/* This is not used.*/
#define FUNCTION_NAME   __gconv_transform_internal_ucs2reverse
#define ONE_DIRECTION   1
#define MIN_NEEDED_INPUT   MIN_NEEDED_FROM
#define MIN_NEEDED_OUTPUT   MIN_NEEDED_TO
#define LOOPFCT   FROM_LOOP
#define BODY
#define LOOP_NEED_FLAGS

Functions

wint_t __gconv_btwoc_ascii (struct __gconv_step *step, unsigned char c)
static int __attribute ((always_inline))

Define Documentation

#define BODY
Value:
{                                                                    \
    if (__builtin_expect (*inptr > '\x7f', 0))                              \
      {                                                                     \
       /* The value is too large.  We don't try transliteration here since   \
          this is not an error because of the lack of possibilities to             \
          represent the result.  This is a genuine bug in the input since    \
          ASCII does not allow such values.  */                      \
       STANDARD_FROM_LOOP_ERR_HANDLER (1);                                  \
      }                                                                     \
    else                                                             \
      {                                                                     \
       /* It's an one byte sequence.  */                             \
       *((uint32_t *) outptr) = *inptr++;                            \
       outptr += sizeof (uint32_t);                                         \
      }                                                                     \
  }

Definition at line 1265 of file gconv_simple.c.

#define BODY
Value:
{                                                                    \
    if (__builtin_expect (*((const uint32_t *) inptr) > 0x7f, 0))           \
      {                                                                     \
       UNICODE_TAG_HANDLER (*((const uint32_t *) inptr), 4);                \
       STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
      }                                                                     \
    else                                                             \
      {                                                                     \
       /* It's an one byte sequence.  */                             \
       *outptr++ = *((const uint32_t *) inptr);                      \
       inptr += sizeof (uint32_t);                                   \
      }                                                                     \
  }

Definition at line 1265 of file gconv_simple.c.

#define BODY

Definition at line 1265 of file gconv_simple.c.

#define BODY

Definition at line 1265 of file gconv_simple.c.

#define BODY
Value:
{                                                                    \
    uint16_t u1 = get16 (inptr);                                     \
                                                                     \
    if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0))                  \
      {                                                                     \
       /* Surrogate characters in UCS-2 input are not valid.  Reject        \
          them.  (Catching this here is not security relevant.)  */         \
       STANDARD_FROM_LOOP_ERR_HANDLER (2);                                  \
      }                                                                     \
                                                                     \
    *((uint32_t *) outptr) = u1;                                     \
    outptr += sizeof (uint32_t);                                     \
    inptr += 2;                                                             \
  }

Definition at line 1265 of file gconv_simple.c.

#define BODY
Value:
{                                                                    \
    uint32_t val = *((const uint32_t *) inptr);                             \
                                                                     \
    if (__builtin_expect (val >= 0x10000, 0))                               \
      {                                                                     \
       UNICODE_TAG_HANDLER (val, 4);                                        \
       STANDARD_TO_LOOP_ERR_HANDLER (4);                             \
      }                                                                     \
    else if (__builtin_expect (val >= 0xd800 && val < 0xe000, 0))           \
      {                                                                     \
       /* Surrogate characters in UCS-4 input are not valid.                \
          We must catch this, because the UCS-2 output might be             \
          interpreted as UTF-16 by other programs.  If we let               \
          surrogates pass through, attackers could make a security          \
          hole exploit by synthesizing any desired plane 1-16               \
          character.  */                                             \
       result = __GCONV_ILLEGAL_INPUT;                                      \
       if (! ignore_errors_p ())                                     \
         break;                                                      \
       inptr += 4;                                                   \
       ++*irreversible;                                              \
       continue;                                                     \
      }                                                                     \
    else                                                             \
      {                                                                     \
       put16 (outptr, val);                                          \
        outptr += sizeof (uint16_t);                                        \
       inptr += 4;                                                   \
      }                                                                     \
  }

Definition at line 1265 of file gconv_simple.c.

#define BODY
Value:
{                                                                    \
    uint16_t u1 = bswap_16 (get16 (inptr));                                 \
                                                                     \
    if (__builtin_expect (u1 >= 0xd800 && u1 < 0xe000, 0))                  \
      {                                                                     \
       /* Surrogate characters in UCS-2 input are not valid.  Reject        \
          them.  (Catching this here is not security relevant.)  */         \
       if (! ignore_errors_p ())                                     \
         {                                                           \
           result = __GCONV_ILLEGAL_INPUT;                                  \
           break;                                                    \
         }                                                           \
       inptr += 2;                                                   \
       ++*irreversible;                                              \
       continue;                                                     \
      }                                                                     \
                                                                     \
    *((uint32_t *) outptr) = u1;                                     \
    outptr += sizeof (uint32_t);                                     \
    inptr += 2;                                                             \
  }

Definition at line 1265 of file gconv_simple.c.

#define BODY

Definition at line 1265 of file gconv_simple.c.

#define BUILTIN_ALIAS (   s1,
  s2 
)    /* nothing */

Definition at line 33 of file gconv_simple.c.

#define BUILTIN_TRANSFORMATION (   From,
  To,
  Cost,
  Name,
  Fct,
  BtowcFct,
  MinF,
  MaxF,
  MinT,
  MaxT 
)
Value:
extern int Fct (struct __gconv_step *, struct __gconv_step_data *,          \
                __const unsigned char **, __const unsigned char *,          \
                unsigned char **, size_t *, int, int);

Definition at line 34 of file gconv_simple.c.

#define CLEAR_STATE   state->__count = 0

Definition at line 1125 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_FINI   0

Definition at line 1253 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define DEFINE_INIT   0

Definition at line 1252 of file gconv_simple.c.

#define EILSEQ   EINVAL

Definition at line 43 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_DIRECTION   1

Definition at line 1256 of file gconv_simple.c.

#define FROM_LOOP   internal_ucs4_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   ucs4_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   internal_ucs4le_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   ucs4le_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   ascii_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   internal_ascii_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   internal_utf8_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   utf8_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   ucs2_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   internal_ucs2_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   ucs2reverse_internal_loop

Definition at line 1257 of file gconv_simple.c.

#define FROM_LOOP   internal_ucs2reverse_loop

Definition at line 1257 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_ucs4

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_ucs4_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_ucs4le

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_ucs4le_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_ascii_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_ascii

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_utf8

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_utf8_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_ucs2_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_ucs2

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_ucs2reverse_internal

Definition at line 1259 of file gconv_simple.c.

#define FUNCTION_NAME   __gconv_transform_internal_ucs2reverse

Definition at line 1259 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOP_NEED_FLAGS

Definition at line 1292 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define LOOPFCT   FROM_LOOP

Definition at line 1264 of file gconv_simple.c.

#define MAX_NEEDED_FROM   6

Definition at line 930 of file gconv_simple.c.

Definition at line 939 of file gconv_simple.c.

Definition at line 878 of file gconv_simple.c.

#define MAX_NEEDED_TO   6

Definition at line 869 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   1

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   1

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   2

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   2

Definition at line 1254 of file gconv_simple.c.

#define MIN_NEEDED_FROM   4

Definition at line 1254 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1262 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

Definition at line 1263 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   1

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   1

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   2

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   4

Definition at line 1255 of file gconv_simple.c.

#define MIN_NEEDED_TO   2

Definition at line 1255 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define ONE_DIRECTION   1

Definition at line 1260 of file gconv_simple.c.

#define STORE_REST

Definition at line 1046 of file gconv_simple.c.

#define TO_LOOP   internal_ucs4_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   ucs4_internal_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   internal_ucs4le_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   ucs4le_internal_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   ascii_internal_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   internal_ascii_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   internal_utf8_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   utf8_internal_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   ucs2_internal_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   internal_ucs2_loop /* This is not used. */

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   ucs2reverse_internal_loop/* This is not used.*/

Definition at line 1258 of file gconv_simple.c.

#define TO_LOOP   internal_ucs2reverse_loop/* This is not used.*/

Definition at line 1258 of file gconv_simple.c.

#define UNPACK_BYTES
Value:
{                                                                    \
    static const unsigned char inmask[5] = { 0xc0, 0xe0, 0xf0, 0xf8, 0xfc };  \
    wint_t wch = state->__value.__wch;                                      \
    size_t ntotal = state->__count >> 8;                             \
                                                                     \
    inlen = state->__count & 255;                                    \
                                                                     \
    bytebuf[0] = inmask[ntotal - 2];                                        \
                                                                     \
    do                                                               \
      {                                                                     \
       if (--ntotal < inlen)                                                \
         bytebuf[ntotal] = 0x80 | (wch & 0x3f);                      \
       wch >>= 6;                                                    \
      }                                                                     \
    while (ntotal > 1);                                                     \
                                                                     \
    bytebuf[0] |= wch;                                                      \
  }

Definition at line 1104 of file gconv_simple.c.


Function Documentation

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

Definition at line 75 of file gconv_simple.c.

{
  const unsigned char *inptr = *inptrp;
  unsigned char *outptr = *outptrp;
  size_t n_convert = MIN (inend - inptr, outend - outptr) / 4;
  int result;

#if __BYTE_ORDER == __LITTLE_ENDIAN
  /* Sigh, we have to do some real work.  */
  size_t cnt;
  uint32_t *outptr32 = (uint32_t *) outptr;

  for (cnt = 0; cnt < n_convert; ++cnt, inptr += 4)
    *outptr32++ = bswap_32 (*(const uint32_t *) inptr);

  *inptrp = inptr;
  *outptrp = (unsigned char *) outptr32;
#elif __BYTE_ORDER == __BIG_ENDIAN
  /* Simply copy the data.  */
  *inptrp = inptr + n_convert * 4;
  *outptrp = __mempcpy (outptr, inptr, n_convert * 4);
#else
# error "This endianess is not supported."
#endif

  /* Determine the status.  */
  if (*inptrp == inend)
    result = __GCONV_EMPTY_INPUT;
  else if (*outptrp + 4 > outend)
    result = __GCONV_FULL_OUTPUT;
  else
    result = __GCONV_INCOMPLETE_INPUT;

  return result;
}

Here is the call graph for this function:

wint_t __gconv_btwoc_ascii ( struct __gconv_step step,
unsigned char  c 
)

Definition at line 50 of file gconv_simple.c.

{
  if (c < 0x80)
    return c;
  else
    return WEOF;
}