Ruby 1.9.2p136(2010-12-25revision30365)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Defines | Functions | Variables

# enc/trans/iso2022.c File Reference

`#include "transcode_data.h"`
Include dependency graph for iso2022.c:

Go to the source code of this file.

## Defines
#define | iso2022jp_decoder_1B_24_offsets 0
#define | iso2022jp_decoder_1B_28_offsets 5
#define | iso2022jp_decoder_1B_offsets 16
#define | iso2022jp_decoder_offsets 23
#define | iso2022jp_decoder_jisx0208_rest_offsets 153
#define | iso2022jp_encoder_90_A1toFE_offsets 249
#define | iso2022jp_encoder_offsets 345
#define | eucjp_to_stateless_iso2022jp_offsets 494
#define | cp50221_decoder_1B_28_offsets 751
#define | cp50221_decoder_offsets 762
#define | cp50221_encoder_offsets 988
#define | iso2022jp_decoder_1B_24_infos WORDINDEX2INFO(0)
#define | iso2022jp_decoder_1B_24 WORDINDEX2INFO(2)
#define | iso2022jp_decoder_1B_28 WORDINDEX2INFO(4)
#define | iso2022jp_decoder_1B_infos WORDINDEX2INFO(6)
#define | iso2022jp_decoder_1B WORDINDEX2INFO(9)
#define | iso2022jp_decoder_infos WORDINDEX2INFO(11)
#define | iso2022jp_decoder WORDINDEX2INFO(14)
#define | iso2022jp_decoder_jisx0208_rest WORDINDEX2INFO(16)
#define | iso2022jp_encoder_90_A1toFE WORDINDEX2INFO(18)
#define | iso2022jp_encoder_90_infos WORDINDEX2INFO(20)
#define | iso2022jp_encoder_90 WORDINDEX2INFO(22)
#define | iso2022jp_encoder_infos WORDINDEX2INFO(24)
#define | iso2022jp_encoder WORDINDEX2INFO(27)
#define | stateless_iso2022jp_to_eucjp_infos WORDINDEX2INFO(29)
#define | stateless_iso2022jp_to_eucjp WORDINDEX2INFO(32)
#define | eucjp_to_stateless_iso2022jp_8E_infos WORDINDEX2INFO(34)
#define | eucjp_to_stateless_iso2022jp_8E WORDINDEX2INFO(36)
#define | eucjp_to_stateless_iso2022jp_8F_infos WORDINDEX2INFO(38)
#define | eucjp_to_stateless_iso2022jp_8F WORDINDEX2INFO(40)
#define | eucjp_to_stateless_iso2022jp_infos WORDINDEX2INFO(42)
#define | eucjp_to_stateless_iso2022jp WORDINDEX2INFO(48)
#define | cp50221_decoder_1B_28 WORDINDEX2INFO(50)
#define | cp50221_decoder_1B_infos WORDINDEX2INFO(52)
#define | cp50221_decoder_1B WORDINDEX2INFO(55)
#define | cp50221_decoder_infos WORDINDEX2INFO(57)
#define | cp50221_decoder WORDINDEX2INFO(61)
#define | cp50221_encoder_infos WORDINDEX2INFO(63)
#define | cp50221_encoder WORDINDEX2INFO(67)
#define | TRANSCODE_TABLE_INFO iso2022_byte_array, 1245, iso2022_word_array, 69, ((int)sizeof(unsigned int))
#define | G0_ASCII 0
#define | G0_JISX0208_1978 1
#define | G0_JISX0208_1983 2
#define | G0_JISX0201_KATAKANA 3
#define | EMACS_MULE_LEADING_CODE_JISX0208_1978 0220
#define | EMACS_MULE_LEADING_CODE_JISX0208_1983 0222
## Functions
static int | iso2022jp_init (void *statep)
static VALUE | fun_si_iso2022jp_decoder (void *statep, const unsigned char *s, size_t l)
static ssize_t | fun_so_iso2022jp_decoder (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_iso2022jp_encoder (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | iso2022jp_encoder_reset_sequence_size (void *statep)
static ssize_t | finish_iso2022jp_encoder (void *statep, unsigned char *o, size_t osize)
static ssize_t | fun_so_stateless_iso2022jp_to_eucjp (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_eucjp_to_stateless_iso2022jp (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static VALUE | fun_si_cp50221_decoder (void *statep, const unsigned char *s, size_t l)
static ssize_t | fun_so_cp50221_decoder (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_cp5022x_encoder (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | fun_so_cp50220_encoder (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | finish_cp50220_encoder (void *statep, unsigned char *o, size_t osize)
void | Init_iso2022 (void)
## Variables
static const unsigned char | iso2022_byte_array [1245]
static const unsigned int | iso2022_word_array [69]
static const rb_transcoder | rb_iso2022jp_decoder
static const rb_transcoder | rb_iso2022jp_encoder
static const rb_transcoder | rb_stateless_iso2022jp_to_eucjp
static const rb_transcoder | rb_eucjp_to_stateless_iso2022jp
static const rb_transcoder | rb_cp50220_decoder
static const rb_transcoder | rb_cp50221_decoder
static const rb_transcoder | rb_cp50221_encoder
static const char * | tbl0208 = "\x25\x6B\x25\x6C\x25\x6D\x25\x6F\x25\x73\x21\x2B\x21\x2C"
static const rb_transcoder | rb_cp50220_encoder

## Define Documentation

#define cp50221_decoder WORDINDEX2INFO(61)

#define cp50221_decoder_1B WORDINDEX2INFO(55)

#define cp50221_decoder_1B_28 WORDINDEX2INFO(50)

#define cp50221_decoder_1B_28_offsets 751

#define cp50221_decoder_1B_infos WORDINDEX2INFO(52)

#define cp50221_decoder_infos WORDINDEX2INFO(57)

#define cp50221_decoder_offsets 762

#define cp50221_encoder WORDINDEX2INFO(67)

#define cp50221_encoder_infos WORDINDEX2INFO(63)

#define cp50221_encoder_offsets 988

#define EMACS_MULE_LEADING_CODE_JISX0208_1978 0220

Definition at line 246 of file iso2022.c.

Referenced by fun_so_iso2022jp_decoder(), and fun_so_iso2022jp_encoder().

#define EMACS_MULE_LEADING_CODE_JISX0208_1983 0222

Definition at line 247 of file iso2022.c.

Referenced by fun_so_eucjp_to_stateless_iso2022jp(), and fun_so_iso2022jp_decoder().

#define eucjp_to_stateless_iso2022jp WORDINDEX2INFO(48)

#define eucjp_to_stateless_iso2022jp_8E WORDINDEX2INFO(36)

#define eucjp_to_stateless_iso2022jp_8E_infos WORDINDEX2INFO(34)

#define eucjp_to_stateless_iso2022jp_8F WORDINDEX2INFO(40)

#define eucjp_to_stateless_iso2022jp_8F_infos WORDINDEX2INFO(38)

#define eucjp_to_stateless_iso2022jp_infos WORDINDEX2INFO(42)

#define eucjp_to_stateless_iso2022jp_offsets 494

#define G0_ASCII 0

Definition at line 240 of file iso2022.c.

Referenced by finish_cp50220_encoder(), finish_iso2022jp_encoder(), fun_si_cp50221_decoder(), fun_si_iso2022jp_decoder(), fun_so_cp50221_decoder(), fun_so_cp5022x_encoder(), fun_so_iso2022jp_decoder(), fun_so_iso2022jp_encoder(), iso2022jp_encoder_reset_sequence_size(), and iso2022jp_init().

#define G0_JISX0201_KATAKANA 3

Definition at line 244 of file iso2022.c.

Referenced by finish_cp50220_encoder(), fun_si_cp50221_decoder(), fun_so_cp50220_encoder(), fun_so_cp50221_decoder(), and fun_so_cp5022x_encoder().

#define G0_JISX0208_1978 1

Definition at line 242 of file iso2022.c.

Referenced by fun_si_cp50221_decoder(), fun_so_cp50221_decoder(), fun_so_iso2022jp_decoder(), and fun_so_iso2022jp_encoder().

#define G0_JISX0208_1983 2

Definition at line 243 of file iso2022.c.

Referenced by finish_cp50220_encoder(), fun_si_cp50221_decoder(), fun_so_cp50220_encoder(), fun_so_cp50221_decoder(), fun_so_cp5022x_encoder(), fun_so_iso2022jp_decoder(), and fun_so_iso2022jp_encoder().

#define iso2022jp_decoder WORDINDEX2INFO(14)

#define iso2022jp_decoder_1B WORDINDEX2INFO(9)

#define iso2022jp_decoder_1B_24 WORDINDEX2INFO(2)

#define iso2022jp_decoder_1B_24_infos WORDINDEX2INFO(0)

#define iso2022jp_decoder_1B_24_offsets 0

#define iso2022jp_decoder_1B_28 WORDINDEX2INFO(4)

#define iso2022jp_decoder_1B_28_offsets 5

#define iso2022jp_decoder_1B_infos WORDINDEX2INFO(6)

#define iso2022jp_decoder_1B_offsets 16

#define iso2022jp_decoder_infos WORDINDEX2INFO(11)

#define iso2022jp_decoder_jisx0208_rest WORDINDEX2INFO(16)

Referenced by fun_si_cp50221_decoder(), and fun_si_iso2022jp_decoder().

#define iso2022jp_decoder_jisx0208_rest_offsets 153

#define iso2022jp_decoder_offsets 23

#define iso2022jp_encoder WORDINDEX2INFO(27)

#define iso2022jp_encoder_90 WORDINDEX2INFO(22)

#define iso2022jp_encoder_90_A1toFE WORDINDEX2INFO(18)

#define iso2022jp_encoder_90_A1toFE_offsets 249

#define iso2022jp_encoder_90_infos WORDINDEX2INFO(20)

#define iso2022jp_encoder_infos WORDINDEX2INFO(24)

#define iso2022jp_encoder_offsets 345

#define stateless_iso2022jp_to_eucjp WORDINDEX2INFO(32)

#define stateless_iso2022jp_to_eucjp_infos WORDINDEX2INFO(29)

#define TRANSCODE_TABLE_INFO iso2022_byte_array, 1245, iso2022_word_array, 69, ((int)sizeof(unsigned int))

Definition at line 237 of file iso2022.c.

## Function Documentation

static ssize_t finish_cp50220_encoder | ( | void * | statep,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 688 of file iso2022.c.

References G0_ASCII, G0_JISX0201_KATAKANA, G0_JISX0208_1983, and tbl0208.

static ssize_t finish_iso2022jp_encoder | ( | void * | statep,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 372 of file iso2022.c.

References G0_ASCII.

static VALUE fun_si_cp50221_decoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l
| ) |  | `[static]`

Definition at line 444 of file iso2022.c.

References FUNso, G0_ASCII, G0_JISX0201_KATAKANA, G0_JISX0208_1978, G0_JISX0208_1983, INVALID, iso2022jp_decoder_jisx0208_rest, and NOMAP.

static VALUE fun_si_iso2022jp_decoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l
| ) |  | `[static]`

Definition at line 258 of file iso2022.c.

References G0_ASCII, INVALID, iso2022jp_decoder_jisx0208_rest, and NOMAP.

static ssize_t fun_so_cp50220_encoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 632 of file iso2022.c.

References fun_so_cp5022x_encoder(), G0_JISX0201_KATAKANA, G0_JISX0208_1983, and tbl0208.

static ssize_t fun_so_cp50221_decoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 475 of file iso2022.c.

References G0_ASCII, G0_JISX0201_KATAKANA, G0_JISX0208_1978, and G0_JISX0208_1983.

static ssize_t fun_so_cp5022x_encoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 560 of file iso2022.c.

References G0_ASCII, G0_JISX0201_KATAKANA, and G0_JISX0208_1983.

Referenced by fun_so_cp50220_encoder().

static ssize_t fun_so_eucjp_to_stateless_iso2022jp | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 423 of file iso2022.c.

References EMACS_MULE_LEADING_CODE_JISX0208_1983.

static ssize_t fun_so_iso2022jp_decoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 270 of file iso2022.c.

References EMACS_MULE_LEADING_CODE_JISX0208_1978, EMACS_MULE_LEADING_CODE_JISX0208_1983, G0_ASCII, G0_JISX0208_1978, and G0_JISX0208_1983.

static ssize_t fun_so_iso2022jp_encoder | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 319 of file iso2022.c.

References EMACS_MULE_LEADING_CODE_JISX0208_1978, G0_ASCII, G0_JISX0208_1978, and G0_JISX0208_1983.

static ssize_t fun_so_stateless_iso2022jp_to_eucjp | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  | `[static]`

Definition at line 403 of file iso2022.c.

void Init_iso2022 | ( | void |  | ) |

Definition at line 732 of file iso2022.c.

References rb_cp50220_decoder, rb_cp50220_encoder, rb_cp50221_decoder, rb_cp50221_encoder, rb_eucjp_to_stateless_iso2022jp, rb_iso2022jp_decoder, rb_iso2022jp_encoder, rb_register_transcoder(), and rb_stateless_iso2022jp_to_eucjp.

static ssize_t iso2022jp_encoder_reset_sequence_size | ( | void * | statep | ) | `[static]`

Definition at line 363 of file iso2022.c.

References G0_ASCII.

static int iso2022jp_init | ( | void * | statep | ) | `[static]`

Definition at line 250 of file iso2022.c.

References G0_ASCII.

## Variable Documentation

const unsigned char iso2022_byte_array[1245]`[static]`

Definition at line 10 of file iso2022.c.

const unsigned int iso2022_word_array[69]`[static]`

Definition at line 126 of file iso2022.c.

const rb_transcoder rb_cp50220_decoder`[static]`

Initial value:

     {
        "CP50220", "cp51932", cp50221_decoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        3,
        asciicompat_decoder,
        1, iso2022jp_init, iso2022jp_init,
        NULL, fun_si_cp50221_decoder, NULL, fun_so_cp50221_decoder
    }

Definition at line 536 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_cp50220_encoder`[static]`

Initial value:

     {
        "CP51932", "CP50220", cp50221_encoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        5,
        asciicompat_encoder,
        3, iso2022jp_init, iso2022jp_init,
        NULL, NULL, NULL, fun_so_cp50220_encoder,
        finish_cp50220_encoder,
        iso2022jp_encoder_reset_sequence_size, finish_cp50220_encoder
    }

Definition at line 718 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_cp50221_decoder`[static]`

Initial value:

     {
        "CP50221", "cp51932", cp50221_decoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        3,
        asciicompat_decoder,
        1, iso2022jp_init, iso2022jp_init,
        NULL, fun_si_cp50221_decoder, NULL, fun_so_cp50221_decoder
    }

Definition at line 548 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_cp50221_encoder`[static]`

Initial value:

     {
        "CP51932", "CP50221", cp50221_encoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        5,
        asciicompat_encoder,
        1, iso2022jp_init, iso2022jp_init,
        NULL, NULL, NULL, fun_so_cp5022x_encoder,
        finish_iso2022jp_encoder,
        iso2022jp_encoder_reset_sequence_size, finish_iso2022jp_encoder
    }

Definition at line 608 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_eucjp_to_stateless_iso2022jp`[static]`

Initial value:

     {
        "EUC-JP", "stateless-ISO-2022-JP", eucjp_to_stateless_iso2022jp,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        3,
        asciicompat_converter,
        0, NULL, NULL,
        NULL, NULL, NULL, fun_so_eucjp_to_stateless_iso2022jp,
    }

Definition at line 432 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_iso2022jp_decoder`[static]`

Initial value:

     {
        "ISO-2022-JP", "stateless-ISO-2022-JP", iso2022jp_decoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        3,
        asciicompat_decoder,
        1, iso2022jp_init, iso2022jp_init,
        NULL, fun_si_iso2022jp_decoder, NULL, fun_so_iso2022jp_decoder
    }

Definition at line 307 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_iso2022jp_encoder`[static]`

Initial value:

     {
        "stateless-ISO-2022-JP", "ISO-2022-JP", iso2022jp_encoder,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        5,
        asciicompat_encoder,
        1, iso2022jp_init, iso2022jp_init,
        NULL, NULL, NULL, fun_so_iso2022jp_encoder,
        finish_iso2022jp_encoder,
        iso2022jp_encoder_reset_sequence_size, finish_iso2022jp_encoder
    }

Definition at line 389 of file iso2022.c.

Referenced by Init_iso2022().

const rb_transcoder rb_stateless_iso2022jp_to_eucjp`[static]`

Initial value:

     {
        "stateless-ISO-2022-JP", "EUC-JP", stateless_iso2022jp_to_eucjp,
        TRANSCODE_TABLE_INFO,
        1,
        3,
        2,
        asciicompat_converter,
        0, NULL, NULL,
        NULL, NULL, NULL, fun_so_stateless_iso2022jp_to_eucjp,
    }

Definition at line 411 of file iso2022.c.

Referenced by Init_iso2022().

const char* tbl0208 = "\x25\x6B\x25\x6C\x25\x6D\x25\x6F\x25\x73\x21\x2B\x21\x2C"`[static]`

Definition at line 621 of file iso2022.c.

Referenced by finish_cp50220_encoder(), and fun_so_cp50220_encoder().