diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-26 00:01:46 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-10-26 00:01:46 +0000 |
commit | ec4dbf8341011f317ae486fa9dca0f03c16d345a (patch) | |
tree | 76ca02ecce99066ffcf0c9dd82a4c07d5eff2edc /gcc/java/lex.h | |
parent | 1ab502661544584bb8b0e37fd6f4c9e6a12ebe8b (diff) | |
download | gcc-ec4dbf8341011f317ae486fa9dca0f03c16d345a.tar.gz |
* lex.c (java_new_lexer): Initialize new fields. Work around
broken iconv() implementations.
(java_read_char): Swap bytes if required. Use fallback decoder if
required.
(byteswap_init, need_byteswap): New globals.
(java_destroy_lexer): Only close iconv handle if it is in use.
* lex.h (java_lexer): New fields read_anything, byte_swap,
use_fallback.
Made out_buffer unsigned.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/lex.h')
-rw-r--r-- | gcc/java/lex.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/java/lex.h b/gcc/java/lex.h index 71a030d2fef..ae9eebb68e5 100644 --- a/gcc/java/lex.h +++ b/gcc/java/lex.h @@ -115,6 +115,16 @@ typedef struct java_lexer unicode_t unget_value; #ifdef HAVE_ICONV + /* Nonzero if we've read any bytes. We only recognize the + byte-order-marker (BOM) as the first word. */ + int read_anything : 1; + + /* Nonzero if we have to byte swap. */ + int byte_swap : 1; + + /* Nonzero if we're using the fallback decoder. */ + int use_fallback : 1; + /* The handle for the iconv converter we're using. */ iconv_t handle; @@ -132,7 +142,7 @@ typedef struct java_lexer /* This is a buffer of characters already converted by iconv. We use `char' here because we're assuming that iconv() converts to big-endian UCS-2, and then we convert it ourselves. */ - char out_buffer[1024]; + unsigned char out_buffer[1024]; /* Index of first valid output character. -1 if no valid characters. */ |