diff options
author | Benoit Daloze <[email protected]> | 2019-12-27 16:46:08 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-12-27 16:46:08 +0100 |
commit | a2fac1d72c225192018f8f3f3dfcfcc46f66c08a (patch) | |
tree | dc2d44079962ce242d971a4d1c2a2b1333e64cec /spec/ruby/optional/capi/ext/encoding_spec.c | |
parent | 26a9f80c823a9f536a235d80d600aa9e03ed7a2f (diff) |
Update to ruby/spec@d419e74
Diffstat (limited to 'spec/ruby/optional/capi/ext/encoding_spec.c')
-rw-r--r-- | spec/ruby/optional/capi/ext/encoding_spec.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/ruby/optional/capi/ext/encoding_spec.c b/spec/ruby/optional/capi/ext/encoding_spec.c index 3cde884225..52ed4fdb2e 100644 --- a/spec/ruby/optional/capi/ext/encoding_spec.c +++ b/spec/ruby/optional/capi/ext/encoding_spec.c @@ -196,6 +196,14 @@ static VALUE encoding_spec_rb_enc_codepoint_len(VALUE self, VALUE str) { return rb_ary_new3(2, LONG2NUM(codepoint), LONG2NUM(len)); } +static VALUE encoding_spec_rb_enc_str_asciionly_p(VALUE self, VALUE str) { + if (rb_enc_str_asciionly_p(str)) { + return Qtrue; + } else { + return Qfalse; + } +} + void Init_encoding_spec(void) { VALUE cls = rb_define_class("CApiEncodingSpecs", rb_cObject); rb_define_method(cls, "ENC_CODERANGE_ASCIIONLY", @@ -242,6 +250,7 @@ void Init_encoding_spec(void) { rb_define_method(cls, "rb_to_encoding_index", encoding_spec_rb_to_encoding_index, 1); rb_define_method(cls, "rb_enc_nth", encoding_spec_rb_enc_nth, 2); rb_define_method(cls, "rb_enc_codepoint_len", encoding_spec_rb_enc_codepoint_len, 1); + rb_define_method(cls, "rb_enc_str_asciionly_p", encoding_spec_rb_enc_str_asciionly_p, 1); } #ifdef __cplusplus |