Ruby 2.0.0p247(2013-06-27revision41674)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
newline.c File Reference
`#include "transcode_data.h"`
Include dependency graph for newline.c:

Go to the source code of this file.

## Macros
#define | universal_newline_offsets 0
#define | crlf_newline_offsets 258
#define | universal_newline_infos WORDINDEX2INFO(0)
#define | universal_newline WORDINDEX2INFO(1)
#define | crlf_newline_infos WORDINDEX2INFO(3)
#define | crlf_newline WORDINDEX2INFO(5)
#define | cr_newline_infos WORDINDEX2INFO(7)
#define | cr_newline WORDINDEX2INFO(9)
#define | TRANSCODE_TABLE_INFO newline_byte_array, 516, newline_word_array, 11, ((int)sizeof(unsigned int))
#define | STATE (sp[0])
#define | NORMAL 0
#define | JUST_AFTER_CR 1
#define | NEWLINES_MET (sp[1])
#define | MET_LF 0x01
#define | MET_CRLF 0x02
#define | MET_CR 0x04

## Functions
static int | universal_newline_init (void *statep)
static ssize_t | fun_so_universal_newline (void *statep, const unsigned char *s, size_t l, unsigned char *o, size_t osize)
static ssize_t | universal_newline_finish (void *statep, unsigned char *o, size_t osize)
void | Init_newline (void)

## Variables
static const unsigned char | newline_byte_array [516]
static const unsigned int | newline_word_array [11]
static const rb_transcoder | rb_universal_newline
static const rb_transcoder | rb_crlf_newline
static const rb_transcoder | rb_cr_newline

## Macro Definition Documentation

#define cr_newline WORDINDEX2INFO(9)

#define cr_newline_infos WORDINDEX2INFO(7)

#define crlf_newline WORDINDEX2INFO(5)

#define crlf_newline_infos WORDINDEX2INFO(3)

#define crlf_newline_offsets 258

#define JUST_AFTER_CR 1

Definition at line 79 of file newline.c.

Referenced by fun_so_universal_newline(), and universal_newline_finish().

#define MET_CR 0x04

Definition at line 85 of file newline.c.

Referenced by fun_so_universal_newline(), and universal_newline_finish().

#define MET_CRLF 0x02

Definition at line 84 of file newline.c.

Referenced by fun_so_universal_newline().

#define MET_LF 0x01

Definition at line 83 of file newline.c.

Referenced by fun_so_universal_newline().

#define NEWLINES_MET (sp[1])

Definition at line 82 of file newline.c.

Referenced by fun_so_universal_newline(), universal_newline_finish(), and universal_newline_init().

#define NORMAL 0

Definition at line 78 of file newline.c.

Referenced by fun_so_universal_newline(), universal_newline_finish(), and universal_newline_init().

#define STATE (sp[0])

Definition at line 77 of file newline.c.

Referenced by fun_so_universal_newline(), universal_newline_finish(), and universal_newline_init().

#define TRANSCODE_TABLE_INFO newline_byte_array, 516, newline_word_array, 11, ((int)sizeof(unsigned int))

Definition at line 74 of file newline.c.

#define universal_newline WORDINDEX2INFO(1)

#define universal_newline_infos WORDINDEX2INFO(0)

#define universal_newline_offsets 0

## Function Documentation

static ssize_t fun_so_universal_newline | ( | void * | statep,
|  | const unsigned char * | s,
|  | size_t | l,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |
| static

Definition at line 97 of file newline.c.

References JUST_AFTER_CR, MET_CR, MET_CRLF, MET_LF, NEWLINES_MET, NORMAL, and STATE.

void Init_newline | ( | void | ) |  |

Definition at line 183 of file newline.c.

References rb_cr_newline, rb_crlf_newline, rb_register_transcoder(), and rb_universal_newline.

Referenced by Init_transcode().

static ssize_t universal_newline_finish | ( | void * | statep,
|  | unsigned char * | o,
|  | size_t | osize
| ) |  |
| static

Definition at line 132 of file newline.c.

References JUST_AFTER_CR, MET_CR, NEWLINES_MET, NORMAL, and STATE.

static int universal_newline_init | ( | void * | statep) |  |
| static

Definition at line 88 of file newline.c.

References NEWLINES_MET, NORMAL, and STATE.

## Variable Documentation

const unsigned char newline_byte_array[516]
| static

Definition at line 10 of file newline.c.

const unsigned int newline_word_array[11]
| static

Initial value:
= {
#define universal_newline_infos
FUNso,
#define universal_newline
universal_newline_offsets,
universal_newline_infos,
#define crlf_newline_infos
NOMAP, o2(0x0d,0x0a),
#define crlf_newline
crlf_newline_offsets,
crlf_newline_infos,
#define cr_newline_infos
NOMAP, o1(0x0d),
#define cr_newline
crlf_newline_offsets,
cr_newline_infos,
}

Definition at line 51 of file newline.c.

const rb_transcoder rb_cr_newline
| static

Initial value:
= {
"", "cr_newline", cr_newline,
TRANSCODE_TABLE_INFO,
1,
1,
1,
asciicompat_converter,
0, NULL, NULL,
NULL, NULL, NULL, NULL
}

Definition at line 171 of file newline.c.

Referenced by Init_newline().

const rb_transcoder rb_crlf_newline
| static

Initial value:
= {
"", "crlf_newline", crlf_newline,
TRANSCODE_TABLE_INFO,
1,
1,
2,
asciicompat_converter,
0, NULL, NULL,
NULL, NULL, NULL, NULL
}

Definition at line 159 of file newline.c.

Referenced by Init_newline().

const rb_transcoder rb_universal_newline
| static

Initial value:
= {
"", "universal_newline", universal_newline,
TRANSCODE_TABLE_INFO,
1,
1,
2,
asciicompat_converter,
2, universal_newline_init, universal_newline_init,
NULL, NULL, NULL, fun_so_universal_newline,
universal_newline_finish
}

Definition at line 146 of file newline.c.

Referenced by Init_newline().