mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
How with some assembly support
This commit is contained in:
parent
a0196dfb18
commit
9479cf7e24
23 changed files with 2497 additions and 178 deletions
|
@ -27,8 +27,6 @@
|
|||
#include <errno.h>
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
#else
|
||||
#error You need ZLIB to compile this module
|
||||
#endif
|
||||
|
||||
#include "util.h"
|
||||
|
@ -38,6 +36,7 @@
|
|||
#include "options.h"
|
||||
|
||||
|
||||
#ifdef HAVE_ZLIB_H
|
||||
static void
|
||||
init_compress( compress_filter_context_t *zfx, z_stream *zs )
|
||||
{
|
||||
|
@ -163,7 +162,6 @@ do_uncompress( compress_filter_context_t *zfx, z_stream *zs,
|
|||
return rc;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
compress_filter( void *opaque, int control,
|
||||
IOBUF a, byte *buf, size_t *ret_len)
|
||||
|
@ -228,6 +226,35 @@ 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;
|
||||
compress_filter_context_t *zfx = opaque;
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue