diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/encoding.h | 6 | ||||
-rw-r--r-- | include/ruby/io.h | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/ruby/encoding.h b/include/ruby/encoding.h index 7919347199..10a7b95229 100644 --- a/include/ruby/encoding.h +++ b/include/ruby/encoding.h @@ -208,11 +208,13 @@ typedef enum { typedef struct rb_econv_t rb_econv_t; -VALUE rb_str_transcode(VALUE str, VALUE to, int ecflags); +VALUE rb_str_transcode(VALUE str, VALUE to, int ecflags, VALUE ecopts); -int rb_econv_flags(VALUE hash); +int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts); rb_econv_t *rb_econv_open(const char *source_encoding, const char *destination_encoding, int ecflags); +rb_econv_t *rb_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, diff --git a/include/ruby/io.h b/include/ruby/io.h index cdef496a93..676fd05ae3 100644 --- a/include/ruby/io.h +++ b/include/ruby/io.h @@ -58,6 +58,7 @@ typedef struct rb_io_t { rb_encoding *enc; rb_encoding *enc2; int flags; + VALUE ecopts; } encs; rb_econv_t *readconv; @@ -69,6 +70,7 @@ typedef struct rb_io_t { rb_econv_t *writeconv; VALUE writeconv_stateless; int writeconv_pre_flags; + VALUE writeconv_pre_ecopts; int writeconv_initialized; } rb_io_t; @@ -123,11 +125,14 @@ typedef struct rb_io_t { fp->cbuf_capa = 0;\ fp->writeconv = NULL;\ fp->writeconv_stateless = Qnil;\ + fp->writeconv_pre_flags = 0;\ + fp->writeconv_pre_ecopts = Qnil;\ fp->writeconv_initialized = 0;\ fp->tied_io_for_writing = 0;\ fp->encs.enc = NULL;\ fp->encs.enc2 = NULL;\ fp->encs.flags = 0;\ + fp->encs.ecopts = Qnil;\ } while (0) FILE *rb_io_stdio_file(rb_io_t *fptr); |