summaryrefslogtreecommitdiff
path: root/transcode_data.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-10 02:17:56 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-10 02:17:56 (GMT)
commite748ed513d1fc079513a3ae9905705f579d351a4 (patch)
tree2171a5a98d88da50480ebeaab8de82c39af17ef1 /transcode_data.h
parent3ba7984ef4dfc88c7a764a24dd50aad026a7b56d (diff)
* transcode_data.h (rb_transcoding): add feedlen field.
* transcode.c (transcode_restartable0): renamed from transcode_restartable. save input buffer into feed buffer if next character is started the point before input buffer. for example, "\x00\xd8\x01" then "\x02" in UTF-16LE. \x02 causes invalid and next character is started from \x01. (transcode_restartable): new function to call transcode_restartable0. if feed buffer is not empty, convert it at first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode_data.h')
-rw-r--r--transcode_data.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/transcode_data.h b/transcode_data.h
index ad20a0b..42c3b2d 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -65,11 +65,12 @@ typedef struct rb_transcoding {
const BYTE_LOOKUP *next_table;
VALUE next_info;
unsigned char next_byte;
- int readlen;
+ int readlen; /* already interpreted */
+ int feedlen; /* not yet interpreted */
union {
unsigned char ary[8]; /* max_input <= sizeof(ary) */
unsigned char *ptr; /* length is max_input */
- } readbuf;
+ } readbuf; /* readlen + feedlen used */
unsigned char stateful[256]; /* opaque data for stateful encoding */
} rb_transcoding;