PatchSet 7726 Date: 2008/02/02 15:10:25 Author: robilad Branch: HEAD Tag: (none) Log: removed zlib inflater and deflater
2008-02-02 Dalibor Topic <[EMAIL PROTECTED]> * libraries/javalib/zlib-zip/org/kaffe/util/Assert.java, libraries/javalib/zlib-zip/org/kaffe/util/UTF8.java, libraries/javalib/zlib-zip/org/kaffe/util/zip/SwitchInflater.java, libraries/clib/zip/Inflater.c, libraries/clib/zip/Deflater.c, libraries/javalib/zlib-zip/java/util/zip/Inflater.java, libraries/javalib/zlib-zip/java/util/zip/Deflater.java: Removed. * libraries/clib/zip/Makefile.am (libzip_la_SOURCES): Removed Inflater.c and Deflater.c. * libraries/javalib/zlib-zip/Makefile.am (dist_zlib_JAVA): Removed org/kaffe/util/Assert.java, org/kaffe/util/UTF8.java, org/kaffe/util/zip/SwitchInflater.java, java/util/zip/Inflater.java, java/util/zip/Deflater.java. Members: ChangeLog:1.5227->1.5228 libraries/clib/zip/Deflater.c:1.20->1.21(DEAD) libraries/clib/zip/Inflater.c:1.19->1.20(DEAD) libraries/clib/zip/Makefile.am:1.21->1.22 libraries/clib/zip/Makefile.in:1.206->1.207 libraries/javalib/zlib-zip/Makefile.am:1.10->1.11 libraries/javalib/zlib-zip/Makefile.in:1.30->1.31 libraries/javalib/zlib-zip/java/util/zip/Deflater.java:1.1->1.2(DEAD) libraries/javalib/zlib-zip/java/util/zip/Inflater.java:1.1->1.2(DEAD) libraries/javalib/zlib-zip/org/kaffe/util/Assert.java:1.1->1.2(DEAD) libraries/javalib/zlib-zip/org/kaffe/util/UTF8.java:1.1->1.2(DEAD) libraries/javalib/zlib-zip/org/kaffe/util/zip/SwitchInflater.java:1.1->1.2(DEAD) Index: kaffe/ChangeLog diff -u kaffe/ChangeLog:1.5227 kaffe/ChangeLog:1.5228 --- kaffe/ChangeLog:1.5227 Sat Feb 2 14:59:31 2008 +++ kaffe/ChangeLog Sat Feb 2 15:10:25 2008 @@ -1,5 +1,25 @@ 2008-02-02 Dalibor Topic <[EMAIL PROTECTED]> + + * libraries/javalib/zlib-zip/org/kaffe/util/Assert.java, + libraries/javalib/zlib-zip/org/kaffe/util/UTF8.java, + libraries/javalib/zlib-zip/org/kaffe/util/zip/SwitchInflater.java, + libraries/clib/zip/Inflater.c, + libraries/clib/zip/Deflater.c, + libraries/javalib/zlib-zip/java/util/zip/Inflater.java, + libraries/javalib/zlib-zip/java/util/zip/Deflater.java: + Removed. + + * libraries/clib/zip/Makefile.am (libzip_la_SOURCES): + Removed Inflater.c and Deflater.c. + + * libraries/javalib/zlib-zip/Makefile.am (dist_zlib_JAVA): + Removed org/kaffe/util/Assert.java, org/kaffe/util/UTF8.java, + org/kaffe/util/zip/SwitchInflater.java, java/util/zip/Inflater.java, + java/util/zip/Deflater.java. + +2008-02-02 Dalibor Topic <[EMAIL PROTECTED]> + * libraries/javalib/zlib-zip/java/util/zip/DeflaterOutputStream.java: Removed. =================================================================== Checking out kaffe/libraries/clib/zip/Deflater.c RCS: /home/cvs/kaffe/kaffe/libraries/clib/zip/Attic/Deflater.c,v VERS: 1.20 *************** --- kaffe/libraries/clib/zip/Deflater.c Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,189 +0,0 @@ -/* - * java.util.zip.Deflater.c - * - * Copyright (c) 1996, 1997 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - */ - -#define DBG(s) -#include "config.h" -#include "config-std.h" -#include "config-mem.h" -#include <native.h> -#include "java_util_zip_Deflater.h" - -#include <zlib.h> - -#define WSIZE 0x8000 -#define WSIZEBITS 15 - -static inline -z_stream* -getStream(struct Hjava_util_zip_Deflater* this) -{ - return *(z_stream**)&unhand(this)->strm; -} - -static inline -void -setStream(struct Hjava_util_zip_Deflater* this, z_stream* stream) -{ - *(z_stream**)&unhand(this)->strm = stream; -} - -void -java_util_zip_Deflater_setDictionary(struct Hjava_util_zip_Deflater* this, HArrayOfByte* buf, jint from, jint len) -{ - int r; - z_stream* dstream; - - dstream = getStream(this); - - // XXX What happens if out of bounds ? - if (from >= 0 && len > 0 && from + len <= obj_length(buf)) { - void* dictionary = &unhand_array(buf)->body[from]; - r = deflateSetDictionary (dstream, dictionary, (unsigned)len); - if (r < 0) { - SignalError("java.lang.Error", dstream->msg ? dstream->msg : "unknown error"); - } - } -} - -jint -java_util_zip_Deflater_deflate(struct Hjava_util_zip_Deflater* this, HArrayOfByte* buf, jint off, jint len) -{ - int r; - int ilen; - z_stream* dstream; - void* next_available_input = &unhand_array(unhand(this)->buf)->body[unhand(this)->off]; - void* next_available_output = &unhand_array(buf)->body[off]; - - dstream = getStream(this); - - ilen = unhand(this)->len; - - dstream->next_in = next_available_input; - dstream->avail_in = ilen; - - dstream->next_out = next_available_output; - dstream->avail_out = len; - - r = deflate(dstream, unhand(this)->finish ? Z_FINISH : Z_NO_FLUSH); - -DBG( dprintf("Deflate: in %d left %d out %d status %d\n", ilen, dstream->avail_in, len - dstream->avail_out, r); ) - - switch (r) { - case Z_OK: - break; - - case Z_STREAM_END: - unhand(this)->finished = 1; - break; - - case Z_MEM_ERROR: - { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - - default: - SignalError("java.lang.Error", dstream->msg ? dstream->msg : "unknown error"); - } - - unhand(this)->off += (ilen - dstream->avail_in); - unhand(this)->len = dstream->avail_in; - - return (len - dstream->avail_out); -} - -jint -java_util_zip_Deflater_getAdler(struct Hjava_util_zip_Deflater* this) -{ - return (getStream(this)->adler); -} - -jint -java_util_zip_Deflater_getTotalIn(struct Hjava_util_zip_Deflater* this) -{ - return (getStream(this)->total_in); -} - -jint -java_util_zip_Deflater_getTotalOut(struct Hjava_util_zip_Deflater* this) -{ - return (getStream(this)->total_out); -} - -void -java_util_zip_Deflater_reset(struct Hjava_util_zip_Deflater* this) -{ - deflateReset(getStream(this)); - - unhand(this)->finish = 0; - unhand(this)->finished = 0; -} - -void -java_util_zip_Deflater_end(struct Hjava_util_zip_Deflater* this) -{ - z_stream* dstream; - - dstream = getStream(this); - setStream(this, NULL); - - deflateEnd(dstream); - KFREE(dstream); -} - -static voidpf -kaffe_zalloc(voidpf opaque UNUSED, uInt items, uInt size) { - /* allocate through the garbage collector interface */ - return KMALLOC(items*size); -} - -static void -kaffe_zfree(voidpf opaque UNUSED, voidpf address) { - /* dispose through the garbage collector interface */ - KFREE(address); -} - -void -java_util_zip_Deflater_init(struct Hjava_util_zip_Deflater* this, jboolean val) -{ - int r; - z_stream* dstream; - - dstream = KMALLOC(sizeof(*dstream)); - if (!dstream) { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - dstream->next_in = NULL; - dstream->zalloc = kaffe_zalloc; - dstream->zfree = kaffe_zfree; - dstream->opaque = NULL; - - r = deflateInit2(dstream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, (val ? -WSIZEBITS : WSIZEBITS), 9, Z_DEFAULT_STRATEGY); - - switch (r) { - case Z_OK: - break; - - case Z_MEM_ERROR: - { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - - default: - SignalError("java.lang.Error", dstream->msg ? dstream->msg : ""); - } - - setStream(this, dstream); -} =================================================================== Checking out kaffe/libraries/clib/zip/Inflater.c RCS: /home/cvs/kaffe/kaffe/libraries/clib/zip/Attic/Inflater.c,v VERS: 1.19 *************** --- kaffe/libraries/clib/zip/Inflater.c Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,188 +0,0 @@ -/* - * java.util.zip.Inflater.c - * - * Copyright (c) 1996, 1997 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - */ - -#include "config.h" -#include "config-std.h" -#include "config-mem.h" -#include <native.h> -#include "java_util_zip_Inflater.h" - -#include <zlib.h> - -#define WSIZE 0x8000 -#define WSIZEBITS 15 - -#define MAXSTREAM 16 - -static inline -z_stream* -getStream(struct Hjava_util_zip_Inflater* this) -{ - return *(z_stream**)&unhand(this)->strm; -} - -static inline -void -setStream(struct Hjava_util_zip_Inflater* this, z_stream* stream) -{ - *(z_stream**)&unhand(this)->strm = stream; -} - -void -java_util_zip_Inflater_setDictionary(struct Hjava_util_zip_Inflater* this, HArrayOfByte* buf, jint from, jint len) -{ - int r; - z_stream* dstream; - - dstream = getStream(this); - // XXX What happens if out of bounds ? - if (from >= 0 && len > 0 && from + len <= obj_length(buf)) { - void* dictionary = &unhand_array(buf)->body[from]; - r = inflateSetDictionary (dstream, dictionary, (unsigned)len); - if (r < 0) { - SignalError("java.lang.Error", dstream->msg ? dstream->msg : "unknown error"); - } - } -} - -jint -java_util_zip_Inflater_inflate0(struct Hjava_util_zip_Inflater* this, HArrayOfByte* buf, jint off, jint len) -{ - int r; - int ilen; - z_stream* dstream; - void* next_available_input = &unhand_array(unhand(this)->buf)->body[unhand(this)->off]; - void* next_available_output = &unhand_array(buf)->body[off]; - - dstream = getStream(this); - - ilen = unhand(this)->len; - - dstream->next_in = next_available_input; - dstream->avail_in = ilen; - - dstream->next_out = next_available_output; - dstream->avail_out = len; - - r = inflate(dstream, Z_SYNC_FLUSH); - - switch (r) { - case Z_OK: - break; - - case Z_STREAM_END: - unhand(this)->finished = 1; - break; - - case Z_NEED_DICT: - unhand(this)->needsDictionary = 1; - break; - - case Z_MEM_ERROR: - { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - - default: - SignalError("java.lang.Error", dstream->msg ? dstream->msg : "unknown error"); - } - - unhand(this)->off += (ilen - dstream->avail_in); - unhand(this)->len = dstream->avail_in; - - return (len - dstream->avail_out); -} - -jint -java_util_zip_Inflater_getAdler(struct Hjava_util_zip_Inflater* this) -{ - return (getStream(this)->adler); -} - -jint -java_util_zip_Inflater_getTotalIn(struct Hjava_util_zip_Inflater* this) -{ - return (getStream(this)->total_in); -} - -jint -java_util_zip_Inflater_getTotalOut(struct Hjava_util_zip_Inflater* this) -{ - return (getStream(this)->total_out); -} - -void -java_util_zip_Inflater_reset(struct Hjava_util_zip_Inflater* this) -{ - inflateReset(getStream(this)); - - unhand(this)->finished = 0; - unhand(this)->len = 0; -} - -void -java_util_zip_Inflater_end(struct Hjava_util_zip_Inflater* this) -{ - z_stream* dstream; - - dstream = getStream(this); - inflateEnd(dstream); - KFREE(dstream); -} - -static voidpf -kaffe_zalloc(voidpf opaque UNUSED, uInt items, uInt size) { - /* allocate through the garbage collector interface */ - return KMALLOC(items*size); -} - -static void -kaffe_zfree(voidpf opaque UNUSED, voidpf address) { - /* dispose through the garbage collector interface */ - KFREE(address); -} - -void -java_util_zip_Inflater_init(struct Hjava_util_zip_Inflater* this, jboolean val) -{ - int r; - z_stream* dstream; - - dstream = KMALLOC(sizeof(z_stream)); - if (!dstream) { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - dstream->next_out = NULL; - dstream->zalloc = kaffe_zalloc; - dstream->zfree = kaffe_zfree; - dstream->opaque = NULL; - - r = inflateInit2(dstream, val ? -WSIZEBITS : WSIZEBITS); - - switch (r) { - case Z_OK: - break; - - case Z_MEM_ERROR: - { - errorInfo info; - postOutOfMemory(&info); - throwError(&info); - } - - default: - SignalError("java.lang.Error", dstream->msg ? dstream->msg : ""); - } - setStream(this, dstream); -} Index: kaffe/libraries/clib/zip/Makefile.am diff -u kaffe/libraries/clib/zip/Makefile.am:1.21 kaffe/libraries/clib/zip/Makefile.am:1.22 --- kaffe/libraries/clib/zip/Makefile.am:1.21 Sat Feb 2 01:08:41 2008 +++ kaffe/libraries/clib/zip/Makefile.am Sat Feb 2 15:10:26 2008 @@ -31,8 +31,6 @@ $(ZIP_LIBS) libzip_la_SOURCES = \ - Deflater.c \ - Inflater.c \ ZipFile.c CLEANFILES = so_locations Index: kaffe/libraries/clib/zip/Makefile.in diff -u kaffe/libraries/clib/zip/Makefile.in:1.206 kaffe/libraries/clib/zip/Makefile.in:1.207 --- kaffe/libraries/clib/zip/Makefile.in:1.206 Sat Feb 2 01:08:41 2008 +++ kaffe/libraries/clib/zip/Makefile.in Sat Feb 2 15:10:26 2008 @@ -80,8 +80,7 @@ am__DEPENDENCIES_1 = libzip_la_DEPENDENCIES = $(top_builddir)/kaffe/kaffevm/libkaffe.la \ $(am__DEPENDENCIES_1) -am_libzip_la_OBJECTS = libzip_la-Deflater.lo libzip_la-Inflater.lo \ - libzip_la-ZipFile.lo +am_libzip_la_OBJECTS = libzip_la-ZipFile.lo libzip_la_OBJECTS = $(am_libzip_la_OBJECTS) libzip_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libzip_la_CFLAGS) \ @@ -327,8 +326,6 @@ $(ZIP_LIBS) libzip_la_SOURCES = \ - Deflater.c \ - Inflater.c \ ZipFile.c CLEANFILES = so_locations @@ -401,8 +398,6 @@ distclean-compile: -rm -f *.tab.c [EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ [EMAIL PROTECTED]@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ @AMDEP_TRUE@@am__include@ @[EMAIL PROTECTED]/$(DEPDIR)/[EMAIL PROTECTED]@ .c.o: @@ -425,20 +420,6 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -libzip_la-Deflater.lo: Deflater.c [EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzip_la_CFLAGS) $(CFLAGS) -MT libzip_la-Deflater.lo -MD -MP -MF $(DEPDIR)/libzip_la-Deflater.Tpo -c -o libzip_la-Deflater.lo `test -f 'Deflater.c' || echo '$(srcdir)/'`Deflater.c [EMAIL PROTECTED]@ mv -f $(DEPDIR)/libzip_la-Deflater.Tpo $(DEPDIR)/libzip_la-Deflater.Plo [EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='Deflater.c' object='libzip_la-Deflater.lo' libtool=yes @AMDEPBACKSLASH@ [EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ [EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzip_la_CFLAGS) $(CFLAGS) -c -o libzip_la-Deflater.lo `test -f 'Deflater.c' || echo '$(srcdir)/'`Deflater.c - -libzip_la-Inflater.lo: Inflater.c [EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzip_la_CFLAGS) $(CFLAGS) -MT libzip_la-Inflater.lo -MD -MP -MF $(DEPDIR)/libzip_la-Inflater.Tpo -c -o libzip_la-Inflater.lo `test -f 'Inflater.c' || echo '$(srcdir)/'`Inflater.c [EMAIL PROTECTED]@ mv -f $(DEPDIR)/libzip_la-Inflater.Tpo $(DEPDIR)/libzip_la-Inflater.Plo [EMAIL PROTECTED]@@am__fastdepCC_FALSE@ source='Inflater.c' object='libzip_la-Inflater.lo' libtool=yes @AMDEPBACKSLASH@ [EMAIL PROTECTED]@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ [EMAIL PROTECTED]@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzip_la_CFLAGS) $(CFLAGS) -c -o libzip_la-Inflater.lo `test -f 'Inflater.c' || echo '$(srcdir)/'`Inflater.c libzip_la-ZipFile.lo: ZipFile.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libzip_la_CFLAGS) $(CFLAGS) -MT libzip_la-ZipFile.lo -MD -MP -MF $(DEPDIR)/libzip_la-ZipFile.Tpo -c -o libzip_la-ZipFile.lo `test -f 'ZipFile.c' || echo '$(srcdir)/'`ZipFile.c Index: kaffe/libraries/javalib/zlib-zip/Makefile.am diff -u kaffe/libraries/javalib/zlib-zip/Makefile.am:1.10 kaffe/libraries/javalib/zlib-zip/Makefile.am:1.11 --- kaffe/libraries/javalib/zlib-zip/Makefile.am:1.10 Sat Feb 2 14:59:33 2008 +++ kaffe/libraries/javalib/zlib-zip/Makefile.am Sat Feb 2 15:10:27 2008 @@ -22,9 +22,5 @@ zlibdir = $(FAKE) dist_zlib_JAVA = \ - java/util/zip/Deflater.java \ - java/util/zip/Inflater.java \ - java/util/zip/ZipFile.java \ - org/kaffe/util/Assert.java \ - org/kaffe/util/UTF8.java \ - org/kaffe/util/zip/SwitchInflater.java + java/util/zip/ZipFile.java + Index: kaffe/libraries/javalib/zlib-zip/Makefile.in diff -u kaffe/libraries/javalib/zlib-zip/Makefile.in:1.30 kaffe/libraries/javalib/zlib-zip/Makefile.in:1.31 --- kaffe/libraries/javalib/zlib-zip/Makefile.in:1.30 Sat Feb 2 14:59:33 2008 +++ kaffe/libraries/javalib/zlib-zip/Makefile.in Sat Feb 2 15:10:27 2008 @@ -287,12 +287,7 @@ FAKE = fakeinstall zlibdir = $(FAKE) dist_zlib_JAVA = \ - java/util/zip/Deflater.java \ - java/util/zip/Inflater.java \ - java/util/zip/ZipFile.java \ - org/kaffe/util/Assert.java \ - org/kaffe/util/UTF8.java \ - org/kaffe/util/zip/SwitchInflater.java + java/util/zip/ZipFile.java all: all-am =================================================================== Checking out kaffe/libraries/javalib/zlib-zip/java/util/zip/Deflater.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/zlib-zip/java/util/zip/Attic/Deflater.java,v VERS: 1.1 *************** --- kaffe/libraries/javalib/zlib-zip/java/util/zip/Deflater.java Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,132 +0,0 @@ -/* - * Java core library component. - * - * Copyright (c) 1997, 1998 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - */ - -package java.util.zip; - -public class Deflater { - - static { - System.loadLibrary("zip"); - } - - public static final int DEFLATED = 8; - public static final int NO_COMPRESSION = 0; - public static final int BEST_SPEED = 1; - public static final int BEST_COMPRESSION = 9; - public static final int DEFAULT_COMPRESSION = -1; - public static final int FILTERED = 1; - public static final int HUFFMAN_ONLY = 2; - public static final int DEFAULT_STRATEGY = 0; - - private int strm; // The number of the deflater stream. - private byte[] buf; - private int off; - private int len; - private int level; - private int strategy; - private boolean finish; - private boolean finished; - - public Deflater(int lvl, boolean nowrap) - { - level = lvl; - buf = null; - len = 0; - off = 0; - strategy = DEFLATED; - finish = false; - finished = false; - init(nowrap); - } - - public Deflater(int level) - { - this(level, false); - } - - public Deflater() - { - this(DEFAULT_COMPRESSION, false); - } - - public synchronized void setInput(byte b[], int o, int l) - { - buf = b; - off = o; - len = l; - } - - public void setInput(byte b[]) - { - setInput(b, 0, b.length); - } - - public void setDictionary(byte b[]) - { - setDictionary(b, 0, b.length); - } - - public synchronized void setStrategy(int stgy) - { - if (stgy != DEFLATED) { - throw new IllegalArgumentException("only support deflation"); - } - strategy = stgy; - } - - public synchronized void setLevel(int lvl) - { - if ((level != DEFAULT_COMPRESSION) && (lvl < 0 || lvl > 9)) { - throw new IllegalArgumentException("levels 0-9 supported"); - } - level = lvl; - } - - public boolean needsInput() - { - return (len == 0 ? true : false); - } - - public synchronized void finish() - { - finish = true; - } - - public synchronized boolean finished() - { - return (finished); - } - - public int deflate(byte b[]) - { - return (deflate(b, 0, b.length)); - } - - protected void finalize() throws Throwable - { - /* We don't need to call super.finalize(), - * since super class is java.lang.Object, and - * java.lang.Object.finalize() just returns - * to caller. - */ - - end(); - } - - public native synchronized void setDictionary(byte b[], int off, int len); - public native synchronized int deflate(byte b[], int off, int len); - public native synchronized int getAdler(); - public native synchronized int getTotalIn(); - public native synchronized int getTotalOut(); - public native synchronized void reset(); - public native synchronized void end(); - private native synchronized void init(boolean nowrap); - -} =================================================================== Checking out kaffe/libraries/javalib/zlib-zip/java/util/zip/Inflater.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/zlib-zip/java/util/zip/Attic/Inflater.java,v VERS: 1.1 *************** --- kaffe/libraries/javalib/zlib-zip/java/util/zip/Inflater.java Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,111 +0,0 @@ -/* - * Java core library component. - * - * Copyright (c) 1997, 1998 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - */ - -package java.util.zip; - -public class Inflater { - - static { - System.loadLibrary("zip"); - } - - private int strm; - protected byte[] buf; - protected int off; - protected int len; - private boolean finished; - private boolean needsDictionary; - - public Inflater(boolean nowrap) - { - init(nowrap); - } - - public Inflater() - { - this(false); - } - - public synchronized void setInput(byte b[], int o, int l) - { - buf = b; - off = o; - len = l; - } - - public void setInput(byte b[]) - { - setInput(b, 0, b.length); - } - - public void setDictionary(byte b[]) - { - setDictionary(b, 0, b.length); - } - - public synchronized int getRemaining() - { - return (len); - } - - public synchronized boolean needsInput() - { - return (len == 0 && !finished()); - } - - public synchronized boolean needsDictionary() - { - return (needsDictionary); - } - - public synchronized boolean finished() - { - return (finished); - } - - public int inflate(byte b[]) throws DataFormatException - { - try { - return (inflate(b, 0, b.length)); - } - catch (NullPointerException _) { - throw new DataFormatException("null buffer"); - } - } - - public synchronized int inflate(byte b[], int off, int length) throws DataFormatException { - if (getRemaining() == 0) { - return 0; - } - - return inflate0(b, off, length); - } - - protected void finalize() throws Throwable - { - /* We don't need to call super.finalize(), - * since super class is java.lang.Object, and - * java.lang.Object.finalize() just returns - * to caller. - */ - - end(); - } - - public native synchronized void setDictionary(byte b[], int off, int len); - private native synchronized int inflate0(byte b[], int off, int len) throws DataFormatException; - public native synchronized int getAdler(); - public native synchronized int getTotalIn(); - public native synchronized int getTotalOut(); - public native synchronized void reset(); - private native synchronized void init(boolean nowrap); - public native synchronized void end(); - -} =================================================================== Checking out kaffe/libraries/javalib/zlib-zip/org/kaffe/util/Assert.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/zlib-zip/org/kaffe/util/Attic/Assert.java,v VERS: 1.1 *************** --- kaffe/libraries/javalib/zlib-zip/org/kaffe/util/Assert.java Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,129 +0,0 @@ -/* - * Java core library component. - * - * Copyright (c) 1997, 1998 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - */ - -package org.kaffe.util; - - -/** - * This class consists of static methods that perform assertion checks. - * If a check fails, we throw an error with a descriptive message. - */ -public class Assert { - private static final String MSG = "assertion failure"; - - /** - * Throw an error if not <code>true</code>. - * - * @param x The value to test - */ - public static void that(boolean x) { - if (!x) { - fail(); - } - } - - /** - * Throw an error if not <code>true</code>. - * - * @param x The value to test - * @param msg Description of the failure - */ - public static void that(boolean x, String msg) { - if (!x) { - fail(msg); - } - } - - /** - * Throw an error if equal to zero. - * - * @param x The value to test - */ - public static void that(long x) { - if (x == 0) { - fail(); - } - } - - /** - * Throw an error if equal to zero. - * - * @param x The value to test - * @param msg Description of the failure - */ - public static void that(long x, String msg) { - if (x == 0) { - fail(msg); - } - } - - /** - * Throw an error if equal to zero. - * - * @param x The value to test - */ - public static void that(double x) { - if (x == 0.0) { - fail(); - } - } - - /** - * Throw an error if equal to zero. - * - * @param x The value to test - * @param msg Description of the failure - */ - public static void that(double x, String msg) { - if (x == 0.0) { - fail(msg); - } - } - - /** - * Throw an error if equal to <code>null</code>. - * - * @param x The value to test - */ - public static void that(Object x) { - if (x == null) { - fail(); - } - } - - /** - * Throw an error if equal to <code>null</code>. - * - * @param x The value to test - * @param msg Description of the failure - */ - public static void that(Object x, String msg) { - if (x == null) { - fail(msg); - } - } - - /** - * Abort execution due to some failure. - */ - public static void fail() { - throw new Error(MSG); - } - - /** - * Abort execution due to some failure. - * - * @param msg Description of the failure - */ - public static void fail(String msg) { - throw new Error(msg == null ? MSG : MSG + ": " + msg); - } -} - =================================================================== Checking out kaffe/libraries/javalib/zlib-zip/org/kaffe/util/UTF8.java RCS: /home/cvs/kaffe/kaffe/libraries/javalib/zlib-zip/org/kaffe/util/Attic/UTF8.java,v VERS: 1.1 *************** --- kaffe/libraries/javalib/zlib-zip/org/kaffe/util/UTF8.java Sat Feb 2 15:14:37 2008 +++ /dev/null Sun Aug 4 19:57:58 2002 @@ -1,156 +0,0 @@ - -/* - * Java core library component. - * - * Copyright (c) 1999 - * Archie L. Cobbs. All rights reserved. - * Copyright (c) 1999 - * Transvirtual Technologies, Inc. All rights reserved. - * - * See the file "license.terms" for information on usage and redistribution - * of this file. - * - * Author: Archie L. Cobbs <[EMAIL PROTECTED]> - */ - -package org.kaffe.util; - -import java.io.ByteArrayInputStream; -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.IOException; -import java.io.UTFDataFormatException; - -// Indentation is set to two characters in this file for readability - -public final class UTF8 { - - // Not instantiable - private UTF8() { - } - *** Patch too long, truncated *** _______________________________________________ kaffe mailing list kaffe@kaffe.org http://kaffe.org/cgi-bin/mailman/listinfo/kaffe