Back to index

glibc  2.9
Classes | Defines | Enumerations | Functions
unicode.c File Reference
#include <byteswap.h>
#include <dlfcn.h>
#include <gconv.h>
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Classes

struct  unicode_data

Defines

#define BOM   0xfeff
#define BOM_OE   0xfffe
#define FROM_LOOP   from_unicode_loop
#define TO_LOOP   to_unicode_loop
#define DEFINE_INIT   0
#define DEFINE_FINI   0
#define MIN_NEEDED_FROM   2
#define MIN_NEEDED_TO   4
#define FROM_DIRECTION   (dir == from_unicode)
#define PREPARE_LOOP
#define EXTRA_LOOP_ARGS   , swap
#define MIN_NEEDED_INPUT   MIN_NEEDED_TO
#define MIN_NEEDED_OUTPUT   MIN_NEEDED_FROM
#define LOOPFCT   TO_LOOP
#define BODY
#define LOOP_NEED_FLAGS
#define EXTRA_LOOP_DECLS   , int swap
#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 EXTRA_LOOP_DECLS   , int swap

Enumerations

enum  direction {
  illegal_dir, to_iso2022jp, from_iso2022jp, illegal_dir,
  to_iso646, from_iso646, illegal_dir, to_unicode,
  from_unicode, illegal_dir, to_utf16, from_utf16,
  illegal_dir, to_utf32, from_utf32
}

Functions

int gconv_init (struct __gconv_step *step)
void gconv_end (struct __gconv_step *data)

Class Documentation

struct unicode_data

Definition at line 86 of file unicode.c.


Define Documentation

#define BODY

Definition at line 189 of file unicode.c.

#define BODY
Value:
{                                                                    \
    uint16_t u1 = get16 (inptr);                                     \
                                                                     \
    if (swap)                                                        \
      u1 = bswap_16 (u1);                                            \
                                                                     \
    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);                                  \
      }                                                                     \
									      \
    put32 (outptr, u1);                                                     \
                                                                     \
    inptr += 2;                                                             \
    outptr += 4;                                                     \
  }

Definition at line 189 of file unicode.c.

#define BOM   0xfeff

Definition at line 30 of file unicode.c.

#define BOM_OE   0xfffe

Definition at line 32 of file unicode.c.

#define DEFINE_FINI   0

Definition at line 39 of file unicode.c.

#define DEFINE_INIT   0

Definition at line 38 of file unicode.c.

#define EXTRA_LOOP_ARGS   , swap

Definition at line 75 of file unicode.c.

#define EXTRA_LOOP_DECLS   , int swap

Definition at line 208 of file unicode.c.

#define EXTRA_LOOP_DECLS   , int swap

Definition at line 208 of file unicode.c.

#define FROM_DIRECTION   (dir == from_unicode)

Definition at line 42 of file unicode.c.

#define FROM_LOOP   from_unicode_loop

Definition at line 36 of file unicode.c.

#define LOOP_NEED_FLAGS

Definition at line 207 of file unicode.c.

#define LOOP_NEED_FLAGS

Definition at line 207 of file unicode.c.

#define LOOPFCT   TO_LOOP

Definition at line 188 of file unicode.c.

#define LOOPFCT   FROM_LOOP

Definition at line 188 of file unicode.c.

#define MIN_NEEDED_FROM   2

Definition at line 40 of file unicode.c.

Definition at line 186 of file unicode.c.

Definition at line 186 of file unicode.c.

Definition at line 187 of file unicode.c.

Definition at line 187 of file unicode.c.

#define MIN_NEEDED_TO   4

Definition at line 41 of file unicode.c.

#define PREPARE_LOOP

Definition at line 43 of file unicode.c.

#define TO_LOOP   to_unicode_loop

Definition at line 37 of file unicode.c.


Enumeration Type Documentation

enum direction
Enumerator:
illegal_dir 
to_iso2022jp 
from_iso2022jp 
illegal_dir 
to_iso646 
from_iso646 
illegal_dir 
to_unicode 
from_unicode 
illegal_dir 
to_utf16 
from_utf16 
illegal_dir 
to_utf32 
from_utf32 

Definition at line 79 of file unicode.c.


Function Documentation

void gconv_end ( struct __gconv_step data)
int gconv_init ( struct __gconv_step step)