summaryrefslogtreecommitdiff
path: root/include/ruby/encoding.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-02 20:23:52 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-06-02 20:23:52 +0000
commit0fec24f972ecd5d0b714a48c9a21e322285f9778 (patch)
tree8d7b812cb78abfd7fa08891e90d8fb7a2c2d9270 /include/ruby/encoding.h
parentf2980e3e2050f21273bfc8412e83adef5f75b1f0 (diff)
encoding.c: move ruby_encoding_index stuff
* encoding.c: move `ruby_encoding_index` stuff from include/ruby/encoding.h to hide the extra field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/encoding.h')
-rw-r--r--include/ruby/encoding.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h
index aab05b4..94a7f0f 100644
--- a/include/ruby/encoding.h
+++ b/include/ruby/encoding.h
@@ -74,7 +74,8 @@ 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 *);
-#define rb_enc_to_index(enc) ((enc) ? ENC_TO_ENCINDEX(enc) : 0)
+int rb_enc_dummy_p(rb_encoding *enc);
+int rb_enc_to_index(rb_encoding *enc);
int rb_enc_get_index(VALUE obj);
void rb_enc_set_index(VALUE obj, int encindex);
int rb_enc_find_index(const char *name);
@@ -233,19 +234,6 @@ 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);
RUBY_EXTERN VALUE rb_cEncoding;
-#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)
-
-static inline int
-rb_enc_dummy_p(rb_encoding *enc)
-{
- return ENC_DUMMY_P(enc) != 0;
-}
/* econv stuff */