aboutsummaryrefslogtreecommitdiffstats
path: root/enc/trans/utf_16_32.erb.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-09 06:02:01 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-09 06:02:01 +0000
commit139234e1a091ac3167d3bebdfcd29b3952665334 (patch)
treec1f7be47d34829813983af23e46340bf806d4ff4 /enc/trans/utf_16_32.erb.c
parent750cb61e65f35feb70ad855ab3353485cfd75b0c (diff)
downloadruby-139234e1a091ac3167d3bebdfcd29b3952665334.tar.gz
* transcode_data.h (rb_transcoding): add fields for restartable
transcoding. (rb_transcoder): add max_input field. from_unit_length field is renamed to input_unit_length. * tool/transcode-tblgen.rb: generate max_input field. * enc/trans/iso2022.erb.c: follow rb_transcoder change. * enc/trans/utf_16_32.erb.c: ditto. * transcode.c (PARTIAL_INPUT): new constant. (transcode_char_start): new function. (transcode_result_t): new type. (transcode_restartable): new function. (more_output_buffer): new function. (transcode_loop): use transcode_restartable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/trans/utf_16_32.erb.c')
-rw-r--r--enc/trans/utf_16_32.erb.c40
1 files changed, 32 insertions, 8 deletions
diff --git a/enc/trans/utf_16_32.erb.c b/enc/trans/utf_16_32.erb.c
index 86f1ed4727..aea2ab50a8 100644
--- a/enc/trans/utf_16_32.erb.c
+++ b/enc/trans/utf_16_32.erb.c
@@ -231,7 +231,10 @@ fun_so_to_utf_32le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned
static const rb_transcoder
rb_from_UTF_16BE = {
- "UTF-16BE", "UTF-8", &from_UTF_16BE, 2, 4,
+ "UTF-16BE", "UTF-8", &from_UTF_16BE,
+ 2, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_from_utf_16be
};
@@ -252,7 +255,10 @@ rb_from_UTF_16BE = {
static const rb_transcoder
rb_to_UTF_16BE = {
- "UTF-8", "UTF-16BE", &to_UTF_16BE, 1, 4,
+ "UTF-8", "UTF-16BE", &to_UTF_16BE,
+ 1, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_to_utf_16be
};
@@ -265,13 +271,19 @@ rb_to_UTF_16BE = {
static const rb_transcoder
rb_from_UTF_16LE = {
- "UTF-16LE", "UTF-8", &from_UTF_16LE, 2, 4,
+ "UTF-16LE", "UTF-8", &from_UTF_16LE,
+ 2, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_from_utf_16le
};
static const rb_transcoder
rb_to_UTF_16LE = {
- "UTF-8", "UTF-16LE", &to_UTF_16BE, 1, 4,
+ "UTF-8", "UTF-16LE", &to_UTF_16BE,
+ 1, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_to_utf_16le
};
@@ -284,13 +296,19 @@ rb_to_UTF_16LE = {
static const rb_transcoder
rb_from_UTF_32BE = {
- "UTF-32BE", "UTF-8", &from_UTF_32BE, 4, 4,
+ "UTF-32BE", "UTF-8", &from_UTF_32BE,
+ 4, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_from_utf_32be
};
static const rb_transcoder
rb_to_UTF_32BE = {
- "UTF-8", "UTF-32BE", &to_UTF_16BE, 1, 4,
+ "UTF-8", "UTF-32BE", &to_UTF_16BE,
+ 1, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_to_utf_32be
};
@@ -303,13 +321,19 @@ rb_to_UTF_32BE = {
static const rb_transcoder
rb_from_UTF_32LE = {
- "UTF-32LE", "UTF-8", &from_UTF_32LE, 4, 4,
+ "UTF-32LE", "UTF-8", &from_UTF_32LE,
+ 4, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_from_utf_32le
};
static const rb_transcoder
rb_to_UTF_32LE = {
- "UTF-8", "UTF-32LE", &to_UTF_16BE, 1, 4,
+ "UTF-8", "UTF-32LE", &to_UTF_16BE,
+ 1, /* input_unit_length */
+ 4, /* max_input */
+ 4, /* max_output */
NULL, NULL, NULL, &fun_so_to_utf_32le
};