include/ruby/encoding.h File Reference

#include <stdarg.h>
#include "ruby/oniguruma.h"

Go to the source code of this file.

Defines

#define RUBY_ENCODING_H   1
#define ENCODING_INLINE_MAX   127
#define ENCODING_SHIFT   (FL_USHIFT+10)
#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
#define ENCODING_SET_INLINED(obj, i)
#define ENCODING_SET(obj, i)   rb_enc_set_index((obj), (i))
#define ENCODING_GET_INLINED(obj)   (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
#define ENCODING_GET(obj)
#define ENCODING_IS_ASCII8BIT(obj)   (ENCODING_GET_INLINED(obj) == 0)
#define ENCODING_MAXNAMELEN   42
#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE_UNKNOWN   0
#define ENC_CODERANGE_7BIT   ((int)FL_USER8)
#define ENC_CODERANGE_VALID   ((int)FL_USER9)
#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE(obj)   ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
#define ENC_CODERANGE_ASCIIONLY(obj)   (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
#define ENC_CODERANGE_SET(obj, cr)
#define ENC_CODERANGE_CLEAR(obj)   ENC_CODERANGE_SET((obj),0)
#define ENC_CODERANGE_AND(a, b)
#define ENCODING_CODERANGE_SET(obj, encindex, cr)
#define rb_enc_to_index(enc)   ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
#define rb_enc_name(enc)   (enc)->name
#define rb_enc_mbminlen(enc)   (enc)->min_enc_len
#define rb_enc_mbmaxlen(enc)   (enc)->max_enc_len
#define MBCLEN_CHARFOUND_P(ret)   ONIGENC_MBCLEN_CHARFOUND_P(ret)
#define MBCLEN_CHARFOUND_LEN(ret)   ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
#define MBCLEN_INVALID_P(ret)   ONIGENC_MBCLEN_INVALID_P(ret)
#define MBCLEN_NEEDMORE_P(ret)   ONIGENC_MBCLEN_NEEDMORE_P(ret)
#define MBCLEN_NEEDMORE_LEN(ret)   ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
#define rb_enc_codepoint(p, e, enc)   rb_enc_codepoint_len((p),(e),0,(enc))
#define rb_enc_mbc_to_codepoint(p, e, enc)   ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
#define rb_enc_code_to_mbclen(c, enc)   ONIGENC_CODE_TO_MBCLEN((enc), (c));
#define rb_enc_mbcput(c, buf, enc)   ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
#define rb_enc_prev_char(s, p, e, enc)   ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_left_char_head(s, p, e, enc)   ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_right_char_head(s, p, e, enc)   ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_step_back(s, p, e, n, enc)   ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
#define rb_enc_is_newline(p, end, enc)   ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
#define rb_enc_isctype(c, t, enc)   ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
#define rb_enc_isascii(c, enc)   ONIGENC_IS_CODE_ASCII(c)
#define rb_enc_isalpha(c, enc)   ONIGENC_IS_CODE_ALPHA((enc),(c))
#define rb_enc_islower(c, enc)   ONIGENC_IS_CODE_LOWER((enc),(c))
#define rb_enc_isupper(c, enc)   ONIGENC_IS_CODE_UPPER((enc),(c))
#define rb_enc_ispunct(c, enc)   ONIGENC_IS_CODE_PUNCT((enc),(c))
#define rb_enc_isalnum(c, enc)   ONIGENC_IS_CODE_ALNUM((enc),(c))
#define rb_enc_isprint(c, enc)   ONIGENC_IS_CODE_PRINT((enc),(c))
#define rb_enc_isspace(c, enc)   ONIGENC_IS_CODE_SPACE((enc),(c))
#define rb_enc_isdigit(c, enc)   ONIGENC_IS_CODE_DIGIT((enc),(c))
#define rb_enc_asciicompat(enc)   (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
#define rb_enc_str_asciicompat_p(str)   rb_enc_asciicompat(rb_enc_get(str))
#define ENC_DUMMY_FLAG   (1<<24)
#define ENC_INDEX_MASK   (~(~0U<<24))
#define ENC_TO_ENCINDEX(enc)   (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
#define ENC_DUMMY_P(enc)   ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
#define ENC_SET_DUMMY(enc)   ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
#define ECONV_ERROR_HANDLER_MASK   0x000000ff
#define ECONV_INVALID_MASK   0x0000000f
#define ECONV_INVALID_REPLACE   0x00000002
#define ECONV_UNDEF_MASK   0x000000f0
#define ECONV_UNDEF_REPLACE   0x00000020
#define ECONV_UNDEF_HEX_CHARREF   0x00000030
#define ECONV_DECORATOR_MASK   0x0000ff00
#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00
#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100
#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000
#define ECONV_CR_NEWLINE_DECORATOR   0x00002000
#define ECONV_XML_TEXT_DECORATOR   0x00004000
#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000
#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000
#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000
#define ECONV_DEFAULT_NEWLINE_DECORATOR   0
#define ECONV_PARTIAL_INPUT   0x00010000
#define ECONV_AFTER_OUTPUT   0x00020000
#define RUBY_ENCODING_H   1
#define ENCODING_INLINE_MAX   127
#define ENCODING_SHIFT   (FL_USHIFT+10)
#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
#define ENCODING_SET_INLINED(obj, i)
#define ENCODING_SET(obj, i)   rb_enc_set_index((obj), (i))
#define ENCODING_GET_INLINED(obj)   (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
#define ENCODING_GET(obj)
#define ENCODING_IS_ASCII8BIT(obj)   (ENCODING_GET_INLINED(obj) == 0)
#define ENCODING_MAXNAMELEN   42
#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE_UNKNOWN   0
#define ENC_CODERANGE_7BIT   ((int)FL_USER8)
#define ENC_CODERANGE_VALID   ((int)FL_USER9)
#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE(obj)   ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
#define ENC_CODERANGE_ASCIIONLY(obj)   (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
#define ENC_CODERANGE_SET(obj, cr)
#define ENC_CODERANGE_CLEAR(obj)   ENC_CODERANGE_SET((obj),0)
#define ENC_CODERANGE_AND(a, b)
#define ENCODING_CODERANGE_SET(obj, encindex, cr)
#define rb_enc_to_index(enc)   ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
#define rb_enc_name(enc)   (enc)->name
#define rb_enc_mbminlen(enc)   (enc)->min_enc_len
#define rb_enc_mbmaxlen(enc)   (enc)->max_enc_len
#define MBCLEN_CHARFOUND_P(ret)   ONIGENC_MBCLEN_CHARFOUND_P(ret)
#define MBCLEN_CHARFOUND_LEN(ret)   ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
#define MBCLEN_INVALID_P(ret)   ONIGENC_MBCLEN_INVALID_P(ret)
#define MBCLEN_NEEDMORE_P(ret)   ONIGENC_MBCLEN_NEEDMORE_P(ret)
#define MBCLEN_NEEDMORE_LEN(ret)   ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
#define rb_enc_codepoint(p, e, enc)   rb_enc_codepoint_len((p),(e),0,(enc))
#define rb_enc_mbc_to_codepoint(p, e, enc)   ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
#define rb_enc_code_to_mbclen(c, enc)   ONIGENC_CODE_TO_MBCLEN((enc), (c));
#define rb_enc_mbcput(c, buf, enc)   ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
#define rb_enc_prev_char(s, p, e, enc)   ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_left_char_head(s, p, e, enc)   ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_right_char_head(s, p, e, enc)   ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_step_back(s, p, e, n, enc)   ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
#define rb_enc_is_newline(p, end, enc)   ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
#define rb_enc_isctype(c, t, enc)   ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
#define rb_enc_isascii(c, enc)   ONIGENC_IS_CODE_ASCII(c)
#define rb_enc_isalpha(c, enc)   ONIGENC_IS_CODE_ALPHA((enc),(c))
#define rb_enc_islower(c, enc)   ONIGENC_IS_CODE_LOWER((enc),(c))
#define rb_enc_isupper(c, enc)   ONIGENC_IS_CODE_UPPER((enc),(c))
#define rb_enc_ispunct(c, enc)   ONIGENC_IS_CODE_PUNCT((enc),(c))
#define rb_enc_isalnum(c, enc)   ONIGENC_IS_CODE_ALNUM((enc),(c))
#define rb_enc_isprint(c, enc)   ONIGENC_IS_CODE_PRINT((enc),(c))
#define rb_enc_isspace(c, enc)   ONIGENC_IS_CODE_SPACE((enc),(c))
#define rb_enc_isdigit(c, enc)   ONIGENC_IS_CODE_DIGIT((enc),(c))
#define rb_enc_asciicompat(enc)   (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
#define rb_enc_str_asciicompat_p(str)   rb_enc_asciicompat(rb_enc_get(str))
#define ENC_DUMMY_FLAG   (1<<24)
#define ENC_INDEX_MASK   (~(~0U<<24))
#define ENC_TO_ENCINDEX(enc)   (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
#define ENC_DUMMY_P(enc)   ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
#define ENC_SET_DUMMY(enc)   ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
#define ECONV_ERROR_HANDLER_MASK   0x000000ff
#define ECONV_INVALID_MASK   0x0000000f
#define ECONV_INVALID_REPLACE   0x00000002
#define ECONV_UNDEF_MASK   0x000000f0
#define ECONV_UNDEF_REPLACE   0x00000020
#define ECONV_UNDEF_HEX_CHARREF   0x00000030
#define ECONV_DECORATOR_MASK   0x0000ff00
#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00
#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100
#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000
#define ECONV_CR_NEWLINE_DECORATOR   0x00002000
#define ECONV_XML_TEXT_DECORATOR   0x00004000
#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000
#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000
#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000
#define ECONV_DEFAULT_NEWLINE_DECORATOR   0
#define ECONV_PARTIAL_INPUT   0x00010000
#define ECONV_AFTER_OUTPUT   0x00020000
#define RUBY_ENCODING_H   1
#define ENCODING_INLINE_MAX   127
#define ENCODING_SHIFT   (FL_USHIFT+10)
#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)
#define ENCODING_SET_INLINED(obj, i)
#define ENCODING_SET(obj, i)   rb_enc_set_index((obj), (i))
#define ENCODING_GET_INLINED(obj)   (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)
#define ENCODING_GET(obj)
#define ENCODING_IS_ASCII8BIT(obj)   (ENCODING_GET_INLINED(obj) == 0)
#define ENCODING_MAXNAMELEN   42
#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE_UNKNOWN   0
#define ENC_CODERANGE_7BIT   ((int)FL_USER8)
#define ENC_CODERANGE_VALID   ((int)FL_USER9)
#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))
#define ENC_CODERANGE(obj)   ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)
#define ENC_CODERANGE_ASCIIONLY(obj)   (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)
#define ENC_CODERANGE_SET(obj, cr)
#define ENC_CODERANGE_CLEAR(obj)   ENC_CODERANGE_SET((obj),0)
#define ENC_CODERANGE_AND(a, b)
#define ENCODING_CODERANGE_SET(obj, encindex, cr)
#define rb_enc_to_index(enc)   ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
#define rb_enc_name(enc)   (enc)->name
#define rb_enc_mbminlen(enc)   (enc)->min_enc_len
#define rb_enc_mbmaxlen(enc)   (enc)->max_enc_len
#define MBCLEN_CHARFOUND_P(ret)   ONIGENC_MBCLEN_CHARFOUND_P(ret)
#define MBCLEN_CHARFOUND_LEN(ret)   ONIGENC_MBCLEN_CHARFOUND_LEN(ret)
#define MBCLEN_INVALID_P(ret)   ONIGENC_MBCLEN_INVALID_P(ret)
#define MBCLEN_NEEDMORE_P(ret)   ONIGENC_MBCLEN_NEEDMORE_P(ret)
#define MBCLEN_NEEDMORE_LEN(ret)   ONIGENC_MBCLEN_NEEDMORE_LEN(ret)
#define rb_enc_codepoint(p, e, enc)   rb_enc_codepoint_len((p),(e),0,(enc))
#define rb_enc_mbc_to_codepoint(p, e, enc)   ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))
#define rb_enc_code_to_mbclen(c, enc)   ONIGENC_CODE_TO_MBCLEN((enc), (c));
#define rb_enc_mbcput(c, buf, enc)   ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))
#define rb_enc_prev_char(s, p, e, enc)   ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_left_char_head(s, p, e, enc)   ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_right_char_head(s, p, e, enc)   ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))
#define rb_enc_step_back(s, p, e, n, enc)   ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))
#define rb_enc_is_newline(p, end, enc)   ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))
#define rb_enc_isctype(c, t, enc)   ONIGENC_IS_CODE_CTYPE((enc),(c),(t))
#define rb_enc_isascii(c, enc)   ONIGENC_IS_CODE_ASCII(c)
#define rb_enc_isalpha(c, enc)   ONIGENC_IS_CODE_ALPHA((enc),(c))
#define rb_enc_islower(c, enc)   ONIGENC_IS_CODE_LOWER((enc),(c))
#define rb_enc_isupper(c, enc)   ONIGENC_IS_CODE_UPPER((enc),(c))
#define rb_enc_ispunct(c, enc)   ONIGENC_IS_CODE_PUNCT((enc),(c))
#define rb_enc_isalnum(c, enc)   ONIGENC_IS_CODE_ALNUM((enc),(c))
#define rb_enc_isprint(c, enc)   ONIGENC_IS_CODE_PRINT((enc),(c))
#define rb_enc_isspace(c, enc)   ONIGENC_IS_CODE_SPACE((enc),(c))
#define rb_enc_isdigit(c, enc)   ONIGENC_IS_CODE_DIGIT((enc),(c))
#define rb_enc_asciicompat(enc)   (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))
#define rb_enc_str_asciicompat_p(str)   rb_enc_asciicompat(rb_enc_get(str))
#define ENC_DUMMY_FLAG   (1<<24)
#define ENC_INDEX_MASK   (~(~0U<<24))
#define ENC_TO_ENCINDEX(enc)   (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)
#define ENC_DUMMY_P(enc)   ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)
#define ENC_SET_DUMMY(enc)   ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)
#define ECONV_ERROR_HANDLER_MASK   0x000000ff
#define ECONV_INVALID_MASK   0x0000000f
#define ECONV_INVALID_REPLACE   0x00000002
#define ECONV_UNDEF_MASK   0x000000f0
#define ECONV_UNDEF_REPLACE   0x00000020
#define ECONV_UNDEF_HEX_CHARREF   0x00000030
#define ECONV_DECORATOR_MASK   0x0000ff00
#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00
#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00
#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000
#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100
#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000
#define ECONV_CR_NEWLINE_DECORATOR   0x00002000
#define ECONV_XML_TEXT_DECORATOR   0x00004000
#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000
#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000
#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000
#define ECONV_DEFAULT_NEWLINE_DECORATOR   0
#define ECONV_PARTIAL_INPUT   0x00010000
#define ECONV_AFTER_OUTPUT   0x00020000

