From owner-svn-soc-all@FreeBSD.ORG Wed Aug 7 11:25:35 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 54BEF932 for ; Wed, 7 Aug 2013 11:25:35 +0000 (UTC) (envelope-from dpl@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33383237C for ; Wed, 7 Aug 2013 11:25:35 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r77BPZLB069928 for ; Wed, 7 Aug 2013 11:25:35 GMT (envelope-from dpl@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r77BPZQT069904 for svn-soc-all@FreeBSD.org; Wed, 7 Aug 2013 11:25:35 GMT (envelope-from dpl@FreeBSD.org) Date: Wed, 7 Aug 2013 11:25:35 GMT Message-Id: <201308071125.r77BPZQT069904@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to dpl@FreeBSD.org using -f From: dpl@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r255637 - in soc2013/dpl/head/lib/libzcap: . zlibworker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Aug 2013 11:25:35 -0000 Author: dpl Date: Wed Aug 7 11:25:34 2013 New Revision: 255637 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255637 Log: Corrected function declarations. Added a few command, after I have adapted the simple commands, only the hardest will remain. (Those are: gzread, gzwrite, gzprintf). Modified: soc2013/dpl/head/lib/libzcap/adler32.c soc2013/dpl/head/lib/libzcap/commands.c soc2013/dpl/head/lib/libzcap/crc32.c soc2013/dpl/head/lib/libzcap/gzlib.c soc2013/dpl/head/lib/libzcap/gzread.c soc2013/dpl/head/lib/libzcap/gzwrite.c soc2013/dpl/head/lib/libzcap/zlibworker/comands.c soc2013/dpl/head/lib/libzcap/zlibworker/zlibworker.c Modified: soc2013/dpl/head/lib/libzcap/adler32.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/adler32.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/adler32.c Wed Aug 7 11:25:34 2013 (r255637) @@ -62,7 +62,7 @@ #endif /* ========================================================================= */ -uLong zcapcmd_adler32(uLong adler, const Bytef *buf, uInt len); +uLong zcapcmd_adler32(); uLong ZEXPORT adler32(adler, buf, len) uLong adler; const Bytef *buf; @@ -81,7 +81,7 @@ } /* ========================================================================= */ -uLong zcapcmd_adler32_combine(uLong, uLong, z_off64_t); +uLong zcapcmd_adler32_combine(); local uLong adler32_combine_(adler1, adler2, len2) uLong adler1; uLong adler2; Modified: soc2013/dpl/head/lib/libzcap/commands.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/commands.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/commands.c Wed Aug 7 11:25:34 2013 (r255637) @@ -67,9 +67,9 @@ gzFile zcapcmd_gzopen(path, fd, mode) - const char *path; - int fd; - const char *mode; + const char *path; + int fd; + const char *mode; { nvlist_t *nvl, *args, *result; @@ -99,8 +99,8 @@ int zcapcmd_gzbuffer(file, size) - gzFile file; - unsigned size; + gzFile file; + unsigned size; { nvlist_t *nvl, *args, *result; @@ -126,9 +126,9 @@ int zcapcmd_gzsetparams(file, level, strategy) - gzFile file; - int level; - int strategy; + gzFile file; + int level; + int strategy; { nvlist_t *nvl, *args, *result; @@ -161,8 +161,8 @@ int zcapcmd_gzputs(file, s) - gzFile file; - const char *s; + gzFile file; + const char *s; { nvlist_t *nvl, *args, *result; @@ -189,8 +189,8 @@ /* XXX */ char * zcapcmd_gzgets(file, s) - gzFile file; - const char *s; + gzFile file; + const char *s; { nvlist_t *nvl, *args, *result; @@ -216,8 +216,8 @@ int zcapcmd_gzputc(file, c) - gzFile file; - int c; + gzFile file; + int c; { nvlist_t *nvl, *args, *result; @@ -241,6 +241,147 @@ return(ret); } +int +zcapcmd_gzungetc(c, file) + int c; + gzFile file; +{ + nvlist_t *nvl, *args, *result; + + if (pid == 0) + startChild(); + + if( (args = nvlist_create(0)) == NULL || + (nvl = nvlist_create(0)) == NULL ) { + perror("nvlist_create"); + return (NULL); + } + nvlist_add_number(nvl, "command", ZCAPCMD_GZUNGETC); + nvlist_add_number(args, "c", c); + nvlist_add_binary(args, "file", file, sizeof(gzFile_s)); + nvlist_add_nvlist(nvl, "args", args); + + result = sendCommand(nvl); + + int ret = nvlist_take_number(result, "result"); + nvlist_destroy(result); + return(ret); +} + +int +zcapcmd_gzflush(file, flush) + gzFile file; + int flush; +{ + nvlist_t *nvl, *args, *result; + + if (pid == 0) + startChild(); + + if( (args = nvlist_create(0)) == NULL || + (nvl = nvlist_create(0)) == NULL ) { + perror("nvlist_create"); + return (NULL); + } + nvlist_add_number(nvl, "command", ZCAPCMD_GZFLUSH); + nvlist_add_binary(args, "file", file, sizeof(gzFile_s)); + nvlist_add_number(args, "flush", flush); + nvlist_add_nvlist(nvl, "args", args); + + result = sendCommand(nvl); + + int ret = nvlist_take_number(result, "result"); + nvlist_destroy(result); + return(ret); +} + +z_off_t +zcapcmd_gzseek(file, offset, whence) + gzFile file; + z_off_t flush; + int whence; +{ + nvlist_t *nvl, *args, *result; + + if (pid == 0) + startChild(); + + if( (args = nvlist_create(0)) == NULL || + (nvl = nvlist_create(0)) == NULL ) { + perror("nvlist_create"); + return (NULL); + } + nvlist_add_number(nvl, "command", ZCAPCMD_GZSEEK); + nvlist_add_binary(args, "file", file, sizeof(gzFile_s)); + nvlist_add_number(args, "offset", offset); + nvlist_add_number(args, "whence", whence); + nvlist_add_nvlist(nvl, "args", args); + + result = sendCommand(nvl); + + int ret = nvlist_take_number(result, "result"); + nvlist_destroy(result); + return ((z_off_t)ret); +} + +/* + * This function will be used by all functions accepting + * a single gzFile, and returning an int. + */ +int +zcapcmd_simplecommand(file, c, command) + gzFile file; + int c; +{ + nvlist_t *nvl, *args, *result; + + if (pid == 0) + startChild(); + + if( (args = nvlist_create(0)) == NULL || + (nvl = nvlist_create(0)) == NULL ) { + perror("nvlist_create"); + return (NULL); + } + nvlist_add_number(nvl, "command", command); + nvlist_add_binary(args, "file", file, sizeof(gzFile_s)); + nvlist_add_nvlist(nvl, "args", args); + + result = sendCommand(nvl); + + int ret = nvlist_take_number(result, "result"); + nvlist_destroy(result); + return(ret); +} + +int +zcapcmd_gzerror(file, errnum) + gzFile file; + int *errnum; +{ + nvlist_t *nvl, *args, *result; + + if (pid == 0) + startChild(); + + if( (args = nvlist_create(0)) == NULL || + (nvl = nvlist_create(0)) == NULL ) { + perror("nvlist_create"); + return (NULL); + } + nvlist_add_number(nvl, "command", ZCAPCMD_GZPUTC); + nvlist_add_binary(args, "file", file, sizeof(gzFile_s)); + nvlist_add_nvlist(nvl, "args", args); + + result = sendCommand(nvl); + + /* XXX: Should I malloc space for this? */ + char * ret = nvlist_take_string(result, "result"); + *errnum = nvlist_take_number(result, "zerrno"); + nvlist_destroy(result); + return(ret); +} + uLong zcapcmd_adler32(adler, buf, len) uLong adler; Modified: soc2013/dpl/head/lib/libzcap/crc32.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/crc32.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/crc32.c Wed Aug 7 11:25:34 2013 (r255637) @@ -201,7 +201,7 @@ #define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 /* ========================================================================= */ -zcapcmd_crc32(unsigned long crc, const unsigned char FAR *buf, uInt len); +uLong zcapcmd_crc32(); unsigned long ZEXPORT crc32(crc, buf, len) unsigned long crc; const unsigned char FAR *buf; @@ -338,7 +338,7 @@ } /* ========================================================================= */ -uLong zcapcmd_crc32_combine(uLong, uLong, z_off64_t); +uLong zcapcmd_crc32_combine(); local uLong crc32_combine_(crc1, crc2, len2) uLong crc1; uLong crc2; Modified: soc2013/dpl/head/lib/libzcap/gzlib.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/gzlib.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/gzlib.c Wed Aug 7 11:25:34 2013 (r255637) @@ -322,11 +322,11 @@ const char *path; const char *mode; { - return gz_open(path, -1, mode); + return gzopen(path, -1, mode); } /* -- see zlib.h -- */ -extern gzFile zcapcmd_gz_open(const char *path, int fd, const char *mode); +extern gzFile zcapcmd_gzopen(); gzFile ZEXPORT gzdopen(fd, mode) int fd; const char *mode; @@ -341,7 +341,7 @@ #else sprintf(path, "", fd); /* for debugging */ #endif - gz = zcapcmd_gz_open(path, fd, mode); + gz = zcapcmd_gzopen(path, fd, mode); free(path); return gz; } @@ -357,7 +357,7 @@ #endif /* -- see zlib.h -- */ -extern gzFile zcapcmd_gz_open(gzFile file, unsigned size); +extern gzFile zcapcmd_gzbuffer(); int ZEXPORT gzbuffer(file, size) gzFile file; unsigned size; Modified: soc2013/dpl/head/lib/libzcap/gzread.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/gzread.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/gzread.c Wed Aug 7 11:25:34 2013 (r255637) @@ -423,63 +423,12 @@ } /* -- see zlib.h -- */ +int zcapcmd_gzungetc(); int ZEXPORT gzungetc(c, file) int c; gzFile file; { - gz_statep state; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - - /* check that we're reading and that there's no (serious) error */ - if (state->mode != GZ_READ || - (state->err != Z_OK && state->err != Z_BUF_ERROR)) - return -1; - - /* process a skip request */ - if (state->seek) { - state->seek = 0; - if (gz_skip(state, state->skip) == -1) - return -1; - } - - /* can't push EOF */ - if (c < 0) - return -1; - - /* if output buffer empty, put byte at end (allows more pushing) */ - if (state->x.have == 0) { - state->x.have = 1; - state->x.next = state->out + (state->size << 1) - 1; - state->x.next[0] = c; - state->x.pos--; - state->past = 0; - return c; - } - - /* if no room, give up (must have already done a gzungetc()) */ - if (state->x.have == (state->size << 1)) { - gz_error(state, Z_DATA_ERROR, "out of room to push characters"); - return -1; - } - - /* slide output data if needed and insert byte before existing data */ - if (state->x.next == state->out) { - unsigned char *src = state->out + state->x.have; - unsigned char *dest = state->out + (state->size << 1); - while (src > state->out) - *--dest = *--src; - state->x.next = dest; - } - state->x.have++; - state->x.next--; - state->x.next[0] = c; - state->x.pos--; - state->past = 0; - return c; + return zcapcmd_gzungetc(c, file); } /* -- see zlib.h -- */ Modified: soc2013/dpl/head/lib/libzcap/gzwrite.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/gzwrite.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/gzwrite.c Wed Aug 7 11:25:34 2013 (r255637) @@ -245,65 +245,21 @@ } /* -- see zlib.h -- */ +int zcapcmd_gzputc(); int ZEXPORT gzputc(file, c) gzFile file; int c; { - unsigned have; - unsigned char buf[1]; - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return -1; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return -1; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return -1; - } - - /* try writing to input buffer for speed (state->size == 0 if buffer not - initialized) */ - if (state->size) { - if (strm->avail_in == 0) - strm->next_in = state->in; - have = (unsigned)((strm->next_in + strm->avail_in) - state->in); - if (have < state->size) { - state->in[have] = c; - strm->avail_in++; - state->x.pos++; - return c & 0xff; - } - } - - /* no room in buffer or not initialized, use gz_write() */ - buf[0] = c; - if (gzwrite(file, buf, 1) != 1) - return -1; - return c & 0xff; + return zcapcmd_gzputc(file, c); } /* -- see zlib.h -- */ +int zcapcmd_gzputs(); int ZEXPORT gzputs(file, str) gzFile file; const char *str; { - int ret; - unsigned len; - - /* write string */ - len = (unsigned)strlen(str); - ret = gzwrite(file, str, len); - return ret == 0 && len != 0 ? -1 : ret; + return zcapcmd_gzputs(file, str); } #if defined(STDC) || defined(Z_HAVE_STDARG_H) @@ -497,45 +453,13 @@ } /* -- see zlib.h -- */ +int zcapcmd_gzsetparams(); int ZEXPORT gzsetparams(file, level, strategy) gzFile file; int level; int strategy; { - gz_statep state; - z_streamp strm; - - /* get internal structure */ - if (file == NULL) - return Z_STREAM_ERROR; - state = (gz_statep)file; - strm = &(state->strm); - - /* check that we're writing and that there's no error */ - if (state->mode != GZ_WRITE || state->err != Z_OK) - return Z_STREAM_ERROR; - - /* if no change is requested, then do nothing */ - if (level == state->level && strategy == state->strategy) - return Z_OK; - - /* check for seek request */ - if (state->seek) { - state->seek = 0; - if (gz_zero(state, state->skip) == -1) - return -1; - } - - /* change compression parameters for subsequent input */ - if (state->size) { - /* flush previous input with previous parameters before changing */ - if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1) - return state->err; - deflateParams(strm, level, strategy); - } - state->level = level; - state->strategy = strategy; - return Z_OK; + return zcapcmd_gzsetparams(file, level, strategy); } /* -- see zlib.h -- */ Modified: soc2013/dpl/head/lib/libzcap/zlibworker/comands.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/zlibworker/comands.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/zlibworker/comands.c Wed Aug 7 11:25:34 2013 (r255637) @@ -5,7 +5,7 @@ void -zcapcmd_compressBound(nvlist_t * nvl, nvlist_t * result) +zcapcmd_compressBound(nvlist_t *nvl, nvlist_t *result) { uLong ret = -1; @@ -17,7 +17,7 @@ } void -zcapcmd_gzopen(nvlist_t * nvl, nvlist_t * result) +zcapcmd_gzopen(nvlist_t *nvl, nvlist_t *result) { void *ret = NULL; @@ -32,7 +32,7 @@ } void -zcapcmd_gzbuffer(nvlist_t * nvl, nvlist_t * result) +zcapcmd_gzbuffer(nvlist_t *nvl, nvlist_t *result) { int ret = -1; @@ -46,7 +46,7 @@ } void -zcapcmd_gzsetparams(nvlist_t * nvl, nvlist_t * result) +zcapcmd_gzsetparams(nvlist_t *nvl, nvlist_t *result) { int ret = -1; @@ -61,7 +61,7 @@ } void -zcapcmd_gzputs(nvlist_t * nvl, nvlist_t * result) +zcapcmd_gzputs(nvlist_t *nvl, nvlist_t *result) { int ret = -1; @@ -74,8 +74,124 @@ nvlist_add_number(result, "result", ret); } +/* XXX: gzgets */ + +void +zcapcmd_gzputc(nvlist_t *nvl, nvlist_t *result) +{ + int ret = -1; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + ret = gzputc( + nvlist_take_binary(args, "file", sizeof(gzFile_s)), + nvlist_take_number(args, "c") + ); + + nvlist_add_number(result, "result", ret); +} + +zcapcmd_gzungetc(nvlist_t *nvl, nvlist_t *result) +{ + int ret = -1; + char * str; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + ret = gzungetz( + nvlist_take_number(args, "c"), + nvlist_take_binary(args, "file", sizeof(gzFile_s)) + ); + + nvlist_add_number(result, "result", ret); +} + +zcapcmd_gzflush(nvlist_t *nvl, nvlist_t *result) +{ + int ret = -1; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + ret = gzflush( + nvlist_take_binary(args, "file", sizeof(gzFile_s)), + nvlist_take_number(args, "flush") + ); + + nvlist_add_number(result, "result", ret); +} + +zcapcmd_gzseek(nvlist_t *nvl, nvlist_t *result) +{ + z_off_t ret = -1; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + ret = gzseek( + nvlist_take_binary(args, "file", sizeof(gzFile_s)), + nvlist_take_number(args, "offset"), + nvlist_take_number(args, "whence") + ); + + nvlist_add_number(result, "result", ret); +} + +void +zcapcmd_gzsimplecommand(nvlist_t *nvl, nvlist_t *result) +{ + int ret = -1; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + gzFile file = nvlist_take_binary(args, "file", sizeof(gzFile_s)) + switch( nvlist_take_number(nvl, "command") ){ + case (ZCAPCMD_GZGETC): + ret = gzgetc(file); + break; + case (ZCAPCMD_GZREWIND): + ret = gzrewind(file); + break; + case (ZCAPCMD_GZTELL): + ret = gztell(file); + break; + case (ZCAPCMD_GZOFFSET): + ret = gzoffset(file); + break; + case (ZCAPCMD_GZEOF): + ret = gzeof(file); + break; + case (ZCAPCMD_GZDIRECT): + ret = gzdirect(file); + break; + case (ZCAPCMD_GZCLOSE_R): + ret = gzclose_r(file); + break; + case (ZCAPCMD_GZCLOSE_W): + ret = gzclose_w(file); + break; + case (ZCAPCMD_GZCLEARERR): + ret = gzclearerr(file); + break; + case (ZCAPCMD_GZCLEARERR): + ret = gzclearerr(file); + break; + } + + nvlist_add_number(result, "result", ret); +} + void -zcapcmd_adler32(nvlist_t * nvl, nvlist_t * result) +zcapcmd_gzerror(nvlist_t *nvl, nvlist_t *result) +{ + int ret = -1; + char * str; + + if ((args = nvlist_take_nvlist(nvl, "args")) != NULL) + ret = gzerror( + nvlist_take_binary(args, "file", sizeof(gzFile_s)), + &ret + ); + + nvlist_add_number(result, "zerrno", ret); + nvlist_add_string(result, "result", str); +} + +void +zcapcmd_adler32(nvlist_t *nvl, nvlist_t *result) { uLong ret = -1; @@ -88,8 +204,9 @@ nvlist_add_number(result, "result", ret ); } + void -zcapcmd_adler32_combine(nvlist_t * nvl, nvlist_t * result) +zcapcmd_adler32_combine(nvlist_t *nvl, nvlist_t *result) { uLong ret = -1; @@ -103,7 +220,7 @@ } void -zcapcmd_crc32(nvlist_t * nvl, nvlist_t * result) +zcapcmd_crc32(nvlist_t *nvl, nvlist_t *result) { uLong ret = -1; @@ -117,7 +234,7 @@ } void -zcapcmd_crc32_combine(nvlist_t * nvl, nvlist_t * result) +zcapcmd_crc32_combine(nvlist_t *nvl, nvlist_t *result) { uLong ret = -1; Modified: soc2013/dpl/head/lib/libzcap/zlibworker/zlibworker.c ============================================================================== --- soc2013/dpl/head/lib/libzcap/zlibworker/zlibworker.c Wed Aug 7 11:02:28 2013 (r255636) +++ soc2013/dpl/head/lib/libzcap/zlibworker/zlibworker.c Wed Aug 7 11:25:34 2013 (r255637) @@ -9,6 +9,18 @@ extern void zcapcmd_adler32_combine(nvlist_t * nvl, nvlist_t * result); extern void zcapcmd_crc32_combine(nvlist_t * nvl, nvlist_t * result); extern void zcapcmd_gzopen(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzbuffer(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzsetparams(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzread(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzwrite(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzprintf(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzputs(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzgets(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzputc(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzunget(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzflush(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzseek(nvlist_t * nvl, nvlist_t * result); +extern void zcapcmd_gzsimplecommand(nvlist_t * nvl, nvlist_t * result); int main() @@ -33,6 +45,7 @@ case (ZCAPCMD_COMPRESSBOUND): zcapcmd_compressBound(nvl, result); break; + case (ZCAPCMD_GZOPEN): zcapcmd_gzopen(nvl, result); break; @@ -60,9 +73,6 @@ case (ZCAPCMD_GZPUTC): zcapcmd_gzputc(nvl, result); break; - case (ZCAPCMD_GZGETC): - zcapcmd_gzgetc(nvl, result); - break; case (ZCAPCMD_GZUNGET): zcapcmd_gzunget(nvl, result); break; @@ -72,36 +82,25 @@ case (ZCAPCMD_GZSEEK): zcapcmd_gzseek(nvl, result); break; + case (ZCAPCMD_GZGETC): case (ZCAPCMD_GZREWIND): - zcapcmd_gzrewind(nvl, result); - break; case (ZCAPCMD_GZTELL): - zcapcmd_gztell(nvl, result); - break; case (ZCAPCMD_GZOFFSET): - zcapcmd_gzoffset(nvl, result); - break; case (ZCAPCMD_GZEOF): - zcapcmd_gzeof(nvl, result); - break; case (ZCAPCMD_GZDIRECT): - zcapcmd_gzdirect(nvl, result); - break; - case (ZCAPCMD_GZBUFFER): - zcapcmd_gzbuffer(nvl, result); - break; case (ZCAPCMD_GZCLOSE_R): - zcapcmd_gzclose_r(nvl, result); - break; case (ZCAPCMD_GZCLOSE_W): - zcapcmd_gzclose_w(nvl, result); + case (ZCAPCMD_GZCLEARERR): + /* + * All this commands have gzFile as argument, + * and return an int. + */ + zcapcmd_gzsimplecommand(nvl, result); break; case (ZCAPCMD_GZERROR): zcapcmd_gzerror(nvl, result); break; - case (ZCAPCMD_GZCLEARERR): - zcapcmd_gzclearerr(nvl, result); - break; + case (ZCAPCMD_ADLER32): zcapcmd_adler32(nvl, result); break;