diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-11 15:50:42 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-11 15:50:42 +0000 |
commit | a2901a7c75b572d806a6720b37babd566d15e5ba (patch) | |
tree | a237e60a3eb6787d9bf620eaa625ece9983dbe78 /transcode_data.h | |
parent | 96765d153f5d277734c7cc9ace394edd9299576e (diff) | |
download | ruby-a2901a7c75b572d806a6720b37babd566d15e5ba.tar.gz |
* transcode_data.h (rb_trans_result_t): new type.
(rb_trans_elem_t): new type.
(rb_trans_t): new type.
* transcode.c (transcode_dispatch_cb): removed.
(transcode_dispatch): removed.
(rb_transcoding_result_t): moved to rb_trans_result_t in
transcode_data.h.
(transcode_restartable0): goto follow_info when FUNsi.
(rb_transcoding_open): use get_transcoder_entry.
(rb_trans_open): new function.
(rb_trans_conv): ditto.
(rb_trans_close): ditto.
(trans_open_i): ditto.
(trans_sweep): ditto.
(more_output_buffer): take rb_trans_t instead of rb_transcoding as
an argument.
(transcode_loop): take from_encoding and to_encoding instead of tr
as arguments. use rb_trans_open/rb_trans_conv/rb_trans_close.
(str_transcode): don't use transcode_dispatch.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r-- | transcode_data.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/transcode_data.h b/transcode_data.h index 1ffd213d5a..f9e9de4aef 100644 --- a/transcode_data.h +++ b/transcode_data.h @@ -96,6 +96,29 @@ typedef struct rb_transcoder { int (*finish_func)(rb_transcoding*, unsigned char*); /* -> output */ } rb_transcoder; +typedef enum { + transcode_invalid_input, + transcode_undefined_conversion, + transcode_obuf_full, + transcode_ibuf_empty, + transcode_finished, +} rb_trans_result_t; + +typedef struct { + rb_transcoding *tc; + unsigned char *out_buf_start; + unsigned char *out_data_start; + unsigned char *out_data_end; + unsigned char *out_buf_end; + rb_trans_result_t last_result; +} rb_trans_elem_t; + +typedef struct { + rb_trans_elem_t *elems; + int num_trans; + int num_finished; +} rb_trans_t; + void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib); void rb_register_transcoder(const rb_transcoder *); |