From 3d0c7bea4d2ad108889d0c4d81d41c4ff03f2a77 Mon Sep 17 00:00:00 2001 From: duerst Date: Sun, 20 Jan 2008 06:12:48 +0000 Subject: Sun Jan 20 15:08:08 2008 Martin Duerst * enc/trans/utf_16_32.c: new file, currently implementing UTF-16BE conversions only. * test/ruby/test_transcode.rb: Added tests for UTF-16BE; made check_both_ways() use force_encoding differently. * transcode_data.h, transcode.c: Support for more conversion functions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode_data.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'transcode_data.h') diff --git a/transcode_data.h b/transcode_data.h index 65929390b9..8d0c8ccf33 100644 --- a/transcode_data.h +++ b/transcode_data.h @@ -35,6 +35,9 @@ typedef struct byte_lookup { #define UNDEF (PType 0x09) /* legal but undefined */ #define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */ #define FUNii (PType 0x0B) /* function from info to info */ +#define FUNsi (PType 0x0D) /* function from start to info */ +#define FUNio (PType 0x0E) /* function from info to output */ +#define FUNso (PType 0x0F) /* function from start to output */ #define o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt)) #define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt)) @@ -72,7 +75,10 @@ typedef struct rb_transcoder { struct rb_transcoder *, struct rb_transcoding *); void (*postprocessor)(char**, char**, char*, char*, struct rb_transcoder *, struct rb_transcoding *); - VALUE (*func_ii)(VALUE); /* function from info to info */ + VALUE (*func_ii)(VALUE); /* info -> info */ + VALUE (*func_si)(const unsigned char* const); /* start -> info */ + int (*func_io)(VALUE, const unsigned char*); /* info -> output */ + int (*func_so)(const unsigned char*, unsigned char*); /* start -> output */ } rb_transcoder; void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib); -- cgit v1.2.3