summaryrefslogtreecommitdiffstats
path: root/g10/compress.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1998-02-12 15:39:08 +0100
committerWerner Koch <wk@gnupg.org>1998-02-12 15:39:08 +0100
commitfec94908c399bdcc68b61e9142a2e4602312936f (patch)
tree761673f7e6f57d2543143eda432781459b94cefa /g10/compress.c
parentbug fixes (diff)
downloadgnupg2-fec94908c399bdcc68b61e9142a2e4602312936f.tar.xz
gnupg2-fec94908c399bdcc68b61e9142a2e4602312936f.zip
added zlib and reorgnaized some stuff
Diffstat (limited to 'g10/compress.c')
-rw-r--r--g10/compress.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/g10/compress.c b/g10/compress.c
index c237b4ac7..7a1d9729f 100644
--- a/g10/compress.c
+++ b/g10/compress.c
@@ -25,9 +25,7 @@
#include <unistd.h>
#include <assert.h>
#include <errno.h>
-#ifdef HAVE_ZLIB_H
- #include <zlib.h>
-#endif
+#include <zlib.h>
#include "util.h"
#include "memory.h"
@@ -36,7 +34,6 @@
#include "options.h"
-#ifdef HAVE_ZLIB_H
static void
init_compress( compress_filter_context_t *zfx, z_stream *zs )
{
@@ -228,34 +225,6 @@ compress_filter( void *opaque, int control,
*(char**)buf = "compress_filter";
return rc;
}
-#else /* No ZLIB */
-int
-compress_filter( void *opaque, int control,
- IOBUF a, byte *buf, size_t *ret_len)
-{
- size_t size = *ret_len;
- int c, rc=0;
- size_t n;
-
- if( control == IOBUFCTRL_UNDERFLOW ) {
- for( n=0; n < size; n++ ) {
- if( (c=iobuf_get(a)) == -1 )
- break;
- buf[n] = c & 0xff;
- }
- if( !n )
- rc = -1;
- *ret_len = n;
- }
- else if( control == IOBUFCTRL_FLUSH ) {
- if( iobuf_write( a, buf, size ) )
- rc = G10ERR_WRITE_FILE;
- }
- else if( control == IOBUFCTRL_DESC )
- *(char**)buf = "dummy compress_filter";
- return rc;
-}
-#endif /*no ZLIB*/
/****************
* Handle a compressed packet