Typedefs

typedef OnigEncodingType rb_encoding
typedef rb_econv_t rb_econv_t

Enumerations

enum  rb_econv_result_t {
  econv_invalid_byte_sequence, econv_undefined_conversion, econv_destination_buffer_full, econv_source_buffer_empty,
  econv_finished, econv_after_output, econv_incomplete_input
}

Functions

int rb_char_to_option_kcode (int c, int *option, int *kcode)
int rb_enc_replicate (const char *, rb_encoding *)
int rb_define_dummy_encoding (const char *)
int rb_enc_get_index (VALUE obj)
void rb_enc_set_index (VALUE obj, int encindex)
int rb_enc_find_index (const char *name)
int rb_to_encoding_index (VALUE)
rb_encodingrb_to_encoding (VALUE)
rb_encodingrb_find_encoding (VALUE)
rb_encodingrb_enc_get (VALUE)
rb_encodingrb_enc_compatible (VALUE, VALUE)
rb_encodingrb_enc_check (VALUE, VALUE)
VALUE rb_enc_associate_index (VALUE, int)
VALUE rb_enc_associate (VALUE, rb_encoding *)
void rb_enc_copy (VALUE dst, VALUE src)
VALUE rb_enc_str_new (const char *, long, rb_encoding *)
VALUE rb_enc_str_new_cstr (const char *, rb_encoding *)
VALUE rb_enc_reg_new (const char *, long, rb_encoding *, int)
 PRINTF_ARGS (VALUE rb_enc_sprintf(rb_encoding *, const char *,...), 2, 3)
VALUE rb_enc_vsprintf (rb_encoding *, const char *, va_list)
long rb_enc_strlen (const char *, const char *, rb_encoding *)
char * rb_enc_nth (const char *, const char *, long, rb_encoding *)
VALUE rb_obj_encoding (VALUE)
VALUE rb_enc_str_buf_cat (VALUE str, const char *ptr, long len, rb_encoding *enc)
VALUE rb_enc_uint_chr (unsigned int code, rb_encoding *enc)
VALUE rb_external_str_new_with_enc (const char *ptr, long len, rb_encoding *)
VALUE rb_str_export_to_enc (VALUE, rb_encoding *)
VALUE rb_str_conv_enc (VALUE str, rb_encoding *from, rb_encoding *to)
VALUE rb_str_conv_enc_opts (VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts)
 PRINTF_ARGS (NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char *,...)), 3, 4)
rb_encodingrb_enc_from_index (int idx)
rb_encodingrb_enc_find (const char *name)
int rb_enc_mbclen (const char *p, const char *e, rb_encoding *enc)
int rb_enc_fast_mbclen (const char *p, const char *e, rb_encoding *enc)
int rb_enc_precise_mbclen (const char *p, const char *e, rb_encoding *enc)
int rb_enc_ascget (const char *p, const char *e, int *len, rb_encoding *enc)
unsigned int rb_enc_codepoint_len (const char *p, const char *e, int *len, rb_encoding *enc)
unsigned int rb_enc_codepoint (const char *p, const char *e, rb_encoding *enc)
int rb_enc_codelen (int code, rb_encoding *enc)
int rb_enc_code_to_mbclen (int code, rb_encoding *enc)
int rb_enc_casefold (char *to, const char *p, const char *e, rb_encoding *enc)
int rb_enc_toupper (int c, rb_encoding *enc)
int rb_enc_tolower (int c, rb_encoding *enc)
ID rb_intern3 (const char *, long, rb_encoding *)
ID rb_interned_id_p (const char *, long, rb_encoding *)
int rb_enc_symname_p (const char *, rb_encoding *)
int rb_enc_symname2_p (const char *, long, rb_encoding *)
int rb_enc_str_coderange (VALUE)
long rb_str_coderange_scan_restartable (const char *, const char *, rb_encoding *, int *)
int rb_enc_str_asciionly_p (VALUE)
VALUE rb_enc_from_encoding (rb_encoding *enc)
int rb_enc_unicode_p (rb_encoding *enc)
rb_encodingrb_ascii8bit_encoding (void)
rb_encodingrb_utf8_encoding (void)
rb_encodingrb_usascii_encoding (void)
rb_encodingrb_locale_encoding (void)
rb_encodingrb_filesystem_encoding (void)
rb_encodingrb_default_external_encoding (void)
rb_encodingrb_default_internal_encoding (void)
int rb_ascii8bit_encindex (void)
int rb_utf8_encindex (void)
int rb_usascii_encindex (void)
int rb_locale_encindex (void)
int rb_filesystem_encindex (void)
VALUE rb_enc_default_external (void)
VALUE rb_enc_default_internal (void)
void rb_enc_set_default_external (VALUE encoding)
void rb_enc_set_default_internal (VALUE encoding)
VALUE rb_locale_charmap (VALUE klass)
long rb_memsearch (const void *, long, const void *, long, rb_encoding *)
char * rb_enc_path_next (const char *, const char *, rb_encoding *)
char * rb_enc_path_skip_prefix (const char *, const char *, rb_encoding *)
char * rb_enc_path_last_separator (const char *, const char *, rb_encoding *)
char * rb_enc_path_end (const char *, const char *, rb_encoding *)
const char * ruby_enc_find_basename (const char *name, long *baselen, long *alllen, rb_encoding *enc)
const char * ruby_enc_find_extname (const char *name, long *len, rb_encoding *enc)
ID rb_check_id_cstr (const char *ptr, long len, rb_encoding *enc)
static int rb_enc_dummy_p (rb_encoding *enc)
VALUE rb_str_encode (VALUE str, VALUE to, int ecflags, VALUE ecopts)
int rb_econv_has_convpath_p (const char *from_encoding, const char *to_encoding)
int rb_econv_prepare_options (VALUE opthash, VALUE *ecopts, int ecflags)
int rb_econv_prepare_opts (VALUE opthash, VALUE *ecopts)
rb_econv_trb_econv_open (const char *source_encoding, const char *destination_encoding, int ecflags)
rb_econv_trb_econv_open_opts (const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts)
rb_econv_result_t rb_econv_convert (rb_econv_t *ec, const unsigned char **source_buffer_ptr, const unsigned char *source_buffer_end, unsigned char **destination_buffer_ptr, unsigned char *destination_buffer_end, int flags)
void rb_econv_close (rb_econv_t *ec)
int rb_econv_set_replacement (rb_econv_t *ec, const unsigned char *str, size_t len, const char *encname)
int rb_econv_decorate_at_first (rb_econv_t *ec, const char *decorator_name)
int rb_econv_decorate_at_last (rb_econv_t *ec, const char *decorator_name)
VALUE rb_econv_open_exc (const char *senc, const char *denc, int ecflags)
int rb_econv_insert_output (rb_econv_t *ec, const unsigned char *str, size_t len, const char *str_encoding)
const char * rb_econv_encoding_to_insert_output (rb_econv_t *ec)
void rb_econv_check_error (rb_econv_t *ec)
VALUE rb_econv_make_exception (rb_econv_t *ec)
int rb_econv_putbackable (rb_econv_t *ec)
void rb_econv_putback (rb_econv_t *ec, unsigned char *p, int n)
const char * rb_econv_asciicompat_encoding (const char *encname)
VALUE rb_econv_str_convert (rb_econv_t *ec, VALUE src, int flags)
VALUE rb_econv_substr_convert (rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags)
VALUE rb_econv_str_append (rb_econv_t *ec, VALUE src, VALUE dst, int flags)
VALUE rb_econv_substr_append (rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags)
VALUE rb_econv_append (rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE dst, int flags)
void rb_econv_binmode (rb_econv_t *ec)

Variables

RUBY_EXTERN VALUE rb_cEncoding


Define Documentation

#define ECONV_AFTER_OUTPUT   0x00020000

Definition at line 351 of file encoding.h.

#define ECONV_AFTER_OUTPUT   0x00020000

Definition at line 351 of file encoding.h.

#define ECONV_AFTER_OUTPUT   0x00020000

Definition at line 351 of file encoding.h.

Referenced by econv_primitive_convert(), gzfile_getc(), Init_transcode(), more_char(), rb_econv_convert0(), rb_trans_conv(), and trans_sweep().

#define ECONV_CR_NEWLINE_DECORATOR   0x00002000

Definition at line 334 of file encoding.h.

#define ECONV_CR_NEWLINE_DECORATOR   0x00002000

Definition at line 334 of file encoding.h.

#define ECONV_CR_NEWLINE_DECORATOR   0x00002000

Definition at line 334 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), and rb_econv_binmode().

#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000

Definition at line 333 of file encoding.h.

#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000

Definition at line 333 of file encoding.h.

#define ECONV_CRLF_NEWLINE_DECORATOR   0x00001000

Definition at line 333 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), and rb_econv_binmode().

#define ECONV_DECORATOR_MASK   0x0000ff00

Definition at line 327 of file encoding.h.

#define ECONV_DECORATOR_MASK   0x0000ff00

Definition at line 327 of file encoding.h.

#define ECONV_DECORATOR_MASK   0x0000ff00

Definition at line 327 of file encoding.h.

#define ECONV_DEFAULT_NEWLINE_DECORATOR   0

Definition at line 344 of file encoding.h.

#define ECONV_DEFAULT_NEWLINE_DECORATOR   0

Definition at line 344 of file encoding.h.

#define ECONV_DEFAULT_NEWLINE_DECORATOR   0

Definition at line 344 of file encoding.h.

Referenced by argf_next_argv(), pipe_open(), prep_stdio(), rb_io_extract_modeenc(), and rb_io_s_pipe().

#define ECONV_ERROR_HANDLER_MASK   0x000000ff

Definition at line 318 of file encoding.h.

#define ECONV_ERROR_HANDLER_MASK   0x000000ff

Definition at line 318 of file encoding.h.

#define ECONV_ERROR_HANDLER_MASK   0x000000ff

Definition at line 318 of file encoding.h.

Referenced by make_writeconv(), and rb_econv_open().

#define ECONV_INVALID_MASK   0x0000000f

Definition at line 320 of file encoding.h.

#define ECONV_INVALID_MASK   0x0000000f

Definition at line 320 of file encoding.h.

#define ECONV_INVALID_MASK   0x0000000f

Definition at line 320 of file encoding.h.

Referenced by Init_transcode(), rb_econv_convert(), and str_transcode0().

#define ECONV_INVALID_REPLACE   0x00000002

Definition at line 321 of file encoding.h.

#define ECONV_INVALID_REPLACE   0x00000002

Definition at line 321 of file encoding.h.

#define ECONV_INVALID_REPLACE   0x00000002

Definition at line 321 of file encoding.h.

Referenced by econv_opts(), Init_transcode(), rb_econv_convert(), rb_strftime_with_timespec(), rb_w32_write_console(), ruby__sfvextra(), and str_transcode0().

#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00

Definition at line 328 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00

Definition at line 328 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_MASK   0x00003f00

Definition at line 328 of file encoding.h.

Referenced by argf_next_argv(), decorator_names(), do_writeconv(), econv_description(), econv_opts(), rb_econv_binmode(), rb_io_binmode(), str_transcode0(), and validate_enc_binmode().

#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00

Definition at line 329 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00

Definition at line 329 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_READ_MASK   0x00000f00

Definition at line 329 of file encoding.h.

Referenced by make_writeconv().

#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000

Definition at line 330 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000

Definition at line 330 of file encoding.h.

#define ECONV_NEWLINE_DECORATOR_WRITE_MASK   0x00003000

Definition at line 330 of file encoding.h.

Referenced by make_readconv().

#define ECONV_PARTIAL_INPUT   0x00010000

Definition at line 350 of file encoding.h.

#define ECONV_PARTIAL_INPUT   0x00010000

Definition at line 350 of file encoding.h.

#define ECONV_PARTIAL_INPUT   0x00010000

Definition at line 350 of file encoding.h.

Referenced by do_writeconv(), econv_convert(), econv_primitive_convert(), fill_cbuf(), gzfile_getc(), gzfile_newstr(), Init_transcode(), rb_econv_convert0(), rb_trans_conv(), trans_sweep(), transcode_restartable(), and transcode_restartable0().

#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000

Definition at line 338 of file encoding.h.

#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000

Definition at line 338 of file encoding.h.

#define ECONV_STATEFUL_DECORATOR_MASK   0x00f00000

Definition at line 338 of file encoding.h.

Referenced by make_writeconv().

#define ECONV_UNDEF_HEX_CHARREF   0x00000030

Definition at line 325 of file encoding.h.

#define ECONV_UNDEF_HEX_CHARREF   0x00000030

Definition at line 325 of file encoding.h.

#define ECONV_UNDEF_HEX_CHARREF   0x00000030

Definition at line 325 of file encoding.h.

Referenced by econv_opts(), Init_transcode(), and rb_econv_convert().

#define ECONV_UNDEF_MASK   0x000000f0

Definition at line 323 of file encoding.h.

#define ECONV_UNDEF_MASK   0x000000f0

Definition at line 323 of file encoding.h.

#define ECONV_UNDEF_MASK   0x000000f0

Definition at line 323 of file encoding.h.

Referenced by Init_transcode(), and rb_econv_convert().

#define ECONV_UNDEF_REPLACE   0x00000020

Definition at line 324 of file encoding.h.

#define ECONV_UNDEF_REPLACE   0x00000020

Definition at line 324 of file encoding.h.

#define ECONV_UNDEF_REPLACE   0x00000020

Definition at line 324 of file encoding.h.

Referenced by econv_opts(), Init_transcode(), rb_econv_convert(), rb_strftime_with_timespec(), rb_w32_conv_from_wchar(), rb_w32_write_console(), ruby__sfvextra(), and str_transcode0().

