Back to index

glibc  2.9
Defines | Functions | Variables
utf-7.c File Reference
#include <dlfcn.h>
#include <gconv.h>
#include <stdint.h>
#include <stdlib.h>
#include <iconv/loop.c>
#include <iconv/skeleton.c>

Go to the source code of this file.

Defines

#define UTF7_ENCODE_OPTIONAL_CHARS   1
#define CHARSET_NAME   "UTF-7//"
#define DEFINE_INIT   1
#define DEFINE_FINI   1
#define FROM_LOOP   from_utf7_loop
#define TO_LOOP   to_utf7_loop
#define MIN_NEEDED_FROM   1
#define MAX_NEEDED_FROM   6
#define MIN_NEEDED_TO   4
#define MAX_NEEDED_TO   4
#define PREPARE_LOOP
#define EXTRA_LOOP_ARGS   , statep
#define SAVE_RESET_STATE(Save)
#define MIN_NEEDED_INPUT   MIN_NEEDED_FROM
#define MAX_NEEDED_INPUT   MAX_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 EXTRA_LOOP_DECLS   , mbstate_t *statep
#define MIN_NEEDED_INPUT   MIN_NEEDED_TO
#define MAX_NEEDED_INPUT   MAX_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
#define EXTRA_LOOP_DECLS   , mbstate_t *statep
#define EMIT_SHIFT_TO_INIT

Functions

static int isdirect (uint32_t ch)
static int isxdirect (uint32_t ch)
static int isxbase64 (uint32_t ch)
static unsigned char base64 (unsigned int i)

Variables

static const unsigned char direct_tab [128/8]
static const unsigned char xdirect_tab [128/8]
static const unsigned char xbase64_tab [128/8]

Define Documentation

#define BODY

Definition at line 318 of file utf-7.c.

#define BODY

Definition at line 318 of file utf-7.c.

#define CHARSET_NAME   "UTF-7//"

Definition at line 115 of file utf-7.c.

#define DEFINE_FINI   1

Definition at line 117 of file utf-7.c.

#define DEFINE_INIT   1

Definition at line 116 of file utf-7.c.

Definition at line 495 of file utf-7.c.

#define EXTRA_LOOP_ARGS   , statep

Definition at line 127 of file utf-7.c.

Definition at line 488 of file utf-7.c.

Definition at line 488 of file utf-7.c.

#define FROM_LOOP   from_utf7_loop

Definition at line 118 of file utf-7.c.

#define LOOP_NEED_FLAGS

Definition at line 487 of file utf-7.c.

#define LOOP_NEED_FLAGS

Definition at line 487 of file utf-7.c.

#define LOOPFCT   FROM_LOOP

Definition at line 317 of file utf-7.c.

#define LOOPFCT   TO_LOOP

Definition at line 317 of file utf-7.c.

#define MAX_NEEDED_FROM   6

Definition at line 121 of file utf-7.c.

Definition at line 314 of file utf-7.c.

Definition at line 314 of file utf-7.c.

Definition at line 316 of file utf-7.c.

Definition at line 316 of file utf-7.c.

#define MAX_NEEDED_TO   4

Definition at line 123 of file utf-7.c.

#define MIN_NEEDED_FROM   1

Definition at line 120 of file utf-7.c.

Definition at line 313 of file utf-7.c.

Definition at line 313 of file utf-7.c.

Definition at line 315 of file utf-7.c.

Definition at line 315 of file utf-7.c.

#define MIN_NEEDED_TO   4

Definition at line 122 of file utf-7.c.

#define PREPARE_LOOP
Value:
mbstate_t saved_state;                                               \
  mbstate_t *statep = data->__statep;

Definition at line 124 of file utf-7.c.

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

Definition at line 132 of file utf-7.c.

#define TO_LOOP   to_utf7_loop

Definition at line 119 of file utf-7.c.

Definition at line 40 of file utf-7.c.


Function Documentation

static unsigned char base64 ( unsigned int  i) [static]

Definition at line 97 of file utf-7.c.

{
  if (i < 26)
    return i + 'A';
  else if (i < 52)
    return i - 26 + 'a';
  else if (i < 62)
    return i - 52 + '0';
  else if (i == 62)
    return '+';
  else if (i == 63)
    return '/';
  else
    abort ();
}

Here is the call graph for this function:

static int isdirect ( uint32_t  ch) [static]

Definition at line 54 of file utf-7.c.

{
  return (ch < 128 && ((direct_tab[ch >> 3] >> (ch & 7)) & 1));
}
static int isxbase64 ( uint32_t  ch) [static]

Definition at line 89 of file utf-7.c.

{
  return (ch < 128 && ((xbase64_tab[ch >> 3] >> (ch & 7)) & 1));
}
static int isxdirect ( uint32_t  ch) [static]

Definition at line 72 of file utf-7.c.

{
  return (ch < 128 && ((xdirect_tab[ch >> 3] >> (ch & 7)) & 1));
}

Variable Documentation

const unsigned char direct_tab[128/8] [static]
Initial value:
  {
    0x00, 0x26, 0x00, 0x00, 0x81, 0xf3, 0xff, 0x87,
    0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07
  }

Definition at line 47 of file utf-7.c.

const unsigned char xbase64_tab[128/8] [static]
Initial value:
  {
    0x00, 0x00, 0x00, 0x00, 0x00, 0xa8, 0xff, 0x03,
    0xfe, 0xff, 0xff, 0x07, 0xfe, 0xff, 0xff, 0x07
  }

Definition at line 82 of file utf-7.c.

const unsigned char xdirect_tab[128/8] [static]
Initial value:
  {
    0x00, 0x26, 0x00, 0x00, 0xff, 0xf7, 0xff, 0xff,
    0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0x3f
  }

Definition at line 65 of file utf-7.c.