summaryrefslogtreecommitdiff
path: root/transcode_data.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-07 14:53:30 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-07 14:53:30 +0000
commit1504652373a16c8e7eb5d59894c83572ac72b5e7 (patch)
tree369ab68905e8fd3d61f440a4b56e4781d433efde /transcode_data.h
parent05373c446902ace063b1ff5caf2236004e7bc763 (diff)
* transcode_data.h (rb_transcoding): new field "stateful".
(rb_transcoder): preprocessor and postprocessor field removed. change arguments of func_ii, func_si, func_io and func_so. new field "finish_func". * tool/transcode-tblgen.rb: make FUNii, FUNsi and FUNio generatable. * transcode.c (transcoder_lib_table): removed. (transcoder_table): change structure. (transcoder_key): removed because the above structure change. (make_transcoder_entry): new function. (get_transcoder_entry): ditto. (rb_register_transcoder): follow the structure change. (declare_transcoder): ditto. (transcode_search_path): new function for breadth first search to find a list of converters. (transcode_search_path_i): new function. (transcode_dispatch_cb): ditto. (transcode_dispatch): use transcode_search_path. (transcode_loop): follow the argument change. (str_transcode): preprocessor and postprocessor stuff removed. * enc/trans/iso2022.erb.c: new file. ISO-2022-JP conversion re-implemented. * enc/trans/japanese.erb.c: ISO-2022-JP stuff removed. nute(23:52:53)% head -40 ChangeLog Thu Aug 7 23:43:11 2008 Tanaka Akira <akr@fsij.org> * transcode_data.h (rb_transcoding): new field "stateful". (rb_transcoder): preprocessor and postprocessor field removed. change arguments of func_ii, func_si, func_io and func_so. new field "finish_func". * tool/transcode-tblgen.rb: make FUNii, FUNsi and FUNio generatable. * transcode.c (transcoder_lib_table): removed. (transcoder_table): change structure. (transcoder_key): removed because the above structure change. (make_transcoder_entry): new function. (get_transcoder_entry): ditto. (rb_register_transcoder): follow the structure change. (declare_transcoder): ditto. (transcode_search_path): new function for breadth first search to find a list of converters. (transcode_search_path_i): new function. (transcode_dispatch_cb): ditto. (transcode_dispatch): use transcode_search_path. (transcode_loop): follow the argument change. (str_transcode): preprocessor and postprocessor stuff removed. * enc/trans/iso2022.erb.c: new file. ISO-2022-JP conversion re-implemented. * enc/trans/japanese.erb.c: ISO-2022-JP stuff removed. * enc/trans/utf_16_32.erb.c: follow argument change of FUNso. [ruby-dev:35798] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/transcode_data.h b/transcode_data.h
index 3fecaf6..92f8ade 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -63,6 +63,8 @@ typedef struct rb_transcoding {
VALUE ruby_string_dest; /* the String used as the conversion destination,
or NULL if something else is being converted */
unsigned char *(*flush_func)(struct rb_transcoding*, int, int);
+
+ unsigned char stateful[256]; /* opaque data for stateful encoding */
} rb_transcoding;
/* static structure, one per supported encoding pair */
@@ -72,12 +74,11 @@ typedef struct rb_transcoder {
const BYTE_LOOKUP *conv_tree_start;
int max_output;
int from_utf8;
- void (*preprocessor)(const unsigned char**, unsigned char**, const unsigned char*, unsigned char*, struct rb_transcoding *);
- void (*postprocessor)(const unsigned char**, unsigned char**, const unsigned char*, unsigned char*, struct rb_transcoding *);
- VALUE (*func_ii)(VALUE); /* info -> info */
- VALUE (*func_si)(const unsigned char *); /* start -> info */
- int (*func_io)(VALUE, const unsigned char*); /* info -> output */
- int (*func_so)(const unsigned char*, unsigned char*); /* start -> output */
+ VALUE (*func_ii)(rb_transcoding*, VALUE); /* info -> info */
+ VALUE (*func_si)(rb_transcoding*, const unsigned char*, size_t); /* start -> info */
+ int (*func_io)(rb_transcoding*, VALUE, const unsigned char*); /* info -> output */
+ int (*func_so)(rb_transcoding*, const unsigned char*, size_t, unsigned char*); /* start -> output */
+ int (*finish_func)(rb_transcoding*, unsigned char*); /* -> output */
} rb_transcoder;
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);