#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100

Definition at line 332 of file encoding.h.

#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100

Definition at line 332 of file encoding.h.

#define ECONV_UNIVERSAL_NEWLINE_DECORATOR   0x00000100

Definition at line 332 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), pipe_open(), prep_stdio(), rb_econv_binmode(), rb_io_extract_modeenc(), and rb_io_s_pipe().

#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000

Definition at line 336 of file encoding.h.

#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000

Definition at line 336 of file encoding.h.

#define ECONV_XML_ATTR_CONTENT_DECORATOR   0x00008000

Definition at line 336 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), and str_transcode0().

#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000

Definition at line 339 of file encoding.h.

#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000

Definition at line 339 of file encoding.h.

#define ECONV_XML_ATTR_QUOTE_DECORATOR   0x00100000

Definition at line 339 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), and str_transcode0().

#define ECONV_XML_TEXT_DECORATOR   0x00004000

Definition at line 335 of file encoding.h.

#define ECONV_XML_TEXT_DECORATOR   0x00004000

Definition at line 335 of file encoding.h.

#define ECONV_XML_TEXT_DECORATOR   0x00004000

Definition at line 335 of file encoding.h.

Referenced by decorator_names(), econv_description(), econv_opts(), Init_transcode(), and str_transcode0().

#define ENC_CODERANGE ( obj   )     ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)

Definition at line 52 of file encoding.h.

#define ENC_CODERANGE ( obj   )     ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)

Definition at line 52 of file encoding.h.

#define ENC_CODERANGE ( obj   )     ((int)RBASIC(obj)->flags & ENC_CODERANGE_MASK)

Definition at line 52 of file encoding.h.

Referenced by rb_enc_cr_str_buf_cat(), rb_enc_cr_str_copy_for_substr(), rb_enc_cr_str_exact_copy(), rb_enc_str_coderange(), rb_str_append(), rb_str_buf_append(), rb_str_chomp_bang(), rb_str_chop_bang(), rb_str_concat(), rb_str_enumerate_chars(), rb_str_justify(), rb_str_plus(), rb_str_reverse(), rb_str_scrub(), rb_str_shared_replace(), rb_str_splice(), rb_str_sub_bang(), rb_str_sublen(), rb_str_subpos(), single_byte_optimizable(), str_byte_substr(), str_modify_keep_cr(), str_strlen(), and tr_trans().

#define ENC_CODERANGE_7BIT   ((int)FL_USER8)

Definition at line 49 of file encoding.h.

#define ENC_CODERANGE_7BIT   ((int)FL_USER8)

Definition at line 49 of file encoding.h.

#define ENC_CODERANGE_7BIT   ((int)FL_USER8)

Definition at line 49 of file encoding.h.

Referenced by coderange_scan(), enc_strlen(), fnmatch_brace(), io_getc(), parser_str_new(), parser_yylex(), prepare_getline_args(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_cr_str_copy_for_substr(), rb_enc_str_asciionly_p(), rb_enc_strlen_cr(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_reg_expr_str(), rb_reg_initialize_str(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_str_buf_cat_ascii(), rb_str_chomp_bang(), rb_str_chop_bang(), rb_str_clear(), rb_str_coderange_scan_restartable(), rb_str_comparable(), rb_str_concat(), rb_str_delete_bang(), rb_str_dump(), rb_str_enumerate_chars(), rb_str_format(), rb_str_hash(), rb_str_is_ascii_only_p(), rb_str_reverse(), rb_str_scrub(), rb_str_sub_bang(), rb_usascii_str_new(), rb_usascii_str_new_cstr(), reg_fragment_setenc_gen(), single_byte_optimizable(), str_byte_substr(), str_compat_and_valid(), str_gsub(), str_new0(), str_transcode0(), sym_check_asciionly(), tr_trans(), and w_symbol().

#define ENC_CODERANGE_AND ( a,
 ) 

Value:

Definition at line 59 of file encoding.h.

#define ENC_CODERANGE_AND ( a,
 ) 

Value:

Definition at line 59 of file encoding.h.

#define ENC_CODERANGE_AND ( a,
 ) 

Value:

Definition at line 59 of file encoding.h.

Referenced by rb_str_justify(), rb_str_plus(), and rb_str_splice().

#define ENC_CODERANGE_ASCIIONLY ( obj   )     (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)

Definition at line 53 of file encoding.h.

#define ENC_CODERANGE_ASCIIONLY ( obj   )     (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)

Definition at line 53 of file encoding.h.

#define ENC_CODERANGE_ASCIIONLY ( obj   )     (ENC_CODERANGE(obj) == ENC_CODERANGE_7BIT)

Definition at line 53 of file encoding.h.

Referenced by rb_enc_associate_index().

#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))

Definition at line 51 of file encoding.h.

#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))

Definition at line 51 of file encoding.h.

#define ENC_CODERANGE_BROKEN   ((int)(FL_USER8|FL_USER9))

Definition at line 51 of file encoding.h.

Referenced by coderange_scan(), io_getc(), rb_econv_prepare_options(), rb_enc_strlen_cr(), rb_io_getline_fast(), rb_reg_prepare_enc(), rb_str_coderange_scan_restartable(), rb_str_format(), rb_str_justify(), rb_str_splice(), rb_str_sub_bang(), rb_str_valid_encoding_p(), read_all(), str_compat_and_valid(), str_modify_keep_cr(), sym_check_asciionly(), and tr_trans().

#define ENC_CODERANGE_CLEAR ( obj   )     ENC_CODERANGE_SET((obj),0)

Definition at line 56 of file encoding.h.

#define ENC_CODERANGE_CLEAR ( obj   )     ENC_CODERANGE_SET((obj),0)

Definition at line 56 of file encoding.h.

#define ENC_CODERANGE_CLEAR ( obj   )     ENC_CODERANGE_SET((obj),0)

Definition at line 56 of file encoding.h.

Referenced by rb_enc_associate_index(), rb_file_expand_path_internal(), rb_str_b(), rb_str_chomp_bang(), rb_str_chop_bang(), rb_str_drop_bytes(), rb_str_force_encoding(), rb_str_modify(), rb_str_modify_expand(), rb_str_resize(), and str_modify_keep_cr().

#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))

Definition at line 47 of file encoding.h.

#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))

Definition at line 47 of file encoding.h.

#define ENC_CODERANGE_MASK   ((int)(FL_USER8|FL_USER9))

Definition at line 47 of file encoding.h.

#define ENC_CODERANGE_SET ( obj,
cr   ) 

Value:

(RBASIC(obj)->flags = \
                                   (RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))

Definition at line 54 of file encoding.h.

#define ENC_CODERANGE_SET ( obj,
cr   ) 

Value:

(RBASIC(obj)->flags = \
                                   (RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))

Definition at line 54 of file encoding.h.

#define ENC_CODERANGE_SET ( obj,
cr   ) 

Value:

(RBASIC(obj)->flags = \
                                   (RBASIC(obj)->flags & ~ENC_CODERANGE_MASK) | (cr))

Definition at line 54 of file encoding.h.

Referenced by io_getc(), rb_enc_cr_str_copy_for_substr(), rb_enc_cr_str_exact_copy(), rb_enc_str_coderange(), rb_io_getline_fast(), rb_str_append(), rb_str_buf_append(), rb_str_clear(), rb_str_concat(), rb_str_delete_bang(), rb_str_dump(), rb_str_format(), rb_str_justify(), rb_str_reverse(), rb_str_scrub(), rb_str_shared_replace(), rb_str_splice(), rb_str_sub_bang(), read_all(), str_byte_substr(), str_encode_associate(), str_gsub(), str_new0(), str_strlen(), and tr_trans().

#define ENC_CODERANGE_UNKNOWN   0

Definition at line 48 of file encoding.h.

#define ENC_CODERANGE_UNKNOWN   0

Definition at line 48 of file encoding.h.

#define ENC_CODERANGE_UNKNOWN   0

Definition at line 48 of file encoding.h.

Referenced by parser_yylex(), rb_enc_cr_str_buf_cat(), rb_enc_str_buf_cat(), rb_enc_str_coderange(), rb_enc_strlen(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_format(), rb_str_reverse(), rb_str_sub_bang(), and str_byte_substr().

#define ENC_CODERANGE_VALID   ((int)FL_USER9)

Definition at line 50 of file encoding.h.

#define ENC_CODERANGE_VALID   ((int)FL_USER9)

Definition at line 50 of file encoding.h.

#define ENC_CODERANGE_VALID   ((int)FL_USER9)

Definition at line 50 of file encoding.h.

Referenced by coderange_scan(), enc_strlen(), io_getc(), pack_unpack(), rb_enc_cr_str_buf_cat(), rb_enc_cr_str_copy_for_substr(), rb_enc_strlen_cr(), rb_reg_expr_str(), rb_str_buf_cat_ascii(), rb_str_clear(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_delete_bang(), rb_str_enumerate_chars(), rb_str_reverse(), rb_str_scrub(), rb_str_sub_bang(), rb_str_subpos(), str_byte_substr(), str_encode_associate(), str_gsub(), str_strlen(), and tr_trans().

#define ENC_DUMMY_FLAG   (1<<24)

Definition at line 236 of file encoding.h.

#define ENC_DUMMY_FLAG   (1<<24)

Definition at line 236 of file encoding.h.

#define ENC_DUMMY_FLAG   (1<<24)

Definition at line 236 of file encoding.h.

#define ENC_DUMMY_P ( enc   )     ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)

Definition at line 241 of file encoding.h.

#define ENC_DUMMY_P ( enc   )     ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)

Definition at line 241 of file encoding.h.

#define ENC_DUMMY_P ( enc   )     ((enc)->ruby_encoding_index & ENC_DUMMY_FLAG)

Definition at line 241 of file encoding.h.

Referenced by enc_dummy_p(), enc_inspect(), rb_enc_dummy_p(), and rb_enc_register().

#define ENC_INDEX_MASK   (~(~0U<<24))

Definition at line 237 of file encoding.h.

#define ENC_INDEX_MASK   (~(~0U<<24))

Definition at line 237 of file encoding.h.

#define ENC_INDEX_MASK   (~(~0U<<24))

Definition at line 237 of file encoding.h.

Referenced by enc_autoload(), must_encindex(), rb_enc_from_index(), and rb_obj_encoding().

#define ENC_SET_DUMMY ( enc   )     ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)

Definition at line 242 of file encoding.h.

#define ENC_SET_DUMMY ( enc   )     ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)

Definition at line 242 of file encoding.h.

#define ENC_SET_DUMMY ( enc   )     ((enc)->ruby_encoding_index |= ENC_DUMMY_FLAG)

Definition at line 242 of file encoding.h.

#define ENC_TO_ENCINDEX ( enc   )     (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)

Definition at line 239 of file encoding.h.

#define ENC_TO_ENCINDEX ( enc   )     (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)

Definition at line 239 of file encoding.h.

#define ENC_TO_ENCINDEX ( enc   )     (int)((enc)->ruby_encoding_index & ENC_INDEX_MASK)

Definition at line 239 of file encoding.h.

Referenced by enc_autoload(), must_encindex(), rb_enc_from_encoding(), and rb_w32_conv_from_wchar().

#define ENCODING_CODERANGE_SET ( obj,
encindex,
cr   ) 

Value:

do { \
        VALUE rb_encoding_coderange_obj = (obj); \
        ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
        ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
    } while (0)

Definition at line 64 of file encoding.h.

#define ENCODING_CODERANGE_SET ( obj,
encindex,
cr   ) 

Value:

do { \
        VALUE rb_encoding_coderange_obj = (obj); \
        ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
        ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
    } while (0)

Definition at line 64 of file encoding.h.

#define ENCODING_CODERANGE_SET ( obj,
encindex,
cr   ) 

Value:

do { \
        VALUE rb_encoding_coderange_obj = (obj); \
        ENCODING_SET(rb_encoding_coderange_obj, (encindex)); \
        ENC_CODERANGE_SET(rb_encoding_coderange_obj, (cr)); \
    } while (0)

Definition at line 64 of file encoding.h.

Referenced by pack_unpack(), rb_enc_cr_str_buf_cat(), rb_str_plus(), rb_str_scrub(), rb_usascii_str_new(), and rb_usascii_str_new_cstr().

#define ENCODING_GET ( obj   ) 

Value:

Definition at line 38 of file encoding.h.

#define ENCODING_GET ( obj   ) 

Value:

Definition at line 38 of file encoding.h.

#define ENCODING_GET ( obj   ) 

Value:

Definition at line 38 of file encoding.h.

Referenced by dump_object(), file_path_convert(), fstring_cmp(), get_encoding(), rb_enc_cr_str_buf_cat(), rb_reg_equal(), rb_reg_regcomp(), rb_str_buf_append(), rb_str_buf_cat_ascii(), rb_str_cmp(), rb_str_comparable(), rb_str_hash(), rb_str_inspect(), rb_str_new_frozen(), rb_w32_write_console(), reg_fragment_setenc_gen(), str_enc_copy(), and str_end_with_asciichar().

#define ENCODING_GET_INLINED ( obj   )     (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)

Definition at line 37 of file encoding.h.

#define ENCODING_GET_INLINED ( obj   )     (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)

Definition at line 37 of file encoding.h.

#define ENCODING_GET_INLINED ( obj   )     (int)((RBASIC(obj)->flags & ENCODING_MASK)>>ENCODING_SHIFT)

Definition at line 37 of file encoding.h.

Referenced by rb_enc_get_index().

#define ENCODING_INLINE_MAX   127

Definition at line 27 of file encoding.h.

#define ENCODING_INLINE_MAX   127

Definition at line 27 of file encoding.h.

#define ENCODING_INLINE_MAX   127

Definition at line 27 of file encoding.h.

Referenced by enc_set_index(), and rb_enc_get_index().

#define ENCODING_IS_ASCII8BIT ( obj   )     (ENCODING_GET_INLINED(obj) == 0)

Definition at line 43 of file encoding.h.

#define ENCODING_IS_ASCII8BIT ( obj   )     (ENCODING_GET_INLINED(obj) == 0)

Definition at line 43 of file encoding.h.

#define ENCODING_IS_ASCII8BIT ( obj   )     (ENCODING_GET_INLINED(obj) == 0)

Definition at line 43 of file encoding.h.

