ruby-changes:34215
From: nobu <ko1@a...>
Date: Mon, 2 Jun 2014 09:31:42 +0900 (JST)
Subject: [ruby-changes:34215] nobu:r46309 (trunk): constify rb_encoding and OnigEncoding
nobu 2014-06-02 07:06:11 +0900 (Mon, 02 Jun 2014) New Revision: 46309 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46309 Log: constify rb_encoding and OnigEncoding * include/ruby/encoding.h: constify `rb_encoding` arguments. * include/ruby/oniguruma.h: constify `OnigEncoding` arguments. Modified files: trunk/ChangeLog trunk/enc/unicode.c trunk/encoding.c trunk/error.c trunk/file.c trunk/include/ruby/encoding.h trunk/include/ruby/oniguruma.h trunk/internal.h trunk/numeric.c trunk/parse.y trunk/re.c trunk/regenc.c trunk/regenc.h trunk/regexec.c trunk/sprintf.c trunk/string.c Index: encoding.c =================================================================== --- encoding.c (revision 46308) +++ encoding.c (revision 46309) @@ -22,7 +22,7 @@ https://github.com/ruby/ruby/blob/trunk/encoding.c#L22 #if defined __GNUC__ && __GNUC__ >= 4 #pragma GCC visibility push(default) -int rb_enc_register(const char *name, rb_encoding *encoding); +int rb_enc_register(const char *name, const rb_encoding *encoding); void rb_enc_set_base(const char *name, const char *orig); int rb_enc_set_dummy(int index); void rb_encdb_declare(const char *name); @@ -99,7 +99,7 @@ rb_enc_from_encoding_index(int idx) https://github.com/ruby/ruby/blob/trunk/encoding.c#L99 } VALUE -rb_enc_from_encoding(rb_encoding *encoding) +rb_enc_from_encoding(const rb_encoding *encoding) { int idx; if (!encoding) return Qnil; @@ -254,9 +254,10 @@ enc_table_expand(int newsize) https://github.com/ruby/ruby/blob/trunk/encoding.c#L254 } static int -enc_register_at(int index, const char *name, rb_encoding *encoding) +enc_register_at(int index, const char *name, const rb_encoding *base_encoding) { struct rb_encoding_entry *ent = &enc_table.list[index]; + rb_encoding *encoding; VALUE list; if (!valid_encoding_name_p(name)) return -1; @@ -269,8 +270,8 @@ enc_register_at(int index, const char *n https://github.com/ruby/ruby/blob/trunk/encoding.c#L270 if (!ent->enc) { ent->enc = xmalloc(sizeof(rb_encoding)); } - if (encoding) { - *ent->enc = *encoding; + if (base_encoding) { + *ent->enc = *base_encoding; } else { memset(ent->enc, 0, sizeof(*ent->enc)); @@ -288,7 +289,7 @@ enc_register_at(int index, const char *n https://github.com/ruby/ruby/blob/trunk/encoding.c#L289 } static int -enc_register(const char *name, rb_encoding *encoding) +enc_register(const char *name, const rb_encoding *encoding) { int index = enc_table.count; @@ -297,11 +298,11 @@ enc_register(const char *name, rb_encodi https://github.com/ruby/ruby/blob/trunk/encoding.c#L298 return enc_register_at(index - 1, name, encoding); } -static void set_encoding_const(const char *, rb_encoding *); +static void set_encoding_const(const char *, const rb_encoding *); int rb_enc_registered(const char *name); int -rb_enc_register(const char *name, rb_encoding *encoding) +rb_enc_register(const char *name, const rb_encoding *encoding) { int index = rb_enc_registered(name); @@ -493,7 +494,7 @@ enc_ascii_compatible_p(VALUE enc) https://github.com/ruby/ruby/blob/trunk/encoding.c#L494 * Returns 1 when the encoding is Unicode series other than UTF-7 else 0. */ int -rb_enc_unicode_p(rb_encoding *enc) +rb_enc_unicode_p(const rb_encoding *enc) { return ONIGENC_IS_UNICODE(enc); } @@ -824,7 +825,7 @@ rb_enc_associate_index(VALUE obj, int id https://github.com/ruby/ruby/blob/trunk/encoding.c#L825 } VALUE -rb_enc_associate(VALUE obj, rb_encoding *enc) +rb_enc_associate(VALUE obj, const rb_encoding *enc) { return rb_enc_associate_index(obj, rb_enc_to_index(enc)); } @@ -938,13 +939,13 @@ rb_obj_encoding(VALUE obj) https://github.com/ruby/ruby/blob/trunk/encoding.c#L939 } int -rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc) +rb_enc_fast_mbclen(const char *p, const char *e, const rb_encoding *enc) { return ONIGENC_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e); } int -rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc) +rb_enc_mbclen(const char *p, const char *e, const rb_encoding *enc) { int n = ONIGENC_PRECISE_MBC_ENC_LEN(enc, (UChar*)p, (UChar*)e); if (MBCLEN_CHARFOUND_P(n) && MBCLEN_CHARFOUND_LEN(n) <= e-p) @@ -956,7 +957,7 @@ rb_enc_mbclen(const char *p, const char https://github.com/ruby/ruby/blob/trunk/encoding.c#L957 } int -rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc) +rb_enc_precise_mbclen(const char *p, const char *e, const rb_encoding *enc) { int n; if (e <= p) @@ -968,7 +969,7 @@ rb_enc_precise_mbclen(const char *p, con https://github.com/ruby/ruby/blob/trunk/encoding.c#L969 } int -rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc) +rb_enc_ascget(const char *p, const char *e, int *len, const rb_encoding *enc) { unsigned int c, l; if (e <= p) @@ -991,7 +992,7 @@ rb_enc_ascget(const char *p, const char https://github.com/ruby/ruby/blob/trunk/encoding.c#L992 } unsigned int -rb_enc_codepoint_len(const char *p, const char *e, int *len_p, rb_encoding *enc) +rb_enc_codepoint_len(const char *p, const char *e, int *len_p, const rb_encoding *enc) { int r; if (e <= p) @@ -1006,13 +1007,13 @@ rb_enc_codepoint_len(const char *p, cons https://github.com/ruby/ruby/blob/trunk/encoding.c#L1007 #undef rb_enc_codepoint unsigned int -rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc) +rb_enc_codepoint(const char *p, const char *e, const rb_encoding *enc) { return rb_enc_codepoint_len(p, e, 0, enc); } int -rb_enc_codelen(int c, rb_encoding *enc) +rb_enc_codelen(int c, const rb_encoding *enc) { int n = ONIGENC_CODE_TO_MBCLEN(enc,c); if (n == 0) { @@ -1023,19 +1024,19 @@ rb_enc_codelen(int c, rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/encoding.c#L1024 #undef rb_enc_code_to_mbclen int -rb_enc_code_to_mbclen(int code, rb_encoding *enc) +rb_enc_code_to_mbclen(int code, const rb_encoding *enc) { return ONIGENC_CODE_TO_MBCLEN(enc, code); } int -rb_enc_toupper(int c, rb_encoding *enc) +rb_enc_toupper(int c, const rb_encoding *enc) { return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_UPPER_CASE(c):(c)); } int -rb_enc_tolower(int c, rb_encoding *enc) +rb_enc_tolower(int c, const rb_encoding *enc) { return (ONIGENC_IS_ASCII_CODE(c)?ONIGENC_ASCII_CODE_TO_LOWER_CASE(c):(c)); } @@ -1543,7 +1544,7 @@ VALUE https://github.com/ruby/ruby/blob/trunk/encoding.c#L1544 rb_locale_charmap(VALUE klass); static void -set_encoding_const(const char *name, rb_encoding *enc) +set_encoding_const(const char *name, const rb_encoding *enc) { VALUE encoding = rb_enc_from_encoding(enc); char *s = (char *)name; Index: include/ruby/oniguruma.h =================================================================== --- include/ruby/oniguruma.h (revision 46308) +++ include/ruby/oniguruma.h (revision 46309) @@ -156,29 +156,29 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L156 typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg); typedef struct OnigEncodingTypeST { - int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc); + int (*precise_mbc_enc_len)(const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc); const char* name; int max_enc_len; int min_enc_len; - int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc); - OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc); - int (*code_to_mbclen)(OnigCodePoint code, struct OnigEncodingTypeST* enc); - int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, struct OnigEncodingTypeST* enc); - int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, struct OnigEncodingTypeST* enc); - int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, struct OnigEncodingTypeST* enc); - int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], struct OnigEncodingTypeST* enc); - int (*property_name_to_ctype)(struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end); - int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, struct OnigEncodingTypeST* enc); - int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], struct OnigEncodingTypeST* enc); - OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc); - int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, struct OnigEncodingTypeST* enc); + int (*is_mbc_newline)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); + OnigCodePoint (*mbc_to_code)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); + int (*code_to_mbclen)(OnigCodePoint code, const struct OnigEncodingTypeST* enc); + int (*code_to_mbc)(OnigCodePoint code, OnigUChar *buf, const struct OnigEncodingTypeST* enc); + int (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, const struct OnigEncodingTypeST* enc); + int (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, const struct OnigEncodingTypeST* enc); + int (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], const struct OnigEncodingTypeST* enc); + int (*property_name_to_ctype)(const struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end); + int (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, const struct OnigEncodingTypeST* enc); + int (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], const struct OnigEncodingTypeST* enc); + OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); + int (*is_allowed_reverse_match)(const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc); int ruby_encoding_index; unsigned int flags; } OnigEncodingType; -typedef OnigEncodingType* OnigEncoding; +typedef const OnigEncodingType* OnigEncoding; -ONIG_EXTERN OnigEncodingType OnigEncodingASCII; +ONIG_EXTERN const OnigEncodingType OnigEncodingASCII; #define ONIG_ENCODING_ASCII (&OnigEncodingASCII) @@ -256,7 +256,7 @@ ONIG_EXTERN OnigEncodingType OnigEncodin https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L256 #define ONIGENC_PRECISE_MBC_ENC_LEN(enc,p,e) (enc)->precise_mbc_enc_len(p,e,enc) ONIG_EXTERN -int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, struct OnigEncodingTypeST* enc)); +int onigenc_mbclen_approximate P_((const OnigUChar* p,const OnigUChar* e, const struct OnigEncodingTypeST* enc)); #define ONIGENC_MBC_ENC_LEN(enc,p,e) onigenc_mbclen_approximate(p,e,enc) #define ONIGENC_MBC_MAXLEN(enc) ((enc)->max_enc_len) @@ -807,7 +807,7 @@ void onig_set_syntax_options P_((OnigSyn https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L807 ONIG_EXTERN int onig_set_meta_char P_((OnigSyntaxType* syntax, unsigned int what, OnigCodePoint code)); ONIG_EXTERN -void onig_copy_encoding P_((OnigEncoding to, OnigEncoding from)); +void onig_copy_encoding P_((OnigEncodingType *to, OnigEncoding from)); ONIG_EXTERN OnigCaseFoldType onig_get_default_case_fold_flag P_((void)); ONIG_EXTERN Index: include/ruby/encoding.h =================================================================== --- include/ruby/encoding.h (revision 46308) +++ include/ruby/encoding.h (revision 46309) @@ -85,24 +85,24 @@ rb_encoding* rb_enc_get(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L85 rb_encoding* rb_enc_compatible(VALUE,VALUE); rb_encoding* rb_enc_check(VALUE,VALUE); VALUE rb_enc_associate_index(VALUE, int); -VALUE rb_enc_associate(VALUE, rb_encoding*); +VALUE rb_enc_associate(VALUE, const 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_enc_str_new(const char*, long, const rb_encoding*); +VALUE rb_enc_str_new_cstr(const char*, const rb_encoding*); +VALUE rb_enc_reg_new(const char*, long, const rb_encoding*, int); +PRINTF_ARGS(VALUE rb_enc_sprintf(const rb_encoding *, const char*, ...), 2, 3); +VALUE rb_enc_vsprintf(const rb_encoding *, const char*, va_list); +long rb_enc_strlen(const char*, const char*, const rb_encoding*); +char* rb_enc_nth(const char*, const char*, long, const 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_enc_str_buf_cat(VALUE str, const char *ptr, long len, const rb_encoding *enc); +VALUE rb_enc_uint_chr(unsigned int code, const 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); +VALUE rb_external_str_new_with_enc(const char *ptr, long len, const rb_encoding *); +VALUE rb_str_export_to_enc(VALUE, const rb_encoding *); +VALUE rb_str_conv_enc(VALUE str, const rb_encoding *from, const rb_encoding *to); +VALUE rb_str_conv_enc_opts(VALUE str, const rb_encoding *from, const rb_encoding *to, int ecflags, VALUE ecopts); #if defined(__GNUC__) && !defined(__PCC__) #define rb_enc_str_new_cstr(str, enc) __extension__ ( \ @@ -113,7 +113,7 @@ VALUE rb_str_conv_enc_opts(VALUE str, rb https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L113 }) #endif -PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4); +PRINTF_ARGS(NORETURN(void rb_enc_raise(const rb_encoding *, VALUE, const char*, ...)), 3, 4); /* index -> rb_encoding */ rb_encoding* rb_enc_from_index(int idx); @@ -129,13 +129,13 @@ rb_encoding * rb_enc_find(const char *na https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L129 #define rb_enc_mbmaxlen(enc) (enc)->max_enc_len /* -> mbclen (no error notification: 0 < ret <= e-p, no exception) */ -int rb_enc_mbclen(const char *p, const char *e, rb_encoding *enc); +int rb_enc_mbclen(const char *p, const char *e, const rb_encoding *enc); /* -> mbclen (only for valid encoding) */ -int rb_enc_fast_mbclen(const char *p, const char *e, rb_encoding *enc); +int rb_enc_fast_mbclen(const char *p, const char *e, const rb_encoding *enc); /* -> chlen, invalid or needmore */ -int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc); +int rb_enc_precise_mbclen(const char *p, const char *e, const rb_encoding *enc); #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) @@ -143,22 +143,22 @@ int rb_enc_precise_mbclen(const char *p, https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L143 #define MBCLEN_NEEDMORE_LEN(ret) ONIGENC_MBCLEN_NEEDMORE_LEN(ret) /* -> 0x00..0x7f, -1 */ -int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc); +int rb_enc_ascget(const char *p, const char *e, int *len, const rb_encoding *enc); /* -> code (and len) or raise exception */ -unsigned int rb_enc_codepoint_len(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, const rb_encoding *enc); /* prototype for obsolete function */ -unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc); +unsigned int rb_enc_codepoint(const char *p, const char *e, const rb_encoding *enc); /* overriding macro */ #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)) /* -> codelen>0 or raise exception */ -int rb_enc_codelen(int code, rb_encoding *enc); +int rb_enc_codelen(int code, const rb_encoding *enc); /* -> 0 for invalid codepoint */ -int rb_enc_code_to_mbclen(int code, rb_encoding *enc); +int rb_enc_code_to_mbclen(int code, const rb_encoding *enc); #define rb_enc_code_to_mbclen(c, enc) ONIGENC_CODE_TO_MBCLEN((enc), (c)); /* code,ptr,encoding -> write buf */ @@ -187,19 +187,19 @@ int rb_enc_code_to_mbclen(int code, rb_e https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L187 #define rb_enc_asciicompat(enc) (rb_enc_mbminlen(enc)==1 && !rb_enc_dummy_p(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_casefold(char *to, const char *p, const char *e, const rb_encoding *enc); +int rb_enc_toupper(int c, const rb_encoding *enc); +int rb_enc_tolower(int c, const rb_encoding *enc); +ID rb_intern3(const char*, long, const rb_encoding*); +ID rb_interned_id_p(const char *, long, const rb_encoding *); +int rb_enc_symname_p(const char*, const rb_encoding*); +int rb_enc_symname2_p(const char*, long, const rb_encoding*); int rb_enc_str_coderange(VALUE); -long rb_str_coderange_scan_restartable(const char*, const char*, rb_encoding*, int*); +long rb_str_coderange_scan_restartable(const char*, const char*, const rb_encoding*, int*); int rb_enc_str_asciionly_p(VALUE); #define rb_enc_str_asciicompat_p(str) rb_enc_asciicompat(rb_enc_get(str)) -VALUE rb_enc_from_encoding(rb_encoding *enc); -int rb_enc_unicode_p(rb_encoding *enc); +VALUE rb_enc_from_encoding(const rb_encoding *enc); +int rb_enc_unicode_p(const rb_encoding *enc); rb_encoding *rb_ascii8bit_encoding(void); rb_encoding *rb_utf8_encoding(void); rb_encoding *rb_usascii_encoding(void); @@ -223,14 +223,14 @@ VALUE rb_enc_default_internal(void); https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L223 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); +long rb_memsearch(const void*,long,const void*,long,const rb_encoding*); +char *rb_enc_path_next(const char *,const char *,const rb_encoding*); +char *rb_enc_path_skip_prefix(const char *,const char *,const rb_encoding*); +char *rb_enc_path_last_separator(const char *,const char *,const rb_encoding*); +char *rb_enc_path_end(const char *,const char *,const rb_encoding*); +const char *ruby_enc_find_basename(const char *name, long *baselen, long *alllen, const rb_encoding *enc); +const char *ruby_enc_find_extname(const char *name, long *len, const rb_encoding *enc); +ID rb_check_id_cstr(const char *ptr, long len, const rb_encoding *enc); RUBY_EXTERN VALUE rb_cEncoding; #define ENC_DUMMY_FLAG (1<<24) @@ -242,7 +242,7 @@ RUBY_EXTERN VALUE rb_cEncoding; https://github.com/ruby/ruby/blob/trunk/include/ruby/encoding.h#L242 #define ENC_SET_DUMMY(enc) ((en (... truncated) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/