Ruby
2.5.0dev(2017-10-22revision60238)
|
Go to the source code of this file.
Data Structures | |
struct | nkf_native_encoding |
struct | nkf_encoding |
struct | input_code |
struct | nkf_buf_t |
struct | nkf_state_t |
Macros | |
#define | NKF_VERSION "2.1.4" |
#define | NKF_RELEASE_DATE "2015-12-12" |
#define | COPY_RIGHT |
#define | FIXED_MIME 7 |
#define | STRICT_MIME 8 |
#define | BS 0x08 |
#define | TAB 0x09 |
#define | LF 0x0a |
#define | CR 0x0d |
#define | ESC 0x1b |
#define | SP 0x20 |
#define | DEL 0x7f |
#define | SI 0x0f |
#define | SO 0x0e |
#define | SS2 0x8e |
#define | SS3 0x8f |
#define | CRLF 0x0D0A |
#define | is_alnum(c) (('a'<=c && c<='z')||('A'<= c && c<='Z')||('0'<=c && c<='9')) |
#define | nkf_toupper(c) (('a'<=c && c<='z')?(c-('a'-'A')):c) |
#define | nkf_isoctal(c) ('0'<=c && c<='7') |
#define | nkf_isdigit(c) ('0'<=c && c<='9') |
#define | nkf_isxdigit(c) (nkf_isdigit(c) || ('a'<=c && c<='f') || ('A'<=c && c <= 'F')) |
#define | nkf_isblank(c) (c == SP || c == TAB) |
#define | nkf_isspace(c) (nkf_isblank(c) || c == CR || c == LF) |
#define | nkf_isalpha(c) (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) |
#define | nkf_isalnum(c) (nkf_isdigit(c) || nkf_isalpha(c)) |
#define | nkf_isprint(c) (SP<=c && c<='~') |
#define | nkf_isgraph(c) ('!'<=c && c<='~') |
#define | hex2bin(c) |
#define | bin2hex(c) ("0123456789ABCDEF"[c&15]) |
#define | is_eucg3(c2) (((unsigned short)c2 >> 8) == SS3) |
#define | nkf_noescape_mime(c) |
#define | is_ibmext_in_sjis(c2) (CP932_TABLE_BEGIN <= c2 && c2 <= CP932_TABLE_END) |
#define | nkf_byte_jisx0201_katakana_p(c) (SP <= c && c <= 0x5F) |
#define | HOLD_SIZE 1024 |
#define | IOBUF_SIZE 16384 |
#define | DEFAULT_J 'B' |
#define | DEFAULT_R 'B' |
#define | GETA1 0x22 |
#define | GETA2 0x2e |
#define | UCS_MAP_ASCII 0 |
#define | UCS_MAP_MS 1 |
#define | UCS_MAP_CP932 2 |
#define | UCS_MAP_CP10001 3 |
#define | NKF_UNSPECIFIED (-TRUE) |
#define | PREFIX_EUCG3 NKF_INT32_C(0x8F00) |
#define | CLASS_MASK NKF_INT32_C(0xFF000000) |
#define | CLASS_UNICODE NKF_INT32_C(0x01000000) |
#define | VALUE_MASK NKF_INT32_C(0x00FFFFFF) |
#define | UNICODE_BMP_MAX NKF_INT32_C(0x0000FFFF) |
#define | UNICODE_MAX NKF_INT32_C(0x0010FFFF) |
#define | nkf_char_euc3_new(c) ((c) | PREFIX_EUCG3) |
#define | nkf_char_unicode_new(c) ((c) | CLASS_UNICODE) |
#define | nkf_char_unicode_p(c) ((c & CLASS_MASK) == CLASS_UNICODE) |
#define | nkf_char_unicode_bmp_p(c) ((c & VALUE_MASK) <= UNICODE_BMP_MAX) |
#define | nkf_char_unicode_value_p(c) ((c & VALUE_MASK) <= UNICODE_MAX) |
#define | UTF16_TO_UTF32(lead, trail) (((lead) << 10) + (trail) - NKF_INT32_C(0x35FDC00)) |
#define | FOLD_MARGIN 10 |
#define | DEFAULT_FOLD 60 |
#define | nkf_xfree(ptr) free(ptr) |
#define | nkf_enc_name(enc) (enc)->name |
#define | nkf_enc_to_index(enc) (enc)->id |
#define | nkf_enc_to_base_encoding(enc) (enc)->base_encoding |
#define | nkf_enc_to_iconv(enc) nkf_enc_to_base_encoding(enc)->iconv |
#define | nkf_enc_to_oconv(enc) nkf_enc_to_base_encoding(enc)->oconv |
#define | nkf_enc_asciicompat(enc) |
#define | nkf_enc_unicode_p(enc) |
#define | nkf_enc_cp5022x_p(enc) |
#define | nkf_buf_length(buf) ((buf)->len) |
#define | nkf_buf_empty_p(buf) ((buf)->len == 0) |
#define | SJ0162 0x00e1 /* 01 - 62 ku offset */ |
#define | SJ6394 0x0161 /* 63 - 94 ku offset */ |
#define | X0213_SURROGATE_FIND(tbl, size, euc) |
#define | NKF_ICONV_INVALID_CODE_RANGE -13 |
#define | NKF_ICONV_WAIT_COMBINING_CHAR -14 |
#define | NKF_ICONV_NOT_COMBINED -15 |
#define | NKF_ICONV_NEED_ONE_MORE_BYTE (size_t)-1 |
#define | NKF_ICONV_NEED_TWO_MORE_BYTES (size_t)-2 |
#define | output_ascii_escape_sequence(mode) |
#define | OUTPUT_UTF8(val) |
#define | OUTPUT_UTF16_BYTES(c1, c2) |
#define | OUTPUT_UTF16(val) |
#define | OUTPUT_UTF32(c) |
#define | SCORE_L2 (1) /* Kanji Level 2 */ |
#define | SCORE_KANA (SCORE_L2 << 1) /* Halfwidth Katakana */ |
#define | SCORE_DEPEND (SCORE_KANA << 1) /* MD Characters */ |
#define | SCORE_CP932 (SCORE_DEPEND << 1) /* IBM extended characters */ |
#define | SCORE_X0212 (SCORE_CP932 << 1) /* JIS X 0212 */ |
#define | SCORE_X0213 (SCORE_X0212 << 1) /* JIS X 0213 */ |
#define | SCORE_NO_EXIST (SCORE_X0213 << 1) /* Undefined Characters */ |
#define | SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME selected */ |
#define | SCORE_ERROR (SCORE_iMIME << 1) /* Error */ |
#define | SCORE_INIT (SCORE_iMIME) |
#define | STD_GC_BUFSIZE (256) |
#define | char_size(c2, c1) (c2?2:1) |
#define | rot13(c) |
#define | rot47(c) |
#define | RANGE_NUM_MAX 18 |
#define | MIME_BUF_SIZE (1024) /* 2^n ring buffer */ |
#define | MIME_BUF_MASK (MIME_BUF_SIZE-1) |
#define | mime_input_buf(n) mime_input_state.buf[(n)&MIME_BUF_MASK] |
#define | MAXRECOVER 20 |
#define | MIMEOUT_BUF_LENGTH 74 |
#define | NEXT continue /* no output, get next */ |
#define | SKIP c2=0;continue /* no output, get next */ |
#define | MORE c2=c1;continue /* need one more byte */ |
#define | SEND (void)0 /* output c1 and c2, get next */ |
#define | LAST break /* end of loop, go closing */ |
#define | set_input_mode(mode) |
Enumerations | |
enum | byte_order { ENDIAN_BIG = 1, ENDIAN_LITTLE = 2, ENDIAN_2143 = 3, ENDIAN_3412 = 4 } |
enum | nkf_encodings { ASCII, ISO_8859_1, ISO_2022_JP, CP50220, CP50221, CP50222, ISO_2022_JP_1, ISO_2022_JP_3, ISO_2022_JP_2004, SHIFT_JIS, WINDOWS_31J, CP10001, EUC_JP, EUCJP_NKF, CP51932, EUCJP_MS, EUCJP_ASCII, SHIFT_JISX0213, SHIFT_JIS_2004, EUC_JISX0213, EUC_JIS_2004, UTF_8, UTF_8N, UTF_8_BOM, UTF8_MAC, UTF_16, UTF_16BE, UTF_16BE_BOM, UTF_16LE, UTF_16LE_BOM, UTF_32, UTF_32BE, UTF_32BE_BOM, UTF_32LE, UTF_32LE_BOM, BINARY, NKF_ENCODING_TABLE_SIZE, JIS_X_0201_1976_K = 0x1013, JIS_X_0208 = 0x1168, JIS_X_0212 = 0x1159, JIS_X_0213_2 = 0x1229, JIS_X_0213_1 = 0x1233 } |
Functions | |
int | main (int argc, char **argv) |
Variables | |
nkf_native_encoding | NkfEncodingASCII = { "ASCII", e_iconv, e_oconv } |
nkf_native_encoding | NkfEncodingISO_2022_JP = { "ISO-2022-JP", e_iconv, j_oconv } |
nkf_native_encoding | NkfEncodingShift_JIS = { "Shift_JIS", s_iconv, s_oconv } |
nkf_native_encoding | NkfEncodingEUC_JP = { "EUC-JP", e_iconv, e_oconv } |
nkf_native_encoding | NkfEncodingUTF_8 = { "UTF-8", w_iconv, w_oconv } |
nkf_native_encoding | NkfEncodingUTF_16 = { "UTF-16", w_iconv16, w_oconv16 } |
nkf_native_encoding | NkfEncodingUTF_32 = { "UTF-32", w_iconv32, w_oconv32 } |
nkf_encoding | nkf_encoding_table [] |
struct { | |
const char * name | |
const int id | |
} | encoding_name_to_id_table [] |
struct input_code | input_code_list [] |
nkf_char(* | mime_priority_func [])(nkf_char c2, nkf_char c1, nkf_char c0) |
#define CLASS_MASK NKF_INT32_C(0xFF000000) |
#define CLASS_UNICODE NKF_INT32_C(0x01000000) |
#define COPY_RIGHT |
#define hex2bin | ( | c | ) |
#define is_alnum | ( | c | ) | (('a'<=c && c<='z')||('A'<= c && c<='Z')||('0'<=c && c<='9')) |
#define is_ibmext_in_sjis | ( | c2 | ) | (CP932_TABLE_BEGIN <= c2 && c2 <= CP932_TABLE_END) |
#define MIME_BUF_MASK (MIME_BUF_SIZE-1) |
#define mime_input_buf | ( | n | ) | mime_input_state.buf[(n)&MIME_BUF_MASK] |
#define nkf_byte_jisx0201_katakana_p | ( | c | ) | (SP <= c && c <= 0x5F) |
#define nkf_char_euc3_new | ( | c | ) | ((c) | PREFIX_EUCG3) |
#define nkf_char_unicode_bmp_p | ( | c | ) | ((c & VALUE_MASK) <= UNICODE_BMP_MAX) |
#define nkf_char_unicode_new | ( | c | ) | ((c) | CLASS_UNICODE) |
#define nkf_char_unicode_p | ( | c | ) | ((c & CLASS_MASK) == CLASS_UNICODE) |
#define nkf_char_unicode_value_p | ( | c | ) | ((c & VALUE_MASK) <= UNICODE_MAX) |
#define nkf_enc_asciicompat | ( | enc | ) |
#define nkf_enc_cp5022x_p | ( | enc | ) |
#define nkf_enc_to_iconv | ( | enc | ) | nkf_enc_to_base_encoding(enc)->iconv |
#define nkf_enc_to_oconv | ( | enc | ) | nkf_enc_to_base_encoding(enc)->oconv |
#define nkf_enc_unicode_p | ( | enc | ) |
#define nkf_isalnum | ( | c | ) | (nkf_isdigit(c) || nkf_isalpha(c)) |
#define nkf_isalpha | ( | c | ) | (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) |
#define nkf_isspace | ( | c | ) | (nkf_isblank(c) || c == CR || c == LF) |
#define nkf_isxdigit | ( | c | ) | (nkf_isdigit(c) || ('a'<=c && c<='f') || ('A'<=c && c <= 'F')) |
#define nkf_noescape_mime | ( | c | ) |
#define output_ascii_escape_sequence | ( | mode | ) |
#define OUTPUT_UTF16 | ( | val | ) |
#define OUTPUT_UTF16_BYTES | ( | c1, | |
c2 | |||
) |
#define OUTPUT_UTF32 | ( | c | ) |
#define OUTPUT_UTF8 | ( | val | ) |
#define PREFIX_EUCG3 NKF_INT32_C(0x8F00) |
#define RANGE_NUM_MAX 18 |
#define rot13 | ( | c | ) |
#define rot47 | ( | c | ) |
#define SCORE_CP932 (SCORE_DEPEND << 1) /* IBM extended characters */ |
#define SCORE_DEPEND (SCORE_KANA << 1) /* MD Characters */ |
#define SCORE_ERROR (SCORE_iMIME << 1) /* Error */ |
#define SCORE_iMIME (SCORE_NO_EXIST << 1) /* MIME selected */ |
#define SCORE_INIT (SCORE_iMIME) |
#define SCORE_NO_EXIST (SCORE_X0213 << 1) /* Undefined Characters */ |
#define SCORE_X0212 (SCORE_CP932 << 1) /* JIS X 0212 */ |
#define SCORE_X0213 (SCORE_X0212 << 1) /* JIS X 0213 */ |
#define set_input_mode | ( | mode | ) |
#define SJ0162 0x00e1 /* 01 - 62 ku offset */ |
#define SJ6394 0x0161 /* 63 - 94 ku offset */ |
#define UNICODE_BMP_MAX NKF_INT32_C(0x0000FFFF) |
#define UNICODE_MAX NKF_INT32_C(0x0010FFFF) |
#define UTF16_TO_UTF32 | ( | lead, | |
trail | |||
) | (((lead) << 10) + (trail) - NKF_INT32_C(0x35FDC00)) |
#define VALUE_MASK NKF_INT32_C(0x00FFFFFF) |
#define X0213_SURROGATE_FIND | ( | tbl, | |
size, | |||
euc | |||
) |
enum byte_order |
enum nkf_encodings |
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 6921 of file nkf.c.
Referenced by nl_langinfo_codeset(), and rb_parser_set_context().
const char* alias |
Definition at line 1151 of file nkf.c.
Referenced by Init_enc_set_filesystem_encoding().
unsigned char buf[MIMEOUT_BUF_LENGTH+1] |
Definition at line 4309 of file nkf.c.
Referenced by dln_load(), nl_langinfo_codeset(), onig_node_free(), onig_node_str_cat(), onig_node_str_clear(), onigenc_mb2_code_to_mbc(), onigenc_mb4_code_to_mbc(), ossl_membio2str(), rb_clock_gettime(), rb_cstr_to_dbl(), rb_file_expand_path_internal(), rb_fix2str(), rb_pipe(), rb_print_backtrace(), rb_reg_check_preprocess(), rb_str_buf_cat_ascii(), rb_str_concat(), rb_str_escape(), rb_str_format(), rb_str_inspect(), rb_vm_bugreport(), rb_vmdebug_stack_dump_all_threads(), reg_enum_key(), ruby_getcwd(), ruby_setenv(), and VpAlloc().
int count |
Definition at line 5042 of file nkf.c.
Referenced by nkf_split_options().
struct { ... } encoding_name_to_id_table[] |
const int id |
Definition at line 209 of file nkf.c.
Referenced by rb_cvar_get(), rb_cvar_set(), rb_define_class(), rb_define_module(), rb_deprecate_constant(), rb_execarg_addopt(), rb_f_untrace_var(), rb_global_entry(), rb_mod_remove_cvar(), rb_obj_remove_instance_variable(), rb_path_to_class(), rb_str_intern(), rb_sym2id(), rb_sym_to_proc(), rsock_ipaddr(), rsock_revlookup_flag(), and ruby_debug_print_id().
struct input_code input_code_list[] |
unsigned int last |
Definition at line 4311 of file nkf.c.
Referenced by rb_enc_path_last_separator(), rb_scan_args(), ruby_enc_find_extname(), and sip_hash13().
const char* name |
Definition at line 208 of file nkf.c.
Referenced by create_win32ole_variable(), GetX509NamePtr(), Init_enc_set_filesystem_encoding(), onigenc_with_ascii_strnicmp(), ossl_evp_get_digestbyname(), rb_builtin_type_name(), rb_check_id(), rb_check_symbol(), rb_file_dirname(), rb_freopen(), rb_locale_charmap(), rb_reg_regsub(), rb_to_symbol(), rb_vm_bugreport(), rb_w32_pipe(), rsock_intern_family(), rsock_intern_family_noprefix(), rsock_intern_ip_optname(), rsock_intern_iplevel(), rsock_intern_ipproto(), rsock_intern_ipv6_optname(), rsock_intern_local_optname(), rsock_intern_protocol_family(), rsock_intern_scm_optname(), rsock_intern_so_optname(), rsock_intern_socktype(), rsock_intern_tcp_optname(), rsock_intern_udp_optname(), ruby_enc_find_basename(), ruby_enc_find_extname(), and ruby_th_dtrace_setup().
nkf_encoding nkf_encoding_table[] |
nkf_native_encoding NkfEncodingASCII = { "ASCII", e_iconv, e_oconv } |
nkf_native_encoding NkfEncodingEUC_JP = { "EUC-JP", e_iconv, e_oconv } |
nkf_native_encoding NkfEncodingISO_2022_JP = { "ISO-2022-JP", e_iconv, j_oconv } |
nkf_native_encoding NkfEncodingShift_JIS = { "Shift_JIS", s_iconv, s_oconv } |
nkf_native_encoding NkfEncodingUTF_16 = { "UTF-16", w_iconv16, w_oconv16 } |
nkf_native_encoding NkfEncodingUTF_32 = { "UTF-32", w_iconv32, w_oconv32 } |
nkf_native_encoding NkfEncodingUTF_8 = { "UTF-8", w_iconv, w_oconv } |
unsigned int top |
Definition at line 4310 of file nkf.c.
Referenced by getaddrinfo(), and rb_ary_shift().