Referenced by dump_object(), rb_enc_cr_str_buf_cat(), and reg_fragment_setenc_gen().

#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)

Definition at line 29 of file encoding.h.

#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)

Definition at line 29 of file encoding.h.

#define ENCODING_MASK   (((VALUE)ENCODING_INLINE_MAX)<<ENCODING_SHIFT)

Definition at line 29 of file encoding.h.

#define ENCODING_MAXNAMELEN   42

Definition at line 45 of file encoding.h.

#define ENCODING_MAXNAMELEN   42

Definition at line 45 of file encoding.h.

#define ENCODING_MAXNAMELEN   42

Definition at line 45 of file encoding.h.

Referenced by parse_mode_enc().

#define ENCODING_SET ( obj,
 )     rb_enc_set_index((obj), (i))

Definition at line 35 of file encoding.h.

#define ENCODING_SET ( obj,
 )     rb_enc_set_index((obj), (i))

Definition at line 35 of file encoding.h.

#define ENCODING_SET ( obj,
 )     rb_enc_set_index((obj), (i))

Definition at line 35 of file encoding.h.

Referenced by reg_fragment_setenc_gen().

#define ENCODING_SET_INLINED ( obj,
 ) 

Value:

do {\
    RBASIC(obj)->flags &= ~ENCODING_MASK;\
    RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
} while (0)

Definition at line 31 of file encoding.h.

#define ENCODING_SET_INLINED ( obj,
 ) 

Value:

do {\
    RBASIC(obj)->flags &= ~ENCODING_MASK;\
    RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
} while (0)

Definition at line 31 of file encoding.h.

#define ENCODING_SET_INLINED ( obj,
 ) 

Value:

do {\
    RBASIC(obj)->flags &= ~ENCODING_MASK;\
    RBASIC(obj)->flags |= (VALUE)(i) << ENCODING_SHIFT;\
} while (0)

Definition at line 31 of file encoding.h.

Referenced by enc_set_index().

#define ENCODING_SHIFT   (FL_USHIFT+10)

Definition at line 28 of file encoding.h.

#define ENCODING_SHIFT   (FL_USHIFT+10)

Definition at line 28 of file encoding.h.

#define ENCODING_SHIFT   (FL_USHIFT+10)

Definition at line 28 of file encoding.h.

#define MBCLEN_CHARFOUND_LEN ( ret   )     ONIGENC_MBCLEN_CHARFOUND_LEN(ret)

Definition at line 140 of file encoding.h.

#define MBCLEN_CHARFOUND_LEN ( ret   )     ONIGENC_MBCLEN_CHARFOUND_LEN(ret)

Definition at line 140 of file encoding.h.

#define MBCLEN_CHARFOUND_LEN ( ret   )     ONIGENC_MBCLEN_CHARFOUND_LEN(ret)

Definition at line 140 of file encoding.h.

Referenced by coderange_scan(), enc_pred_char(), enc_succ_char(), gzreader_charboundary(), io_getc(), make_econv_exception(), rb_enc_codepoint_len(), rb_enc_mbclen(), rb_enc_strlen_cr(), rb_io_each_codepoint(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_dump(), rb_str_inspect(), rb_str_scrub(), and unescape_nonascii().

#define MBCLEN_CHARFOUND_P ( ret   )     ONIGENC_MBCLEN_CHARFOUND_P(ret)

Definition at line 139 of file encoding.h.

#define MBCLEN_CHARFOUND_P ( ret   )     ONIGENC_MBCLEN_CHARFOUND_P(ret)

Definition at line 139 of file encoding.h.

#define MBCLEN_CHARFOUND_P ( ret   )     ONIGENC_MBCLEN_CHARFOUND_P(ret)

Definition at line 139 of file encoding.h.

Referenced by coderange_scan(), enc_pred_char(), enc_succ_char(), fnmatch_helper(), gzreader_charboundary(), io_getc(), make_econv_exception(), parser_tokadd_mbchar(), rb_enc_ascget(), rb_enc_codepoint_len(), rb_enc_mbclen(), rb_enc_strlen_cr(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_dump(), rb_str_inspect(), rb_str_scrub(), and unescape_nonascii().

#define MBCLEN_INVALID_P ( ret   )     ONIGENC_MBCLEN_INVALID_P(ret)

Definition at line 141 of file encoding.h.

#define MBCLEN_INVALID_P ( ret   )     ONIGENC_MBCLEN_INVALID_P(ret)

Definition at line 141 of file encoding.h.

#define MBCLEN_INVALID_P ( ret   )     ONIGENC_MBCLEN_INVALID_P(ret)

Definition at line 141 of file encoding.h.

Referenced by enc_pred_char(), enc_succ_char(), io_getc(), rb_io_each_codepoint(), rb_str_coderange_scan_restartable(), rb_str_scrub(), and unescape_escaped_nonascii().

#define MBCLEN_NEEDMORE_LEN ( ret   )     ONIGENC_MBCLEN_NEEDMORE_LEN(ret)

Definition at line 143 of file encoding.h.

#define MBCLEN_NEEDMORE_LEN ( ret   )     ONIGENC_MBCLEN_NEEDMORE_LEN(ret)

Definition at line 143 of file encoding.h.

#define MBCLEN_NEEDMORE_LEN ( ret   )     ONIGENC_MBCLEN_NEEDMORE_LEN(ret)

Definition at line 143 of file encoding.h.

Referenced by gzreader_charboundary().

#define MBCLEN_NEEDMORE_P ( ret   )     ONIGENC_MBCLEN_NEEDMORE_P(ret)

Definition at line 142 of file encoding.h.

#define MBCLEN_NEEDMORE_P ( ret   )     ONIGENC_MBCLEN_NEEDMORE_P(ret)

Definition at line 142 of file encoding.h.

#define MBCLEN_NEEDMORE_P ( ret   )     ONIGENC_MBCLEN_NEEDMORE_P(ret)

Definition at line 142 of file encoding.h.

Referenced by gzreader_charboundary(), io_getc(), rb_io_each_codepoint(), rb_io_getline_1(), rb_str_scrub(), and unescape_escaped_nonascii().

#define rb_enc_asciicompat ( enc   )     (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))

Definition at line 188 of file encoding.h.

#define rb_enc_asciicompat ( enc   )     (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))

Definition at line 188 of file encoding.h.

#define rb_enc_asciicompat ( enc   )     (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(enc))

Definition at line 188 of file encoding.h.

Referenced by check_path_encoding(), coderange_scan(), do_writeconv(), enc_ascii_compatible_p(), enc_strlen(), fnmatch_brace(), intern_str(), io_encoding_set(), io_getc(), must_be_ascii_compatible(), must_not_be_anonymous(), parser_set_encode(), parser_str_new(), prepare_getline_args(), rb_enc_ascget(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_cr_str_copy_for_substr(), rb_enc_str_asciionly_p(), rb_enc_strlen_cr(), rb_inspect(), rb_io_getline_1(), rb_mod_const_defined(), rb_mod_const_get(), rb_must_asciicompat(), rb_path_to_class(), rb_reg_desc(), rb_reg_expr_str(), rb_reg_prepare_enc(), rb_reg_preprocess(), rb_reg_regsub(), rb_reg_s_union(), rb_reg_to_s(), rb_str_buf_cat_ascii(), rb_str_clear(), rb_str_coderange_scan_restartable(), rb_str_comparable(), rb_str_conv_enc_opts(), rb_str_count(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_dump(), rb_str_ellipsize(), rb_str_enumerate_lines(), rb_str_inspect(), rb_str_scrub(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_succ(), rb_str_upcase_bang(), rb_to_encoding_index(), str_byte_substr(), str_compat_and_valid(), str_encode_associate(), str_find_encindex(), str_gsub(), str_nth_len(), str_transcode0(), sym_check_asciionly(), syserr_initialize(), and validate_enc_binmode().

#define rb_enc_code_to_mbclen ( c,
enc   )     ONIGENC_CODE_TO_MBCLEN((enc), (c));

Definition at line 162 of file encoding.h.

#define rb_enc_code_to_mbclen ( c,
enc   )     ONIGENC_CODE_TO_MBCLEN((enc), (c));

Definition at line 162 of file encoding.h.

#define rb_enc_code_to_mbclen ( c,
enc   )     ONIGENC_CODE_TO_MBCLEN((enc), (c));

Definition at line 162 of file encoding.h.

Referenced by enc_pred_char(), and enc_succ_char().

#define rb_enc_codepoint ( p,
e,
enc   )     rb_enc_codepoint_len((p),(e),0,(enc))

Definition at line 155 of file encoding.h.

#define rb_enc_codepoint ( p,
e,
enc   )     rb_enc_codepoint_len((p),(e),0,(enc))

Definition at line 155 of file encoding.h.

#define rb_enc_codepoint ( p,
e,
enc   )     rb_enc_codepoint_len((p),(e),0,(enc))

Definition at line 155 of file encoding.h.

Referenced by bracket(), fnmatch_helper(), rb_io_each_codepoint(), rb_str_inspect(), rb_str_ord(), and rb_str_rstrip_bang().

#define rb_enc_is_newline ( p,
end,
enc   )     ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))

Definition at line 175 of file encoding.h.

#define rb_enc_is_newline ( p,
end,
enc   )     ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))

Definition at line 175 of file encoding.h.

#define rb_enc_is_newline ( p,
end,
enc   )     ONIGENC_IS_MBC_NEWLINE((enc),(UChar*)(p),(UChar*)(end))

Definition at line 175 of file encoding.h.

Referenced by rb_str_chomp_bang(), and rb_str_enumerate_lines().

#define rb_enc_isalnum ( c,
enc   )     ONIGENC_IS_CODE_ALNUM((enc),(c))

Definition at line 183 of file encoding.h.

#define rb_enc_isalnum ( c,
enc   )     ONIGENC_IS_CODE_ALNUM((enc),(c))

Definition at line 183 of file encoding.h.

#define rb_enc_isalnum ( c,
enc   )     ONIGENC_IS_CODE_ALNUM((enc),(c))

Definition at line 183 of file encoding.h.

Referenced by parser_yylex().

#define rb_enc_isalpha ( c,
enc   )     ONIGENC_IS_CODE_ALPHA((enc),(c))

Definition at line 179 of file encoding.h.

#define rb_enc_isalpha ( c,
enc   )     ONIGENC_IS_CODE_ALPHA((enc),(c))

Definition at line 179 of file encoding.h.

#define rb_enc_isalpha ( c,
enc   )     ONIGENC_IS_CODE_ALPHA((enc),(c))

Definition at line 179 of file encoding.h.

Referenced by rb_enc_symname_type().

#define rb_enc_isascii ( c,
enc   )     ONIGENC_IS_CODE_ASCII(c)

Definition at line 178 of file encoding.h.

#define rb_enc_isascii ( c,
enc   )     ONIGENC_IS_CODE_ASCII(c)

Definition at line 178 of file encoding.h.

#define rb_enc_isascii ( c,
enc   )     ONIGENC_IS_CODE_ASCII(c)

Definition at line 178 of file encoding.h.

Referenced by intern_str(), rb_enc_ascget(), rb_str_downcase_bang(), rb_str_inspect(), and rb_str_upcase_bang().

#define rb_enc_isctype ( c,
t,
enc   )     ONIGENC_IS_CODE_CTYPE((enc),(c),(t))

Definition at line 177 of file encoding.h.

#define rb_enc_isctype ( c,
t,
enc   )     ONIGENC_IS_CODE_CTYPE((enc),(c),(t))

Definition at line 177 of file encoding.h.

#define rb_enc_isctype ( c,
t,
enc   )     ONIGENC_IS_CODE_CTYPE((enc),(c),(t))

Definition at line 177 of file encoding.h.

Referenced by enc_succ_alnum_char().

#define rb_enc_isdigit ( c,
enc   )     ONIGENC_IS_CODE_DIGIT((enc),(c))

Definition at line 186 of file encoding.h.

#define rb_enc_isdigit ( c,
enc   )     ONIGENC_IS_CODE_DIGIT((enc),(c))

Definition at line 186 of file encoding.h.

#define rb_enc_isdigit ( c,
enc   )     ONIGENC_IS_CODE_DIGIT((enc),(c))

Definition at line 186 of file encoding.h.

Referenced by intern_str(), and is_special_global_name().

#define rb_enc_islower ( c,
enc   )     ONIGENC_IS_CODE_LOWER((enc),(c))

Definition at line 180 of file encoding.h.

#define rb_enc_islower ( c,
enc   )     ONIGENC_IS_CODE_LOWER((enc),(c))

Definition at line 180 of file encoding.h.

#define rb_enc_islower ( c,
enc   )     ONIGENC_IS_CODE_LOWER((enc),(c))

Definition at line 180 of file encoding.h.

Referenced by rb_str_capitalize_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), and reg_named_capture_assign_iter().

#define rb_enc_isprint ( c,
enc   )     ONIGENC_IS_CODE_PRINT((enc),(c))

Definition at line 184 of file encoding.h.

#define rb_enc_isprint ( c,
enc   )     ONIGENC_IS_CODE_PRINT((enc),(c))

Definition at line 184 of file encoding.h.

#define rb_enc_isprint ( c,
enc   )     ONIGENC_IS_CODE_PRINT((enc),(c))

Definition at line 184 of file encoding.h.

Referenced by rb_reg_expr_str(), rb_str_format(), rb_str_inspect(), and sym_printable().

#define rb_enc_ispunct ( c,
enc   )     ONIGENC_IS_CODE_PUNCT((enc),(c))

Definition at line 182 of file encoding.h.

#define rb_enc_ispunct ( c,
enc   )     ONIGENC_IS_CODE_PUNCT((enc),(c))

Definition at line 182 of file encoding.h.

#define rb_enc_ispunct ( c,
enc   )     ONIGENC_IS_CODE_PUNCT((enc),(c))

Definition at line 182 of file encoding.h.

Referenced by intern_str().

#define rb_enc_isspace ( c,
enc   )     ONIGENC_IS_CODE_SPACE((enc),(c))

Definition at line 185 of file encoding.h.

#define rb_enc_isspace ( c,
enc   )     ONIGENC_IS_CODE_SPACE((enc),(c))

Definition at line 185 of file encoding.h.

#define rb_enc_isspace ( c,
enc   )     ONIGENC_IS_CODE_SPACE((enc),(c))

