diff options
author | Tom Tromey <tromey@redhat.com> | 2003-01-22 20:51:55 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-01-22 20:51:55 +0000 |
commit | 3e895978eef47edaf67b59f02d9f847c55ac26dc (patch) | |
tree | b7d7c4804e0025ba42eee223253a8402fbee444d /gcc/java/jcf-io.c | |
parent | 7e657a61177515aa1836f3f168c7765096f74610 (diff) | |
download | gcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.zip gcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.tar.gz gcc-3e895978eef47edaf67b59f02d9f847c55ac26dc.tar.bz2 |
gcj.texi (Input and output files): Mention non-class entries.
* gcj.texi (Input and output files): Mention non-class entries.
* decl.c (java_init_decl_processing): Call
init_resource_processing.
* java-tree.h (compile_resource_data, write_resource_constructor,
compile_resource_file, init_resource_processing): Declare.
* config-lang.in (gtfiles): Added resource.c.
* Make-lang.in (gt-java-resource.h): New target.
(JAVA_OBJS): Added resource.o.
(java/resource.o): New target.
* resource.c: New file.
* class.c (compile_resource_file): Moved to resource.c.
(registerResource_libfunc): Likewise.
(utf8_decl_list): Mark with GTY; now static.
* jcf-parse.c (classify_zip_file): New function.
(parse_zip_file_entries): Use it; compile .properties files.
(process_zip_dir): Use classify_zip_file and compute_class_name.
Don't write class name into zip directory.
(java_parse_file): Call write_resource_constructor.
(compute_class_name): New function.
* jcf-io.c (read_zip_member): Reindented.
From-SVN: r61614
Diffstat (limited to 'gcc/java/jcf-io.c')
-rw-r--r-- | gcc/java/jcf-io.c | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c index abc2073..5d6ef25 100644 --- a/gcc/java/jcf-io.c +++ b/gcc/java/jcf-io.c @@ -186,48 +186,48 @@ open_in_zip (JCF *jcf, const char *zipfile, const char *zipmember, int read_zip_member (JCF *jcf, ZipDirectory *zipd, ZipFile *zipf) { - jcf->filbuf = jcf_unexpected_eof; - jcf->zipd = (void *)zipd; + jcf->filbuf = jcf_unexpected_eof; + jcf->zipd = (void *)zipd; - if (zipd->compression_method == Z_NO_COMPRESSION) - { - jcf->buffer = ALLOC (zipd->size); - jcf->buffer_end = jcf->buffer + zipd->size; - jcf->read_ptr = jcf->buffer; - jcf->read_end = jcf->buffer_end; - if (lseek (zipf->fd, zipd->filestart, 0) < 0 - || read (zipf->fd, jcf->buffer, zipd->size) != (long) zipd->size) - return -2; - } - else - { - char *buffer; - z_stream d_stream; /* decompression stream */ - d_stream.zalloc = (alloc_func) 0; - d_stream.zfree = (free_func) 0; - d_stream.opaque = (voidpf) 0; - - jcf->buffer = ALLOC (zipd->uncompressed_size); - d_stream.next_out = jcf->buffer; - d_stream.avail_out = zipd->uncompressed_size; - jcf->buffer_end = jcf->buffer + zipd->uncompressed_size; - jcf->read_ptr = jcf->buffer; - jcf->read_end = jcf->buffer_end; - buffer = ALLOC (zipd->size); - d_stream.next_in = buffer; - d_stream.avail_in = zipd->size; - if (lseek (zipf->fd, zipd->filestart, 0) < 0 - || read (zipf->fd, buffer, zipd->size) != (long) zipd->size) - return -2; - /* Handle NO_HEADER using undocumented zlib feature. - This is a very common hack. */ - inflateInit2 (&d_stream, -MAX_WBITS); - inflate (&d_stream, Z_NO_FLUSH); - inflateEnd (&d_stream); - FREE (buffer); - } + if (zipd->compression_method == Z_NO_COMPRESSION) + { + jcf->buffer = ALLOC (zipd->size); + jcf->buffer_end = jcf->buffer + zipd->size; + jcf->read_ptr = jcf->buffer; + jcf->read_end = jcf->buffer_end; + if (lseek (zipf->fd, zipd->filestart, 0) < 0 + || read (zipf->fd, jcf->buffer, zipd->size) != (long) zipd->size) + return -2; + } + else + { + char *buffer; + z_stream d_stream; /* decompression stream */ + d_stream.zalloc = (alloc_func) 0; + d_stream.zfree = (free_func) 0; + d_stream.opaque = (voidpf) 0; + + jcf->buffer = ALLOC (zipd->uncompressed_size); + d_stream.next_out = jcf->buffer; + d_stream.avail_out = zipd->uncompressed_size; + jcf->buffer_end = jcf->buffer + zipd->uncompressed_size; + jcf->read_ptr = jcf->buffer; + jcf->read_end = jcf->buffer_end; + buffer = ALLOC (zipd->size); + d_stream.next_in = buffer; + d_stream.avail_in = zipd->size; + if (lseek (zipf->fd, zipd->filestart, 0) < 0 + || read (zipf->fd, buffer, zipd->size) != (long) zipd->size) + return -2; + /* Handle NO_HEADER using undocumented zlib feature. + This is a very common hack. */ + inflateInit2 (&d_stream, -MAX_WBITS); + inflate (&d_stream, Z_NO_FLUSH); + inflateEnd (&d_stream); + FREE (buffer); + } - return 0; + return 0; } const char * |