diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 14:12:06 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-03 14:12:06 +0000 |
commit | be0f76b1b57c922749b61f5a25af5b942442dc3e (patch) | |
tree | 57787744890d4ac6db62bbcf44b12e738f34eb62 /enc/trans/utf_16_32.trans | |
parent | 6f93bf77c448e4a2aed8ea2656726fd6bd90a725 (diff) | |
download | ruby-be0f76b1b57c922749b61f5a25af5b942442dc3e.tar.gz ruby-be0f76b1b57c922749b61f5a25af5b942442dc3e.tar.xz ruby-be0f76b1b57c922749b61f5a25af5b942442dc3e.zip |
* transcode_data.h (rb_transcoding): remove stateful field.
add state field.
(TRANSCODING_STATE): defined.
(rb_transcoder): add fields: state_size, state_init_func,
state_fini_func.
change rb_transcoding* argument to void*.
* transcode.c (transcode_restartable0): use TRANSCODING_STATE for
first arguments of transcoder functions.
(rb_transcoding_open_by_transcoder): initialize state field.
(rb_transcoding_close): finalize state field.
* tool/transcode-tblgen.rb: provide state size/init/fini.
* enc/trans/newline.trans (universal_newline_init): defined.
(fun_so_universal_newline): take void* as a state pointer.
(rb_universal_newline): provide state size/init/fini.
(rb_crlf_newline): ditto.
(rb_cr_newline): ditto.
* enc/trans/iso2022.trans (iso2022jp_init): defined.
(fun_si_iso2022jp_to_eucjp): take void* as a state pointer.
(fun_so_iso2022jp_to_eucjp): ditto.
(fun_so_eucjp_to_iso2022jp): ditto.
(iso2022jp_reset_sequence_size): ditto.
(finish_eucjp_to_iso2022jp): ditto.
(rb_ISO_2022_JP_to_EUC_JP): provide state size/init/fini.
(rb_EUC_JP_to_ISO_2022_JP): ditto.
* enc/trans/utf_16_32.trans (fun_so_from_utf_16be): take void* as a
state pointer.
(fun_so_to_utf_16be): ditto.
(fun_so_from_utf_16le): ditto.
(fun_so_to_utf_16le): ditto.
(fun_so_from_utf_32be): ditto.
(fun_so_to_utf_32be): ditto.
(fun_so_from_utf_32le): ditto.
(fun_so_to_utf_32le): ditto.
(rb_from_UTF_16BE): provide state size/init/fini.
(rb_to_UTF_16BE): ditto.
(rb_from_UTF_16LE): ditto.
(rb_to_UTF_16LE): ditto.
(rb_from_UTF_32BE): ditto.
(rb_to_UTF_32BE): ditto.
(rb_from_UTF_32LE): ditto.
(rb_to_UTF_32LE): ditto.
* enc/trans/japanese.trans (fun_so_eucjp2sjis): take void* as a state
pointer.
(fun_so_sjis2eucjp): ditto.
(rb_eucjp2sjis): provide state size/init/fini.
(rb_sjis2eucjp): provide state size/init/fini.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/trans/utf_16_32.trans')
-rw-r--r-- | enc/trans/utf_16_32.trans | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/enc/trans/utf_16_32.trans b/enc/trans/utf_16_32.trans index 57cd77dd7..9ffff341a 100644 --- a/enc/trans/utf_16_32.trans +++ b/enc/trans/utf_16_32.trans @@ -38,7 +38,7 @@ <%= transcode_generated_code %> static int -fun_so_from_utf_16be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_from_utf_16be(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!s[0] && s[1]<0x80) { o[0] = s[1]; @@ -66,7 +66,7 @@ fun_so_from_utf_16be(rb_transcoding* t, const unsigned char* s, size_t l, unsign } static int -fun_so_to_utf_16be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_to_utf_16be(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!(s[0]&0x80)) { o[0] = 0x00; @@ -94,7 +94,7 @@ fun_so_to_utf_16be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned } static int -fun_so_from_utf_16le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_from_utf_16le(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!s[1] && s[0]<0x80) { o[0] = s[0]; @@ -122,7 +122,7 @@ fun_so_from_utf_16le(rb_transcoding* t, const unsigned char* s, size_t l, unsign } static int -fun_so_to_utf_16le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_to_utf_16le(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!(s[0]&0x80)) { o[1] = 0x00; @@ -150,7 +150,7 @@ fun_so_to_utf_16le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned } static int -fun_so_from_utf_32be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_from_utf_32be(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!s[1]) { if (s[2]==0 && s[3]<0x80) { @@ -179,7 +179,7 @@ fun_so_from_utf_32be(rb_transcoding* t, const unsigned char* s, size_t l, unsign } static int -fun_so_to_utf_32be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_to_utf_32be(void *statep, const unsigned char *s, size_t l, unsigned char *o) { o[0] = 0; if (!(s[0]&0x80)) { @@ -205,7 +205,7 @@ fun_so_to_utf_32be(rb_transcoding* t, const unsigned char* s, size_t l, unsigned } static int -fun_so_from_utf_32le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_from_utf_32le(void *statep, const unsigned char *s, size_t l, unsigned char *o) { if (!s[2]) { if (s[1]==0 && s[0]<0x80) { @@ -234,7 +234,7 @@ fun_so_from_utf_32le(rb_transcoding* t, const unsigned char* s, size_t l, unsign } static int -fun_so_to_utf_32le(rb_transcoding* t, const unsigned char* s, size_t l, unsigned char* o) +fun_so_to_utf_32le(void *statep, const unsigned char *s, size_t l, unsigned char *o) { o[3] = 0; if (!(s[0]&0x80)) { @@ -267,6 +267,7 @@ rb_from_UTF_16BE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_from_utf_16be }; @@ -278,6 +279,7 @@ rb_to_UTF_16BE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_to_utf_16be }; @@ -289,6 +291,7 @@ rb_from_UTF_16LE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_from_utf_16le }; @@ -300,6 +303,7 @@ rb_to_UTF_16LE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_to_utf_16le }; @@ -311,6 +315,7 @@ rb_from_UTF_32BE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_from_utf_32be }; @@ -322,6 +327,7 @@ rb_to_UTF_32BE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_to_utf_32be }; @@ -333,6 +339,7 @@ rb_from_UTF_32LE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_from_utf_32le }; @@ -344,6 +351,7 @@ rb_to_UTF_32LE = { 4, /* max_input */ 4, /* max_output */ stateless_converter, /* stateful_type */ + 0, NULL, NULL, /* state_size, state_init, state_fini */ NULL, NULL, NULL, fun_so_to_utf_32le }; |