Definition at line 185 of file encoding.h.

Referenced by parser_yylex(), and rb_reg_expr_str().

#define rb_enc_isupper ( c,
enc   )     ONIGENC_IS_CODE_UPPER((enc),(c))

Definition at line 181 of file encoding.h.

#define rb_enc_isupper ( c,
enc   )     ONIGENC_IS_CODE_UPPER((enc),(c))

Definition at line 181 of file encoding.h.

#define rb_enc_isupper ( c,
enc   )     ONIGENC_IS_CODE_UPPER((enc),(c))

Definition at line 181 of file encoding.h.

Referenced by intern_str(), rb_enc_symname_type(), rb_str_capitalize_bang(), rb_str_downcase_bang(), and rb_str_swapcase_bang().

#define rb_enc_left_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 170 of file encoding.h.

#define rb_enc_left_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 170 of file encoding.h.

#define rb_enc_left_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_left_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 170 of file encoding.h.

Referenced by gzreader_charboundary(), rb_io_getline_1(), rb_reg_to_s(), rb_str_chomp_bang(), rb_str_end_with(), realpath_rec(), and rmext().

#define rb_enc_mbc_to_codepoint ( p,
e,
enc   )     ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))

Definition at line 156 of file encoding.h.

#define rb_enc_mbc_to_codepoint ( p,
e,
enc   )     ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))

Definition at line 156 of file encoding.h.

#define rb_enc_mbc_to_codepoint ( p,
e,
enc   )     ONIGENC_MBC_TO_CODE((enc),(UChar*)(p),(UChar*)(e))

Definition at line 156 of file encoding.h.

Referenced by enc_pred_char(), enc_succ_alnum_char(), enc_succ_char(), make_econv_exception(), rb_enc_ascget(), rb_enc_codepoint_len(), rb_reg_expr_str(), rb_str_dump(), and rb_str_inspect().

#define rb_enc_mbcput ( c,
buf,
enc   )     ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))

Definition at line 165 of file encoding.h.

#define rb_enc_mbcput ( c,
buf,
enc   )     ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))

Definition at line 165 of file encoding.h.

#define rb_enc_mbcput ( c,
buf,
enc   )     ONIGENC_CODE_TO_MBC((enc),(c),(UChar*)(buf))

Definition at line 165 of file encoding.h.

Referenced by enc_pred_char(), enc_succ_char(), parser_tokaddmbc(), rb_enc_uint_chr(), rb_reg_quote(), rb_str_buf_cat_ascii(), rb_str_capitalize_bang(), rb_str_concat(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_format(), rb_str_squeeze_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), strio_ungetc(), and tr_trans().

#define rb_enc_mbmaxlen ( enc   )     (enc)->max_enc_len

Definition at line 129 of file encoding.h.

#define rb_enc_mbmaxlen ( enc   )     (enc)->max_enc_len

Definition at line 129 of file encoding.h.

#define rb_enc_mbmaxlen ( enc   )     (enc)->max_enc_len

Definition at line 129 of file encoding.h.

Referenced by enc_strlen(), gzfile_getc(), gzreader_gets(), rb_enc_strlen_cr(), rb_str_buf_cat_ascii(), rb_str_scrub(), rb_str_subpos(), single_byte_optimizable(), str_nth_len(), tr_trans(), unescape_escaped_nonascii(), and update_char_offset().

#define rb_enc_mbminlen ( enc   )     (enc)->min_enc_len

Definition at line 128 of file encoding.h.

#define rb_enc_mbminlen ( enc   )     (enc)->min_enc_len

Definition at line 128 of file encoding.h.

#define rb_enc_mbminlen ( enc   )     (enc)->min_enc_len

Definition at line 128 of file encoding.h.

Referenced by enc_pred_char(), enc_strlen(), enc_succ_char(), rb_enc_associate_index(), rb_enc_mbclen(), rb_enc_str_new(), rb_enc_str_new_cstr(), rb_enc_strlen_cr(), rb_enc_vsprintf(), rb_str_append(), rb_str_chomp_bang(), rb_str_ellipsize(), rb_str_fill_terminator(), rb_str_inspect(), rb_str_scrub(), rb_str_subpos(), rb_string_value_cstr(), str_end_with_asciichar(), str_nth_len(), and swallow().

#define rb_enc_name ( enc   )     (enc)->name

Definition at line 125 of file encoding.h.

#define rb_enc_name ( enc   )     (enc)->name

Definition at line 125 of file encoding.h.

#define rb_enc_name ( enc   )     (enc)->name

Definition at line 125 of file encoding.h.

Referenced by check_path_encoding(), decorate_convpath(), do_writeconv(), dump_object(), econv_args(), econv_set_replacement(), enc_arg(), enc_autoload(), enc_inspect(), enc_name(), literal_concat0(), make_readconv(), make_writeconv(), must_encindex(), ole_vstr2wc(), parser_set_encode(), prepare_getline_args(), rb_econv_open_opts(), rb_econv_prepare_options(), rb_enc_aliases_enc_i(), rb_enc_check(), rb_enc_codelen(), rb_enc_codepoint_len(), rb_enc_cr_str_buf_cat(), rb_enc_register(), rb_enc_uint_chr(), rb_enc_vsprintf(), rb_io_each_codepoint(), rb_io_extract_encoding_option(), rb_must_asciicompat(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_s_union(), rb_str_check_dummy_enc(), rb_str_concat(), rb_str_split_m(), rb_str_sub_bang(), rb_w32_write_console(), reg_enc_error(), reg_fragment_setenc_gen(), str_compat_and_valid(), str_transcode_enc_args(), transcode_loop(), and w_encoding().

#define rb_enc_prev_char ( s,
p,
e,
enc   )     ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 168 of file encoding.h.

#define rb_enc_prev_char ( s,
p,
e,
enc   )     ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 168 of file encoding.h.

#define rb_enc_prev_char ( s,
p,
e,
enc   )     ((char *)onigenc_get_prev_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 168 of file encoding.h.

Referenced by chopped_length(), parser_yyerror(), rb_str_rstrip_bang(), rb_str_subpos(), rb_str_succ(), and str_rindex().

#define rb_enc_right_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 171 of file encoding.h.

#define rb_enc_right_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 171 of file encoding.h.

#define rb_enc_right_char_head ( s,
p,
e,
enc   )     ((char *)onigenc_get_right_adjust_char_head((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e)))

Definition at line 171 of file encoding.h.

Referenced by rb_str_enumerate_lines(), rb_str_format(), rb_str_index(), rb_str_split_m(), and strio_getline().

#define rb_enc_step_back ( s,
p,
e,
n,
enc   )     ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))

Definition at line 172 of file encoding.h.

#define rb_enc_step_back ( s,
p,
e,
n,
enc   )     ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))

Definition at line 172 of file encoding.h.

#define rb_enc_step_back ( s,
p,
e,
n,
enc   )     ((char *)onigenc_step_back((enc),(UChar*)(s),(UChar*)(p),(UChar*)(e),(int)(n)))

Definition at line 172 of file encoding.h.

Referenced by rb_str_ellipsize().

#define rb_enc_str_asciicompat_p ( str   )     rb_enc_asciicompat(rb_enc_get(str))

Definition at line 200 of file encoding.h.

#define rb_enc_str_asciicompat_p ( str   )     rb_enc_asciicompat(rb_enc_get(str))

Definition at line 200 of file encoding.h.

#define rb_enc_str_asciicompat_p ( str   )     rb_enc_asciicompat(rb_enc_get(str))

Definition at line 200 of file encoding.h.

Referenced by rb_reg_prepare_enc(), rb_reg_s_union(), time_strftime(), and utc_offset_arg().

#define rb_enc_to_index ( enc   )     ((enc) ? ENC_TO_ENCINDEX(enc) : 0)

Definition at line 77 of file encoding.h.

#define rb_enc_to_index ( enc   )     ((enc) ? ENC_TO_ENCINDEX(enc) : 0)

Definition at line 77 of file encoding.h.

#define rb_enc_to_index ( enc   )     ((enc) ? ENC_TO_ENCINDEX(enc) : 0)

Definition at line 77 of file encoding.h.

Referenced by check_encoding(), code_page(), coderange_scan(), enc_inspect(), enc_set_default_encoding(), Init_enc_set_filesystem_encoding(), Init_tcltklib(), rb_enc_associate(), rb_enc_str_buf_cat(), rb_str_coderange_scan_restartable(), rb_str_plus(), and rb_str_scrub().

#define RUBY_ENCODING_H   1

Definition at line 13 of file encoding.h.

#define RUBY_ENCODING_H   1

Definition at line 13 of file encoding.h.

#define RUBY_ENCODING_H   1

Definition at line 13 of file encoding.h.


Typedef Documentation

typedef struct rb_econv_t rb_econv_t

Definition at line 262 of file encoding.h.

typedef OnigEncodingType rb_encoding

Definition at line 71 of file encoding.h.


Enumeration Type Documentation

enum rb_econv_result_t

Enumerator:
econv_invalid_byte_sequence 
econv_undefined_conversion 
econv_destination_buffer_full 
econv_source_buffer_empty 
econv_finished 
econv_after_output 
econv_incomplete_input 

Definition at line 252 of file encoding.h.


Function Documentation

PRINTF_ARGS ( NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char *,...))  ,
,
 
)

PRINTF_ARGS ( VALUE   rb_enc_sprintf(rb_encoding *, const char *,...),
,
 
)

int rb_ascii8bit_encindex ( void   ) 

Definition at line 1236 of file encoding.c.

rb_encoding* rb_ascii8bit_encoding ( void   ) 

Definition at line 1227 of file encoding.c.

References enc_table, and rb_enc_init().

