diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2020-09-25 14:46:59 +0200 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-11-17 09:39:25 +0900 |
commit | ef19fb111a8c8bf1a71d46e6fcf34b227e086845 (patch) | |
tree | 560480994dadab565e04a4379304c268c34f3d89 /string.c | |
parent | 68ffc8db088a7b29613a3746be5cc996be9f66fe (diff) |
Expose the rb_interned_str_* family of functions
Fixes [Feature #13381]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3586
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -11402,6 +11402,36 @@ sym_all_symbols(VALUE _) return rb_sym_all_symbols(); } +VALUE +rb_str_to_interned_str(VALUE str) +{ + return rb_fstring(str); +} + +VALUE +rb_interned_str(const char *ptr, long len) +{ + return rb_fstring_new(ptr, len); +} + +VALUE +rb_interned_str_cstr(const char *ptr) +{ + return rb_fstring_cstr(ptr); +} + +VALUE +rb_enc_interned_str(const char *ptr, long len, rb_encoding *enc) +{ + return rb_fstring_enc_new(ptr, len, enc); +} + +VALUE +rb_enc_interned_str_cstr(const char *ptr, rb_encoding *enc) +{ + return rb_fstring_enc_new(ptr, strlen(ptr), enc); +} + /* * A String object holds and manipulates an arbitrary sequence of * bytes, typically representing characters. String objects may be created |