aboutsummaryrefslogtreecommitdiffstats
path: root/transcode_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/transcode_data.h b/transcode_data.h
index 862e37eae5..6d3d210cbe 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -27,24 +27,27 @@ typedef struct byte_lookup {
#define PType (const BYTE_LOOKUP *)
#endif
-#define NOMAP (PType 0x01) /* single byte direct map */
-#define ONEbt (0x02) /* one byte payload */
-#define TWObt (0x03) /* two bytes payload */
-#define THREEbt (0x05) /* three bytes payload */
-#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
-#define INVALID (PType 0x07) /* invalid byte sequence */
-#define UNDEF (PType 0x09) /* legal but undefined */
-#define ZERObt (PType 0x0A) /* zero bytes of payload, i.e. remove */
-
-#define o1(b1) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|ONEbt))
-#define o2(b1,b2) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
-#define o3(b1,b2,b3) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt))
-#define o4(b0,b1,b2,b3) ((const BYTE_LOOKUP *)((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt))
-
-#define getBT1(a) (((a)>> 8)&0xFF)
-#define getBT2(a) (((a)>>16)&0xFF)
-#define getBT3(a) (((a)>>24)&0xFF)
-#define getBT0(a) ((((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
+#define NOMAP (PType 0x01) /* single byte direct map */
+#define ONEbt (0x02) /* one byte payload */
+#define TWObt (0x03) /* two bytes payload */
+#define THREEbt (0x05) /* three bytes payload */
+#define FOURbt (0x06) /* four bytes payload, UTF-8 only, macros start at getBT0 */
+#define INVALID (PType 0x07) /* invalid byte sequence */
+#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 o1(b1) (PType((((unsigned char)(b1))<<8)|ONEbt))
+#define o2(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|TWObt))
+#define o3(b1,b2,b3) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|THREEbt))
+#define o4(b0,b1,b2,b3) (PType((((unsigned char)(b1))<< 8)|(((unsigned char)(b2))<<16)|(((unsigned char)(b3))<<24)|((((unsigned char)(b0))&0x07)<<5)|FOURbt))
+
+#define getBT1(a) (((a)>> 8)&0xFF)
+#define getBT2(a) (((a)>>16)&0xFF)
+#define getBT3(a) (((a)>>24)&0xFF)
+#define getBT0(a) ((((a)>> 5)&0x07)|0xF0) /* for UTF-8 only!!! */
+
+#define o2FUNii(b1,b2) (PType((((unsigned char)(b1))<<8)|(((unsigned char)(b2))<<16)|FUNii))
/* do we need these??? maybe not, can be done with simple tables */
#define ONETRAIL /* legal but undefined if one more trailing UTF-8 */
@@ -70,6 +73,7 @@ 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 */
} rb_transcoder;
void rb_declare_transcoder(const char *enc1, const char *enc2, const char *lib);