Referenced by do_opendir(), do_writeconv(), file_path_convert(), get_actual_encoding(), int_chr(), io_ascii8bit_binmode(), load_file_internal(), make_writeconv(), parser_str_new(), rb_define_dummy_encoding(), rb_encdb_dummy(), rb_external_str_with_enc(), rb_file_open_internal(), rb_glob(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_io_ext_int_to_encs(), rb_io_extract_modeenc(), rb_reg_initialize(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_new(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_s_union(), rb_str_concat(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_encode_ospath(), rb_strftime_with_timespec(), rb_symname_p(), rb_w32_readdir(), reg_fragment_setenc_gen(), ruby_brace_glob(), ruby_glob(), ruby_init_loadpath_safe(), strio_read(), strio_ungetc(), and strio_write().

int rb_char_to_option_kcode ( int  c,
int *  option,
int *  kcode 
)

Definition at line 301 of file re.c.

References ARG_ENCODING_FIXED, ARG_ENCODING_NONE, char_to_option(), rb_ascii8bit_encindex, and rb_utf8_encindex.

Referenced by parser_regx_options(), and reg_fragment_setenc_gen().

ID rb_check_id_cstr ( const char *  ptr,
long  len,
rb_encoding enc 
)

Definition at line 17366 of file ripper.c.

References RString::as, global_symbols, RString::heap, rb_enc_associate(), rb_id_attrset(), rb_is_attrset_name(), setup_fake_str(), st_data_t, st_lookup(), sym_check_asciionly(), symbols::sym_id, and VALUE.

rb_encoding* rb_default_external_encoding ( void   ) 

Definition at line 1351 of file encoding.c.

References default_external, default_encoding::enc, default_encoding::index, rb_enc_from_index(), and rb_locale_encoding().

Referenced by argf_external_encoding(), argf_internal_encoding(), gzfile_new(), Init_enc_set_filesystem_encoding(), io_read_encoding(), rb_enc_default_external(), rb_enc_reg_error_desc(), rb_external_str_new(), rb_external_str_new_cstr(), rb_inspect(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_export(), rb_str_inspect(), rb_str_quote_unprintable(), rb_str_symname_p(), require_libraries(), strio_init(), strio_set_encoding(), and validate_enc_binmode().

rb_encoding* rb_default_internal_encoding ( void   ) 

Definition at line 1436 of file encoding.c.

References default_internal, default_encoding::enc, default_encoding::index, and rb_enc_from_index().

Referenced by file_path_convert(), int_chr(), parse(), rb_enc_default_internal(), rb_enc_reg_error_desc(), rb_external_str_with_enc(), rb_io_ext_int_to_encs(), rb_reg_desc(), rb_str_inspect(), rb_str_quote_unprintable(), and rb_str_symname_p().

int rb_define_dummy_encoding ( const char *   ) 

Definition at line 437 of file encoding.c.

References rb_encoding_entry::enc, ENC_SET_DUMMY, enc_table, rb_ascii8bit_encoding(), and rb_enc_replicate().

Referenced by create_dummy_encoding_for_tk_core(), make_dummy_encoding(), ole_cp2encoding(), rb_nkf_enc_get(), and str_transcode0().

VALUE rb_econv_append ( rb_econv_t ec,
const char *  bytesrc,
long  bytesize,
VALUE  dst,
int  flags 
)

Definition at line 1813 of file transcode.c.

References rb_econv_t::destination_encoding, dp, econv_destination_buffer_full, rb_econv_t::last_tc, long, LONG_MAX, rb_transcoder::max_output, NIL_P, rb_eArgError, rb_econv_check_error(), rb_econv_convert(), rb_enc_associate(), rb_raise(), rb_str_buf_new(), rb_str_capacity(), rb_str_resize(), rb_str_set_len(), RSTRING_LEN, RSTRING_PTR, and rb_transcoding::transcoder.

Referenced by rb_econv_substr_append().

const char* rb_econv_asciicompat_encoding ( const char *  encname  ) 

Definition at line 1786 of file transcode.c.

References asciicompat_encoding_t::ascii_compat_name, asciicompat_encoding_t::ascii_incompat_name, asciicompat_encoding_i(), NULL, st_table::num_entries, st_data_t, st_foreach(), st_lookup(), and transcoder_table.

Referenced by econv_s_asciicompat_encoding(), and make_writeconv().

void rb_econv_binmode ( rb_econv_t ec  ) 

Definition at line 1942 of file transcode.c.

References ECONV_CR_NEWLINE_DECORATOR, ECONV_CRLF_NEWLINE_DECORATOR, ECONV_NEWLINE_DECORATOR_MASK, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_econv_t::elems, rb_econv_t::flags, get_transcoder_entry(), rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_elem_t::tc, transcoder_entry_t::transcoder, rb_transcoding::transcoder, and xfree.

Referenced by rb_io_binmode().

void rb_econv_check_error ( rb_econv_t ec  ) 

Definition at line 4213 of file transcode.c.

References rb_econv_init_by_convpath_t::ec, make_econv_exception(), NIL_P, and rb_exc_raise().

Referenced by fill_cbuf(), gzfile_getc(), and rb_econv_append().

void rb_econv_close ( rb_econv_t ec  ) 

Definition at line 1702 of file transcode.c.

References rb_econv_t::elems, if(), rb_econv_t::in_buf_start, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_start, rb_transcoding_close(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_str, rb_econv_elem_t::tc, and xfree.

Referenced by allocate_converted_string(), clear_readconv(), clear_writeconv(), econv_free(), gzfile_reset(), io_ascii8bit_binmode(), rb_econv_open(), rb_econv_open_by_transcoder_entries(), rb_econv_open_opts(), rb_str_conv_enc_opts(), and transcode_loop().

rb_econv_result_t rb_econv_convert ( rb_econv_t ec,
const unsigned char **  source_buffer_ptr,
const unsigned char *  source_buffer_end,
unsigned char **  destination_buffer_ptr,
unsigned char *  destination_buffer_end,
int  flags 
)

Definition at line 1446 of file transcode.c.

References econv_incomplete_input, econv_invalid_byte_sequence, ECONV_INVALID_MASK, ECONV_INVALID_REPLACE, ECONV_UNDEF_HEX_CHARREF, ECONV_UNDEF_MASK, ECONV_UNDEF_REPLACE, econv_undefined_conversion, rb_econv_t::flags, output_hex_charref(), output_replacement_character(), rb_econv_convert0(), and rb_econv_t::started.

Referenced by allocate_converted_string(), econv_primitive_convert(), fill_cbuf(), finish_writeconv(), gzfile_getc(), rb_econv_append(), rb_str_conv_enc_opts(), and transcode_loop().

int rb_econv_decorate_at_first ( rb_econv_t ec,
const char *  decorator_name 
)

Definition at line 1908 of file transcode.c.

References asciicompat_decoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.

int rb_econv_decorate_at_last ( rb_econv_t ec,
const char *  decorator_name 
)

Definition at line 1925 of file transcode.c.

References asciicompat_encoder, rb_transcoder::asciicompat_type, DECORATOR_P, rb_transcoder::dst_encoding, rb_econv_t::elems, rb_econv_t::num_trans, rb_econv_decorate_at(), rb_transcoder::src_encoding, rb_econv_elem_t::tc, and rb_transcoding::transcoder.

Referenced by rb_econv_open().

const char* rb_econv_encoding_to_insert_output ( rb_econv_t ec  ) 

Definition at line 1503 of file transcode.c.

References asciicompat_encoder, rb_transcoder::asciicompat_type, rb_transcoder::dst_encoding, rb_econv_t::last_tc, NULL, rb_transcoder::src_encoding, and rb_transcoding::transcoder.

Referenced by econv_insert_output(), make_replacement(), rb_econv_insert_output(), and rb_econv_set_replacement().

int rb_econv_has_convpath_p ( const char *  from_encoding,
const char *  to_encoding 
)

Definition at line 3169 of file transcode.c.

References Qnil, RTEST, search_convpath_i(), and transcode_search_path().

Referenced by rb_w32_write_console().

int rb_econv_insert_output ( rb_econv_t ec,
const unsigned char *  str,
size_t  len,
const char *  str_encoding 
)

Definition at line 1587 of file transcode.c.

References allocate_converted_string(), asciicompat_encoder, rb_transcoder::asciicompat_type, buf, rb_econv_t::elems, encoding_equal, fail, rb_econv_t::in_buf_end, rb_econv_t::in_buf_start, rb_econv_t::in_data_end, rb_econv_t::in_data_start, MEMMOVE, NULL, rb_econv_t::num_trans, rb_econv_elem_t::out_buf_end, rb_econv_elem_t::out_buf_start, rb_econv_elem_t::out_data_end, rb_econv_elem_t::out_data_start, rb_econv_encoding_to_insert_output(), rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_t::started, rb_econv_elem_t::tc, rb_transcoding::transcoder, TRANSCODING_READBUF, xfree, xmalloc, and xrealloc.

Referenced by econv_insert_output(), output_hex_charref(), output_replacement_character(), and transcode_loop().

VALUE rb_econv_make_exception ( rb_econv_t ec  ) 

Definition at line 4207 of file transcode.c.

References rb_econv_init_by_convpath_t::ec, and make_econv_exception().

Referenced by fill_cbuf(), and finish_writeconv().

rb_econv_t* rb_econv_open ( const char *  source_encoding,
const char *  destination_encoding,
int  ecflags 
)

Definition at line 1067 of file transcode.c.

References decorator_names(), ECONV_ERROR_HANDLER_MASK, MAX_ECFLAGS_DECORATORS, NULL, rb_econv_close(), rb_econv_decorate_at_last(), and rb_econv_open0().

Referenced by allocate_converted_string(), and rb_econv_open_opts().

VALUE rb_econv_open_exc ( const char *  senc,
const char *  denc,
int  ecflags 
)

Definition at line 2036 of file transcode.c.

References econv_description(), rb_eConverterNotFoundError, rb_exc_new3, rb_str_cat2(), rb_str_new_cstr(), and VALUE.

Referenced by econv_init(), econv_s_search_convpath(), make_readconv(), make_writeconv(), and transcode_loop().

rb_econv_t* rb_econv_open_opts ( const char *  source_encoding,
const char *  destination_encoding,
int  ecflags,
VALUE  ecopts 
)

Definition at line 2578 of file transcode.c.

References NIL_P, NULL, OBJ_FROZEN, Qnil, rb_bug(), rb_econv_close(), rb_econv_open(), rb_econv_set_replacement(), rb_enc_get(), rb_enc_name, rb_hash_aref(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, sym_replace, and T_HASH.

Referenced by econv_init(), gzfile_reset(), make_readconv(), make_writeconv(), rb_gzfile_ecopts(), rb_str_conv_enc_opts(), and transcode_loop().

int rb_econv_prepare_options ( VALUE  opthash,
VALUE *  ecopts,
int  ecflags 
)

Definition at line 2527 of file transcode.c.

References econv_opts(), ENC_CODERANGE_BROKEN, NIL_P, Qnil, rb_check_hash_type(), rb_eArgError, rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_hash_aref(), rb_hash_aset(), rb_hash_freeze(), rb_hash_new(), rb_obj_is_method(), rb_obj_is_proc(), rb_raise(), rb_respond_to(), rb_str_dump(), rb_str_new_frozen(), StringValue, StringValueCStr, sym_aref, sym_fallback, and sym_replace.

Referenced by io_encoding_set(), rb_econv_prepare_opts(), and rb_io_extract_modeenc().

int rb_econv_prepare_opts ( VALUE  opthash,
VALUE *  ecopts 
)

Definition at line 2572 of file transcode.c.

References rb_econv_prepare_options().

Referenced by econv_args(), rb_gzfile_ecopts(), and str_transcode().

void rb_econv_putback ( rb_econv_t ec,
unsigned char *  p,
int  n 
)

Definition at line 1753 of file transcode.c.

References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, rb_transcoding::recognized_len, rb_econv_elem_t::tc, and TRANSCODING_READBUF.

Referenced by econv_putback(), and fill_cbuf().

int rb_econv_putbackable ( rb_econv_t ec  ) 

Definition at line 1742 of file transcode.c.

References rb_econv_t::elems, rb_econv_t::num_trans, rb_transcoding::readagain_len, and rb_econv_elem_t::tc.

Referenced by econv_putback(), and fill_cbuf().

int rb_econv_set_replacement ( rb_econv_t ec,
const unsigned char *  str,
size_t  len,
const char *  encname 
)

Definition at line 2198 of file transcode.c.

References allocate_converted_string(), encoding_equal, MEMCPY, NULL, rb_econv_encoding_to_insert_output(), rb_econv_t::replacement_allocated, rb_econv_t::replacement_enc, rb_econv_t::replacement_len, rb_econv_t::replacement_str, xfree, and xmalloc.

Referenced by econv_set_replacement(), and rb_econv_open_opts().

VALUE rb_econv_str_append ( rb_econv_t ec,
VALUE  src,
VALUE  dst,
int  flags 
)

Definition at line 1865 of file transcode.c.

References rb_econv_substr_append(), and RSTRING_LEN.

VALUE rb_econv_str_convert ( rb_econv_t ec,
VALUE  src,
int  flags 
)

Definition at line 1877 of file transcode.c.

References Qnil, rb_econv_substr_append(), and RSTRING_LEN.

Referenced by do_writeconv(), and gzfile_newstr().

VALUE rb_econv_substr_append ( rb_econv_t ec,
VALUE  src,
long  byteoff,
long  bytesize,
VALUE  dst,
int  flags 
)

Definition at line 1856 of file transcode.c.

References rb_econv_append(), RB_GC_GUARD, rb_str_new_frozen(), and RSTRING_PTR.

Referenced by rb_econv_str_append(), rb_econv_str_convert(), and rb_econv_substr_convert().

VALUE rb_econv_substr_convert ( rb_econv_t ec,
VALUE  src,
long  byteoff,
long  bytesize,
int  flags 
)

Definition at line 1871 of file transcode.c.

References Qnil, and rb_econv_substr_append().

int rb_enc_ascget ( const char *  p,
const char *  e,
int *  len,
rb_encoding enc 
)

Definition at line 970 of file encoding.c.

References rb_encoding_entry::enc, ISASCII, MBCLEN_CHARFOUND_P, rb_enc_asciicompat, rb_enc_isascii, rb_enc_mbc_to_codepoint, and rb_enc_precise_mbclen().

Referenced by check_pipe_command(), chopped_length(), rb_reg_expr_str(), rb_reg_quote(), rb_str_casecmp(), rb_str_chomp_bang(), rb_str_split_m(), rmext(), str_end_with_asciichar(), swallow(), tr_setup_table(), tr_trans(), and trnext().

VALUE rb_enc_associate ( VALUE  ,
rb_encoding  
)

Definition at line 826 of file encoding.c.

References rb_encoding_entry::enc, rb_enc_associate_index(), and rb_enc_to_index.

Referenced by append_fspath(), copy_home_path(), econv_primitive_convert(), econv_putback(), gzfile_getc(), gzfile_newstr(), intern_str(), io_enc_str(), io_shift_cbuf(), lex_getline(), load_file_internal(), locale_path(), parser_nextc(), parser_str_new(), process_options(), rb_ary_join(), rb_check_id_cstr(), rb_dir_getwd(), rb_econv_append(), rb_enc_reg_error_desc(), rb_enc_str_new(), rb_enc_vsprintf(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_file_join(), rb_intern3(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_preprocess(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_s_union(), rb_reg_to_s(), rb_str_append(), rb_str_concat(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_ellipsize(), rb_str_force_encoding(), rb_str_format(), rb_str_inspect(), rb_str_justify(), rb_str_shared_replace(), rb_str_splice(), rb_str_sub_bang(), rb_str_subpat_set(), reg_fragment_setenc_gen(), require_libraries(), ruby__sfvextra(), str_gsub(), strio_read(), strio_set_encoding(), syserr_initialize(), and tr_trans().

VALUE rb_enc_associate_index ( VALUE  ,
int   
)

Definition at line 798 of file encoding.c.

References rb_encoding_entry::enc, ENC_CODERANGE_ASCIIONLY, ENC_CODERANGE_CLEAR, enc_set_index(), must_encindex(), rb_check_frozen, rb_eArgError, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_mbminlen, rb_raise(), rb_str_fill_terminator(), RB_TYPE_P, SPECIAL_CONST_P, and T_STRING.

Referenced by encoded_dup(), lib_fromUTF8_core(), lib_split_tklist_core(), lib_toUTF8_core(), lib_UTF_backslash_core(), make_econv_exception(), parser_set_encode(), r_ivar(), r_symreal(), rb_enc_associate(), rb_enc_copy(), rb_find_file_ext_safe(), rb_find_file_safe(), str_encode_associate(), and str_encode_bang().

int rb_enc_casefold ( char *  to,
const char *  p,
const char *  e,
rb_encoding enc 
)

rb_encoding* rb_enc_check ( VALUE  ,
VALUE   
)

Definition at line 838 of file encoding.c.

References rb_encoding_entry::enc, rb_eEncCompatError, rb_enc_compatible(), rb_enc_get(), rb_enc_name, and rb_raise().

Referenced by append_fspath(), rb_file_expand_path_internal(), rb_file_join(), rb_str_append(), rb_str_chomp_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_end_with(), rb_str_enumerate_lines(), rb_str_format(), rb_str_index(), rb_str_index_m(), rb_str_justify(), rb_str_plus(), rb_str_rindex(), rb_str_splice(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_start_with(), rb_str_subpat_set(), rb_str_upto(), readline_attempted_completion_function(), realpath_rec(), and tr_trans().

int rb_enc_code_to_mbclen ( int  code,
rb_encoding enc 
)

Definition at line 1025 of file encoding.c.

References rb_encoding_entry::enc, and ONIGENC_CODE_TO_MBCLEN.

int rb_enc_codelen ( int  code,
rb_encoding enc 
)

Definition at line 1014 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_CODE_TO_MBCLEN, rb_eArgError, rb_enc_name, and rb_raise().

Referenced by parser_tokaddmbc(), rb_enc_uint_chr(), rb_str_buf_cat_ascii(), rb_str_concat(), rb_str_format(), strio_ungetc(), and tr_trans().

unsigned int rb_enc_codepoint ( const char *  p,
const char *  e,
rb_encoding enc 
)

Definition at line 1008 of file encoding.c.

References rb_encoding_entry::enc, and rb_enc_codepoint_len().

unsigned int rb_enc_codepoint_len ( const char *  p,
const char *  e,
int *  len,
rb_encoding enc 
)

Definition at line 993 of file encoding.c.

References rb_encoding_entry::enc, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, rb_eArgError, rb_enc_mbc_to_codepoint, rb_enc_name, rb_enc_precise_mbclen(), and rb_raise().

Referenced by rb_enc_codepoint(), rb_str_capitalize_bang(), rb_str_count(), rb_str_delete_bang(), rb_str_downcase_bang(), rb_str_enumerate_codepoints(), rb_str_format(), rb_str_lstrip_bang(), rb_str_split_m(), rb_str_squeeze_bang(), rb_str_swapcase_bang(), rb_str_upcase_bang(), readline_attempted_completion_function(), rmext(), strio_each_codepoint(), sym_printable(), tr_trans(), and trnext().

rb_encoding* rb_enc_compatible ( VALUE  ,
VALUE   
)

Definition at line 849 of file encoding.c.

References ENC_CODERANGE_7BIT, rb_enc_asciicompat, rb_enc_from_index(), rb_enc_get_index(), rb_enc_str_asciionly_p(), rb_enc_str_coderange(), RB_TYPE_P, RSTRING_LEN, T_STRING, and VALUE.

Referenced by enc_compatible_p(), file_s_fnmatch(), literal_concat0(), location_format(), match_aref(), rb_enc_check(), rb_file_s_basename(), rb_reg_regsub(), rb_str_casecmp(), rb_str_sub_bang(), and ruby__sfvextra().

void rb_enc_copy ( VALUE  dst,
VALUE  src 
)

Definition at line 916 of file encoding.c.

References rb_enc_associate_index(), and rb_enc_get_index().

Referenced by ary_join_0(), ary_join_1(), inspect_ary(), inspect_i(), rb_check_id(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_reg_desc(), rb_reg_quote(), rb_reg_s_union(), rb_reg_to_s(), rb_str_format(), str_new(), str_new_empty(), and strio_read().

VALUE rb_enc_default_external ( void   ) 

Definition at line 1365 of file encoding.c.

References rb_default_external_encoding(), and rb_enc_from_encoding().

Referenced by encoding_table_get_name_core(), and get_default_external().

VALUE rb_enc_default_internal ( void   ) 

Definition at line 1445 of file encoding.c.

References rb_default_internal_encoding(), and rb_enc_from_encoding().

Referenced by encoding_table_get_name_core(), get_default_internal(), and str_transcode0().

static int rb_enc_dummy_p ( rb_encoding enc  )  [inline, static]

Definition at line 245 of file encoding.h.

References ENC_DUMMY_P.

Referenced by gzfile_getc(), gzfile_newstr(), opt_enc_index(), rb_reg_initialize(), rb_str_check_dummy_enc(), rb_str_scrub(), and set_base_encoding().

int rb_enc_fast_mbclen ( const char *  p,
const char *  e,
rb_encoding enc 
)

Definition at line 940 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_MBC_ENC_LEN, and UChar.

Referenced by enc_strlen(), rb_str_enumerate_chars(), rb_str_reverse(), rb_str_split_m(), scan_once(), and str_gsub().

rb_encoding* rb_enc_find ( const char *  name  ) 

Definition at line 708 of file encoding.c.

References rb_enc_find_index(), and rb_enc_from_index().

Referenced by econv_get_replacement(), econv_insert_output(), Init_gb2312(), make_encoding(), make_replacement(), and transcode_loop().

int rb_enc_find_index ( const char *  name  ) 

Definition at line 684 of file encoding.c.

References rb_encoding_entry::enc, enc_autoload(), enc_autoload_p, load_encoding(), rb_eArgError, rb_enc_from_index(), rb_enc_registered(), rb_raise(), rb_warn(), and UNSPECIFIED_ENCODING.

Referenced by create_dummy_encoding_for_tk_core(), create_encoding_table_core(), encoding_table_get_name_core(), id2encidx(), Init_enc_set_filesystem_encoding(), Init_tcltklib(), lib_fromUTF8_core(), make_econv_exception(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_econv_open0(), rb_enc_alias(), rb_enc_find(), rb_locale_encindex(), rb_nkf_enc_get(), rb_to_encoding_index(), str_find_encindex(), and update_encoding_table().

VALUE rb_enc_from_encoding ( rb_encoding enc  ) 

Definition at line 102 of file encoding.c.

References ENC_TO_ENCINDEX, Qnil, and rb_enc_from_encoding_index().

Referenced by argf_external_encoding(), argf_internal_encoding(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), do_writeconv(), econv_destination_encoding(), econv_insert_output(), econv_s_asciicompat_encoding(), econv_source_encoding(), enc_compatible_p(), encoding_table_get_name_core(), get_user_from_path(), gettable_gen(), Init_nkf(), io_set_encoding_by_bom(), load_file_internal(), make_econv_exception(), make_encobj(), process_options(), rb_enc_default_external(), rb_enc_default_internal(), rb_file_expand_path_internal(), rb_io_external_encoding(), rb_io_getline_1(), rb_io_internal_encoding(), rb_nkf_guess(), rb_parser_encoding(), rb_reg_to_s(), rb_str_ellipsize(), rb_str_enumerate_lines(), readline_attempted_completion_function(), set_encoding_const(), strio_external_encoding(), and update_encoding_table().

rb_encoding* rb_enc_from_index ( int  idx  ) 

Definition at line 590 of file encoding.c.

References ENC_INDEX_MASK, enc_table, and rb_enc_init().

Referenced by check_encoding(), create_dummy_encoding_for_tk_core(), create_encoding_table_core(), dump_object(), econv_args(), enc_alias(), enc_arg(), enc_inspect(), enc_replicate_with_index(), encoding_table_get_name_core(), file_path_convert(), get_actual_encoding(), io_set_encoding_by_bom(), load_file_internal(), make_dummy_encoding(), make_econv_exception(), must_encindex(), ole_cp2encoding(), opt_enc_index(), parse_mode_enc(), parser_set_encode(), process_options(), rb_default_external_encoding(), rb_default_internal_encoding(), rb_econv_open0(), rb_enc_aliases_enc_i(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_find(), rb_enc_find_index(), rb_enc_get(), rb_enc_register(), rb_enc_replicate(), rb_enc_set_base(), rb_encdb_declare(), rb_encdb_replicate(), rb_encdb_set_unicode(), rb_filesystem_encoding(), rb_find_encoding(), rb_io_extract_encoding_option(), rb_locale_encoding(), rb_nkf_enc_get(), rb_str_buf_cat_ascii(), rb_str_comparable(), rb_str_inspect(), rb_w32_conv_from_wchar(), rb_w32_write_console(), str_encode_associate(), str_end_with_asciichar(), str_to_encoding(), str_transcode_enc_args(), update_encoding_table(), and w_encoding().

rb_encoding* rb_enc_get ( VALUE   ) 

Definition at line 832 of file encoding.c.

References rb_enc_from_index(), and rb_enc_get_index().

Referenced by check_dirname(), check_path_encoding(), check_pipe_command(), do_writeconv(), econv_set_replacement(), file_s_fnmatch(), fnmatch_brace(), intern_str(), io_encoding_set(), literal_concat0(), must_be_ascii_compatible(), must_not_be_anonymous(), ole_vstr2wc(), parser_prepare(), parser_yyerror(), path_check_0(), path_sub_ext(), prepare_getline_args(), push_glob(), rb_econv_open_opts(), rb_econv_prepare_options(), rb_enc_check(), rb_file_dirname(), rb_file_expand_path_internal(), rb_file_join(), rb_file_s_basename(), rb_file_s_extname(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_inspect(), rb_mod_const_defined(), rb_mod_const_get(), rb_must_asciicompat(), rb_path_to_class(), rb_push_glob(), rb_realpath_internal(), rb_reg_check_preprocess(), rb_reg_desc(), rb_reg_error_desc(), rb_reg_init_copy(), rb_reg_initialize_m(), rb_reg_initialize_str(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_reg_quote(), rb_reg_regsub(), rb_reg_s_union(), rb_reg_source(), rb_reg_to_s(), rb_str_chomp_bang(), rb_str_conv_enc_opts(), rb_str_dump(), rb_str_ellipsize(), rb_str_encode_ospath(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_fill_terminator(), rb_str_format(), rb_str_symname_type(), rb_string_value_cstr(), rb_to_encoding_index(), realpath_rec(), reg_enc_error(), reg_fragment_setenc_gen(), reg_named_capture_assign_gen(), ruby__sfvextra(), str_find_encindex(), strio_each_codepoint(), strio_external_encoding(), strio_getc(), strio_getline(), strio_substr(), strio_ungetc(), strio_write(), strscan_getch(), sym_check_asciionly(), syserr_initialize(), time_strftime(), transcode_loop(), and update_char_offset().

int rb_enc_get_index ( VALUE  obj  ) 

Definition at line 739 of file encoding.c.

References BUILTIN_TYPE, enc_check_encoding(), ENCODING_GET_INLINED, ENCODING_INLINE_MAX, is_data_encoding, NIL_P, NUM2INT, rb_funcall(), rb_id2str(), rb_id_encoding(), rb_intern, rb_ivar_get(), SPECIAL_CONST_P, SYM2ID, SYMBOL_P, T_DATA, T_FILE, T_REGEXP, T_STRING, and VALUE.

Referenced by lib_fromUTF8_core(), lib_split_tklist_core(), rb_enc_associate_index(), rb_enc_compatible(), rb_enc_copy(), rb_enc_get(), rb_obj_encoding(), str_transcode_enc_args(), w_encoding(), and w_symbol().

int rb_enc_mbclen ( const char *  p,
const char *  e,
rb_encoding enc 
)

Definition at line 946 of file encoding.c.

References rb_encoding_entry::enc, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, ONIGENC_PRECISE_MBC_ENC_LEN, rb_enc_mbminlen, and UChar.

Referenced by bracket(), enc_strlen(), gzfile_getc(), intern_str(), io_getc(), is_special_global_name(), rb_enc_symname_type(), rb_str_casecmp(), rb_str_enumerate_chars(), rb_str_enumerate_lines(), rb_str_format(), rb_str_reverse(), str_nth_len(), str_null_char(), strio_getc(), strio_ungetc(), and strscan_getch().

char* rb_enc_nth ( const char *  ,
const char *  ,
long  ,
rb_encoding  
)

Definition at line 1753 of file string.c.

References str_nth_len().

Referenced by rb_str_ellipsize(), and rb_str_format().

char* rb_enc_path_end ( const char *  ,
const char *  ,
rb_encoding  
)

Definition at line 2928 of file file.c.

References chompdirsep(), and isdirsep.

Referenced by check_dirname().

char* rb_enc_path_last_separator ( const char *  ,
const char *  ,
rb_encoding  
)

Definition at line 2894 of file file.c.

References Inc, isdirsep, last, and NULL.

Referenced by ruby_init_loadpath_safe().

char* rb_enc_path_next ( const char *  ,
const char *  ,
rb_encoding  
)

Definition at line 2846 of file file.c.

References Inc, and isdirsep.

Referenced by rb_enc_path_skip_prefix(), and realpath_rec().

char* rb_enc_path_skip_prefix ( const char *  ,
const char *  ,
rb_encoding  
)

Definition at line 2860 of file file.c.

References isdirsep, and rb_enc_path_next().

Referenced by check_dirname(), and ruby_glob0().

int rb_enc_precise_mbclen ( const char *  p,
const char *  e,
rb_encoding enc 
)

Definition at line 958 of file encoding.c.

References rb_encoding_entry::enc, ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE, ONIGENC_PRECISE_MBC_ENC_LEN, and UChar.

Referenced by coderange_scan(), enc_pred_char(), enc_succ_char(), fnmatch_helper(), gzreader_charboundary(), io_getc(), make_econv_exception(), rb_enc_ascget(), rb_enc_codepoint_len(), rb_enc_strlen_cr(), rb_enc_uint_chr(), rb_io_each_codepoint(), rb_io_getline_1(), rb_reg_expr_str(), rb_str_coderange_scan_restartable(), rb_str_concat(), rb_str_dump(), rb_str_inspect(), rb_str_scrub(), rb_str_succ(), unescape_escaped_nonascii(), and unescape_nonascii().

VALUE rb_enc_reg_new ( const char *  ,
long  ,
rb_encoding ,
int   
)

Definition at line 2529 of file re.c.

References err, NULL, rb_enc_reg_raise(), rb_reg_alloc(), rb_reg_initialize(), and VALUE.

Referenced by rb_reg_new().

int rb_enc_replicate ( const char *  ,
rb_encoding  
)

Definition at line 380 of file encoding.c.

References enc_check_duplication(), enc_register(), rb_enc_from_index(), set_base_encoding(), and set_encoding_const().

Referenced by enc_replicate(), and rb_define_dummy_encoding().

void rb_enc_set_default_external ( VALUE  encoding  ) 

Definition at line 1403 of file encoding.c.

References default_external, enc_set_default_encoding(), NIL_P, rb_eArgError, and rb_raise().

Referenced by process_options(), and set_default_external().

void rb_enc_set_default_internal ( VALUE  encoding  ) 

Definition at line 1488 of file encoding.c.

References default_internal, and enc_set_default_encoding().

Referenced by process_options(), and set_default_internal().

void rb_enc_set_index ( VALUE  obj,
int  encindex 
)

Definition at line 790 of file encoding.c.

References enc_set_index(), must_encindex(), and rb_check_frozen.

Referenced by str_enc_copy().

int rb_enc_str_asciionly_p ( VALUE   ) 

Definition at line 448 of file string.c.

References ENC_CODERANGE_7BIT, FALSE, rb_enc_asciicompat, rb_enc_str_coderange(), STR_ENC_GET, and TRUE.

Referenced by file_path_convert(), fnmatch_brace(), rb_enc_compatible(), rb_file_expand_path_internal(), rb_inspect(), rb_reg_quote(), and rb_reg_s_union().

VALUE rb_enc_str_buf_cat ( VALUE  str,
const char *  ptr,
long  len,
rb_encoding enc 
)

Definition at line 2251 of file string.c.

References ENC_CODERANGE_UNKNOWN, NULL, rb_enc_cr_str_buf_cat(), and rb_enc_to_index.

Referenced by rb_reg_regsub(), str_gsub(), and strio_write().

int rb_enc_str_coderange ( VALUE   ) 

Definition at line 435 of file string.c.

References coderange_scan(), ENC_CODERANGE, ENC_CODERANGE_SET, ENC_CODERANGE_UNKNOWN, RSTRING_LEN, RSTRING_PTR, and STR_ENC_GET.

Referenced by parser_str_new(), prepare_getline_args(), rb_econv_prepare_options(), rb_enc_compatible(), rb_enc_cr_str_buf_cat(), rb_enc_str_asciionly_p(), rb_external_str_with_enc(), rb_file_expand_path_internal(), rb_reg_initialize_str(), rb_reg_prepare_enc(), rb_reg_preprocess_dregexp(), rb_str_comparable(), rb_str_hash(), rb_str_is_ascii_only_p(), rb_str_succ(), rb_str_valid_encoding_p(), reg_fragment_setenc_gen(), str_compat_and_valid(), str_transcode0(), sym_check_asciionly(), and w_symbol().

VALUE rb_enc_str_new ( const char *  ,
long  ,
rb_encoding  
)

Definition at line 548 of file string.c.

References rb_cString, rb_enc_associate(), rb_enc_mbminlen, rb_str_new(), str_new0(), and VALUE.

Referenced by append_fspath(), compile_snprintf(), do_opendir(), econv_get_replacement(), fole_missing(), fstr_update_callback(), get_user_from_path(), io_getc(), lex_get_str(), ole_alloc_vstr(), parser_str_new(), prepare_getline_args(), rb_enc_str_new_cstr(), rb_enc_uint_chr(), rb_intern3(), rb_io_getline_1(), rb_push_glob(), rb_reg_initialize(), rb_reg_initialize_m(), rb_reg_source(), rb_str_scrub(), rb_str_upto(), rb_w32_conv_from_wchar(), register_symid(), strftimev(), strio_getc(), strio_init(), strio_substr(), strio_ungetc(), sym_inspect(), time_strftime(), and transcode_loop().

VALUE rb_enc_str_new_cstr ( const char *  ,
rb_encoding  
)

Definition at line 577 of file string.c.

References rb_eArgError, rb_enc_mbminlen, rb_enc_str_new(), rb_raise(), and strlen().

long rb_enc_strlen ( const char *  ,
const char *  ,
rb_encoding  
)

Definition at line 1141 of file string.c.

References ENC_CODERANGE_UNKNOWN, and enc_strlen().

Referenced by rb_str_format(), and update_char_offset().

int rb_enc_symname2_p ( const char *  ,
long  ,
rb_encoding  
)

Definition at line 16938 of file ripper.c.

References IDSET_ATTRSET_FOR_SYNTAX, and rb_enc_symname_type().

int rb_enc_symname_p ( const char *  ,
rb_encoding  
)

Definition at line 16833 of file ripper.c.

References rb_enc_symname2_p(), and strlen().

int rb_enc_tolower ( int  c,
rb_encoding enc 
)

Definition at line 1037 of file encoding.c.

References ONIGENC_ASCII_CODE_TO_LOWER_CASE, and ONIGENC_IS_ASCII_CODE.

Referenced by rb_str_capitalize_bang(), rb_str_downcase_bang(), and rb_str_swapcase_bang().

int rb_enc_toupper ( int  c,
rb_encoding enc 
)

Definition at line 1031 of file encoding.c.

References ONIGENC_ASCII_CODE_TO_UPPER_CASE, and ONIGENC_IS_ASCII_CODE.

Referenced by bracket(), fnmatch_helper(), rb_str_capitalize_bang(), rb_str_format(), rb_str_swapcase_bang(), and rb_str_upcase_bang().

VALUE rb_enc_uint_chr ( unsigned int  code,
rb_encoding enc 
)

Definition at line 2514 of file numeric.c.

References ONIGERR_INVALID_CODE_POINT_VALUE, ONIGERR_TOO_BIG_WIDE_CHAR_VALUE, rb_enc_codelen(), rb_enc_mbcput, rb_enc_name, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_eRangeError, rb_raise(), RSTRING_END, RSTRING_PTR, and VALUE.

Referenced by int_chr(), and rb_io_ungetc().

int rb_enc_unicode_p ( rb_encoding enc  ) 

Definition at line 496 of file encoding.c.

References rb_encoding_entry::enc, and ONIGENC_IS_UNICODE.

Referenced by rb_reg_expr_str(), and rb_str_inspect().

VALUE rb_enc_vsprintf ( rb_encoding ,
const char *  ,
va_list   
)

Definition at line 1198 of file sprintf.c.

References __SSTR, __SWR, BSD_vfprintf(), f, rb_cString, rb_eArgError, rb_enc_associate(), rb_enc_mbminlen, rb_enc_name, rb_raise(), rb_str_buf_new(), rb_str_resize(), RBASIC_CLEAR_CLASS, RBASIC_SET_CLASS_RAW, result, RSTRING_PTR, ruby__sfvextra(), ruby__sfvwrite(), VALUE, and rb_printf_buffer_extra::value.

Referenced by rb_enc_raise(), rb_enc_sprintf(), rb_loaderror(), rb_loaderror_with_path(), and rb_vsprintf().

VALUE rb_external_str_new_with_enc ( const char *  ptr,
long  len,
rb_encoding  
)

Definition at line 686 of file string.c.

References rb_external_str_with_enc(), rb_tainted_str_new(), and VALUE.

Referenced by dir_each(), dir_read(), push_pattern(), rb_external_str_new(), rb_external_str_new_cstr(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_locale_str_new(), and rb_locale_str_new_cstr().

int rb_filesystem_encindex ( void   ) 

Definition at line 1300 of file encoding.c.

References rb_enc_registered().

Referenced by rb_filesystem_encoding().

rb_encoding* rb_filesystem_encoding ( void   ) 

Definition at line 1309 of file encoding.c.

References rb_enc_from_index(), and rb_filesystem_encindex().

Referenced by copy_home_path(), dir_initialize(), env_fetch(), etc_systmpdir(), file_path_convert(), push_glob(), rb_dir_getwd(), rb_f_getenv(), rb_file_expand_path_internal(), rb_filesystem_str_new(), rb_filesystem_str_new_cstr(), rb_str_encode_ospath(), and rb_w32_special_folder().

rb_encoding* rb_find_encoding ( VALUE   ) 

Definition at line 226 of file encoding.c.

References enc_check_encoding(), NULL, rb_enc_from_index(), RDATA, and str_find_encindex().

Referenced by find_encoding().

ID rb_intern3 ( const char *  ,
long  ,
rb_encoding  
)

Definition at line 17008 of file ripper.c.

References global_symbols, intern_str(), OBJ_FREEZE, rb_enc_associate(), rb_enc_str_new(), setup_fake_str(), st_data_t, st_lookup(), symbols::sym_id, and VALUE.

ID rb_interned_id_p ( const char *  ,
long  ,
rb_encoding  
)

VALUE rb_locale_charmap ( VALUE  klass  ) 

Definition at line 23 of file localeinit.c.

References rb_usascii_str_new2.

int rb_locale_encindex ( void   ) 

Definition at line 1272 of file encoding.c.

References enc_alias_internal(), Init_w32_codepage(), NIL_P, rb_cEncoding, rb_enc_find_index(), rb_enc_registered(), rb_locale_charmap(), StringValueCStr, and VALUE.

Referenced by rb_locale_encoding().

rb_encoding* rb_locale_encoding ( void   ) 

Definition at line 1294 of file encoding.c.

References rb_enc_from_index(), and rb_locale_encindex().

Referenced by env_str_new(), load_file_internal(), locale_path(), process_options(), rb_default_external_encoding(), rb_loaderror(), rb_loaderror_with_path(), rb_locale_str_new(), rb_locale_str_new_cstr(), rb_str_export_locale(), rb_strftime_with_timespec(), readline_attempted_completion_function(), and syserr_initialize().

long rb_memsearch ( const void *  ,
long  ,
const void *  ,
long  ,
rb_encoding  
)

Definition at line 227 of file re.c.

References memcmp(), rb_memsearch_qs(), rb_memsearch_qs_utf8(), rb_memsearch_ss(), rb_utf8_encoding(), and SIZEOF_VALUE.

Referenced by rb_str_enumerate_lines(), rb_str_index(), and rb_str_split_m().

VALUE rb_obj_encoding ( VALUE   ) 

Definition at line 930 of file encoding.c.

References ENC_INDEX_MASK, rb_enc_from_encoding_index(), rb_enc_get_index(), rb_eTypeError, and rb_raise().

Referenced by Init_Regexp(), Init_String(), lib_toUTF8_core(), str_transcode0(), and sym_encoding().

long rb_str_coderange_scan_restartable ( const char *  ,
const char *  ,
rb_encoding ,
int *   
)

Definition at line 340 of file string.c.

References ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_UNKNOWN, ENC_CODERANGE_VALID, MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, rb_enc_asciicompat, rb_enc_precise_mbclen(), rb_enc_to_index, and search_nonascii().

Referenced by fnmatch_brace(), rb_io_getline_fast(), rb_reg_expr_str(), rb_str_format(), read_all(), and str_encode_associate().

VALUE rb_str_conv_enc ( VALUE  str,
rb_encoding from,
rb_encoding to 
)

Definition at line 680 of file string.c.

References Qnil, and rb_str_conv_enc_opts().

Referenced by append_fspath(), env_fetch(), env_str_new(), file_path_convert(), rb_external_str_with_enc(), rb_f_getenv(), rb_gzreader_ungetc(), rb_gzwriter_write(), rb_str_encode_ospath(), rb_str_export(), rb_str_export_locale(), rb_str_export_to_enc(), realpath_rec(), strio_ungetc(), and strio_write().

VALUE rb_str_conv_enc_opts ( VALUE  str,
rb_encoding from,
rb_encoding to,
int  ecflags,
VALUE  ecopts 
)

Definition at line 607 of file string.c.

References DATA_PTR, dp, econv_destination_buffer_full, econv_finished, is_ascii_string, len, LONG_MAX, OnigEncodingTypeST::name, OBJ_INFECT, rb_ascii8bit_encoding(), rb_cEncodingConverter, rb_econv_close(), rb_econv_convert(), rb_econv_open_opts(), rb_enc_asciicompat, rb_enc_associate(), rb_enc_get(), rb_gc_force_recycle(), rb_obj_alloc(), rb_str_dup(), rb_str_new(), rb_str_resize(), rb_str_set_len(), RBASIC_CLEAR_CLASS, RSTRING_LEN, RSTRING_PTR, STR_ENC_GET, and VALUE.

Referenced by gzfile_newstr(), rb_str_conv_enc(), rb_strftime_with_timespec(), rb_w32_conv_from_wchar(), rb_w32_write_console(), and ruby__sfvextra().

VALUE rb_str_encode ( VALUE  str,
VALUE  to,
int  ecflags,
VALUE  ecopts 
)

Definition at line 2885 of file transcode.c.

References argc, argv, encoded_dup(), and str_transcode0().

Referenced by do_writeconv(), econv_insert_output(), get_user_from_path(), rb_file_expand_path_internal(), rb_io_getline_1(), rb_reg_to_s(), rb_str_ellipsize(), and rb_str_enumerate_lines().

VALUE rb_str_export_to_enc ( VALUE  ,
rb_encoding  
)

Definition at line 755 of file string.c.

References rb_str_conv_enc(), and STR_ENC_GET.

Referenced by alias(), scalar(), start_document(), start_mapping(), and start_sequence().

rb_encoding* rb_to_encoding ( VALUE   ) 

Definition at line 219 of file encoding.c.

References enc_check_encoding(), RDATA, and str_to_encoding().

Referenced by decorate_convpath(), dir_initialize(), enc_replicate(), enc_set_default_encoding(), int_chr(), rb_io_extract_encoding_option(), rb_str_force_encoding(), and strio_set_encoding().

int rb_to_encoding_index ( VALUE   ) 

Definition at line 171 of file encoding.c.

References enc_check_encoding(), NIL_P, rb_check_string_type(), rb_enc_asciicompat, rb_enc_find_index(), rb_enc_get(), and StringValueCStr.

Referenced by econv_args(), enc_arg(), enc_names(), lib_fromUTF8_core(), and rb_io_extract_encoding_option().

int rb_usascii_encindex ( void   ) 

Definition at line 1266 of file encoding.c.

rb_encoding* rb_usascii_encoding ( void   ) 

Definition at line 1257 of file encoding.c.

References enc_table, and rb_enc_init().

Referenced by d_lite_to_s(), do_opendir(), enc_inspect(), file_path_convert(), Init_id(), intern_str(), parser_str_new(), push_glob(), rb_ary_join(), rb_external_str_with_enc(), rb_intern2(), rb_nkf_convert(), rb_reg_desc(), rb_reg_initialize(), rb_reg_quote(), rb_reg_to_s(), rb_str_concat(), rb_str_inspect(), rb_str_upto(), rb_strftime_with_timespec(), reg_fragment_setenc_gen(), setup_exception(), time_asctime(), and time_to_s().

int rb_utf8_encindex ( void   ) 

Definition at line 1251 of file encoding.c.

rb_encoding* rb_utf8_encoding ( void   ) 

Definition at line 1242 of file encoding.c.

References enc_table, and rb_enc_init().

Referenced by alias(), append_utf8(), do_opendir(), env_fetch(), env_str_new(), get_user_from_path(), Init_nkf(), Init_tcltklib(), load_file_internal(), make_econv_exception(), parser_initialize(), parser_prepare(), parser_str_new(), parser_tokadd_utf8(), rb_f_getenv(), rb_file_expand_path_internal(), rb_memsearch(), rb_str_dump(), rb_str_encode_ospath(), rb_str_subpos(), scalar(), start_document(), start_mapping(), start_sequence(), and str_strlen().

const char* ruby_enc_find_basename ( const char *  name,
long *  baselen,
long *  alllen,
rb_encoding enc 
)

Definition at line 3772 of file file.c.

References chompdirsep(), Inc, isdirsep, skipprefix, strlen(), and strrdirsep.

Referenced by rb_file_s_basename().

const char* ruby_enc_find_extname ( const char *  name,
long *  len,
rb_encoding enc 
)

Definition at line 3965 of file file.c.

References Inc, isdirsep, istrailinggarbage, long, strlen(), and strrdirsep.

Referenced by path_sub_ext(), and rb_file_s_extname().


Variable Documentation

RUBY_EXTERN VALUE rb_cEncoding

Definition at line 235 of file encoding.h.


Generated on 19 Jul 2016 for Ruby by  doxygen 1.4.7