summaryrefslogtreecommitdiffstats
path: root/cpukit/zlib/gzio.c
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2008-09-02 05:33:58 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2008-09-02 05:33:58 +0000
commitd29a42b35943690789e89e16cb17fd03b07f93c8 (patch)
tree461d3c72a71bcedcbd25d6daf790a110cb111196 /cpukit/zlib/gzio.c
parent2008-09-01 Ralf Corsépius <ralf.corsepius@rtems.org> (diff)
downloadrtems-d29a42b35943690789e89e16cb17fd03b07f93c8.tar.bz2
Stop using old-style function definitions.
Diffstat (limited to 'cpukit/zlib/gzio.c')
-rw-r--r--cpukit/zlib/gzio.c146
1 files changed, 73 insertions, 73 deletions
diff --git a/cpukit/zlib/gzio.c b/cpukit/zlib/gzio.c
index 7e90f4928f..a45a477dae 100644
--- a/cpukit/zlib/gzio.c
+++ b/cpukit/zlib/gzio.c
@@ -90,10 +90,10 @@ local uLong getLong OF((gz_stream *s));
can be checked to distinguish the two cases (if errno is zero, the
zlib error is Z_MEM_ERROR).
*/
-local gzFile gz_open (path, mode, fd)
- const char *path;
- const char *mode;
- int fd;
+local gzFile gz_open (
+ const char *path,
+ const char *mode,
+ int fd)
{
int err;
int level = Z_DEFAULT_COMPRESSION; /* compression level */
@@ -205,9 +205,9 @@ local gzFile gz_open (path, mode, fd)
/* ===========================================================================
Opens a gzip (.gz) file for reading or writing.
*/
-gzFile ZEXPORT gzopen (path, mode)
- const char *path;
- const char *mode;
+gzFile ZEXPORT gzopen (
+ const char *path,
+ const char *mode)
{
return gz_open (path, mode, -1);
}
@@ -216,9 +216,9 @@ gzFile ZEXPORT gzopen (path, mode)
Associate a gzFile with the file descriptor fd. fd is not dup'ed here
to mimic the behavio(u)r of fdopen.
*/
-gzFile ZEXPORT gzdopen (fd, mode)
- int fd;
- const char *mode;
+gzFile ZEXPORT gzdopen (
+ int fd,
+ const char *mode)
{
char name[46]; /* allow for up to 128-bit integers */
@@ -231,10 +231,10 @@ gzFile ZEXPORT gzdopen (fd, mode)
/* ===========================================================================
* Update the compression level and strategy
*/
-int ZEXPORT gzsetparams (file, level, strategy)
- gzFile file;
- int level;
- int strategy;
+int ZEXPORT gzsetparams (
+ gzFile file,
+ int level,
+ int strategy)
{
gz_stream *s = (gz_stream*)file;
@@ -258,8 +258,8 @@ int ZEXPORT gzsetparams (file, level, strategy)
for end of file.
IN assertion: the stream s has been sucessfully opened for reading.
*/
-local int get_byte(s)
- gz_stream *s;
+local int get_byte(
+ gz_stream *s)
{
if (s->z_eof) return EOF;
if (s->stream.avail_in == 0) {
@@ -285,8 +285,8 @@ local int get_byte(s)
s->stream.avail_in is zero for the first time, but may be non-zero
for concatenated .gz files.
*/
-local void check_header(s)
- gz_stream *s;
+local void check_header(
+ gz_stream *s)
{
int method; /* method byte */
int flags; /* flags byte */
@@ -352,8 +352,8 @@ local void check_header(s)
* Cleanup then free the given gz_stream. Return a zlib error code.
Try freeing in the reverse order of allocations.
*/
-local int destroy (s)
- gz_stream *s;
+local int destroy (
+ gz_stream *s)
{
int err = Z_OK;
@@ -391,10 +391,10 @@ local int destroy (s)
Reads the given number of uncompressed bytes from the compressed file.
gzread returns the number of bytes actually read (0 for end of file).
*/
-int ZEXPORT gzread (file, buf, len)
- gzFile file;
- voidp buf;
- unsigned len;
+int ZEXPORT gzread (
+ gzFile file,
+ voidp buf,
+ unsigned len)
{
gz_stream *s = (gz_stream*)file;
Bytef *start = (Bytef*)buf; /* starting point for crc computation */
@@ -500,8 +500,8 @@ int ZEXPORT gzread (file, buf, len)
Reads one byte from the compressed file. gzgetc returns this byte
or -1 in case of end of file or error.
*/
-int ZEXPORT gzgetc(file)
- gzFile file;
+int ZEXPORT gzgetc(
+ gzFile file)
{
unsigned char c;
@@ -512,9 +512,9 @@ int ZEXPORT gzgetc(file)
/* ===========================================================================
Push one byte back onto the stream.
*/
-int ZEXPORT gzungetc(c, file)
- int c;
- gzFile file;
+int ZEXPORT gzungetc(
+ int c,
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;
@@ -537,10 +537,10 @@ int ZEXPORT gzungetc(c, file)
The current implementation is not optimized at all.
*/
-char * ZEXPORT gzgets(file, buf, len)
- gzFile file;
- char *buf;
- int len;
+char * ZEXPORT gzgets(
+ gzFile file,
+ char *buf,
+ int len)
{
char *b = buf;
if (buf == Z_NULL || len <= 0) return Z_NULL;
@@ -556,10 +556,10 @@ char * ZEXPORT gzgets(file, buf, len)
Writes the given number of uncompressed bytes into the compressed file.
gzwrite returns the number of bytes actually written (0 in case of error).
*/
-int ZEXPORT gzwrite (file, buf, len)
- gzFile file;
- voidpc buf;
- unsigned len;
+int ZEXPORT gzwrite (
+ gzFile file,
+ voidpc buf,
+ unsigned len)
{
gz_stream *s = (gz_stream*)file;
@@ -675,9 +675,9 @@ int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
Writes c, converted to an unsigned char, into the compressed file.
gzputc returns the value that was written, or -1 in case of error.
*/
-int ZEXPORT gzputc(file, c)
- gzFile file;
- int c;
+int ZEXPORT gzputc(
+ gzFile file,
+ int c)
{
unsigned char cc = (unsigned char) c; /* required for big endian systems */
@@ -690,9 +690,9 @@ int ZEXPORT gzputc(file, c)
the terminating null character.
gzputs returns the number of characters written, or -1 in case of error.
*/
-int ZEXPORT gzputs(file, s)
- gzFile file;
- const char *s;
+int ZEXPORT gzputs(
+ gzFile file,
+ const char *s)
{
return gzwrite(file, (char*)s, (unsigned)strlen(s));
}
@@ -702,9 +702,9 @@ int ZEXPORT gzputs(file, s)
Flushes all pending output into the compressed file. The parameter
flush is as in the deflate() function.
*/
-local int do_flush (file, flush)
- gzFile file;
- int flush;
+local int do_flush (
+ gzFile file,
+ int flush)
{
uInt len;
int done = 0;
@@ -743,9 +743,9 @@ local int do_flush (file, flush)
return s->z_err == Z_STREAM_END ? Z_OK : s->z_err;
}
-int ZEXPORT gzflush (file, flush)
- gzFile file;
- int flush;
+int ZEXPORT gzflush (
+ gzFile file,
+ int flush)
{
gz_stream *s = (gz_stream*)file;
int err = do_flush (file, flush);
@@ -764,10 +764,10 @@ int ZEXPORT gzflush (file, flush)
SEEK_END is not implemented, returns error.
In this version of the library, gzseek can be extremely slow.
*/
-z_off_t ZEXPORT gzseek (file, offset, whence)
- gzFile file;
- z_off_t offset;
- int whence;
+z_off_t ZEXPORT gzseek (
+ gzFile file,
+ z_off_t offset,
+ int whence)
{
gz_stream *s = (gz_stream*)file;
@@ -854,8 +854,8 @@ z_off_t ZEXPORT gzseek (file, offset, whence)
/* ===========================================================================
Rewinds input file.
*/
-int ZEXPORT gzrewind (file)
- gzFile file;
+int ZEXPORT gzrewind (
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;
@@ -878,8 +878,8 @@ int ZEXPORT gzrewind (file)
given compressed file. This position represents a number of bytes in the
uncompressed data stream.
*/
-z_off_t ZEXPORT gztell (file)
- gzFile file;
+z_off_t ZEXPORT gztell (
+ gzFile file)
{
return gzseek(file, 0L, SEEK_CUR);
}
@@ -888,8 +888,8 @@ z_off_t ZEXPORT gztell (file)
Returns 1 when EOF has previously been detected reading the given
input stream, otherwise zero.
*/
-int ZEXPORT gzeof (file)
- gzFile file;
+int ZEXPORT gzeof (
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;
@@ -905,8 +905,8 @@ int ZEXPORT gzeof (file)
/* ===========================================================================
Returns 1 if reading and doing so transparently, otherwise zero.
*/
-int ZEXPORT gzdirect (file)
- gzFile file;
+int ZEXPORT gzdirect (
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;
@@ -917,9 +917,9 @@ int ZEXPORT gzdirect (file)
/* ===========================================================================
Outputs a long in LSB order to the given file
*/
-local void putLong (file, x)
- FILE *file;
- uLong x;
+local void putLong (
+ FILE *file,
+ uLong x)
{
int n;
for (n = 0; n < 4; n++) {
@@ -932,8 +932,8 @@ local void putLong (file, x)
Reads a long in LSB order from the given gz_stream. Sets z_err in case
of error.
*/
-local uLong getLong (s)
- gz_stream *s;
+local uLong getLong (
+ gz_stream *s)
{
uLong x = (uLong)get_byte(s);
int c;
@@ -950,8 +950,8 @@ local uLong getLong (s)
Flushes all pending output if necessary, closes the compressed file
and deallocates all the (de)compression state.
*/
-int ZEXPORT gzclose (file)
- gzFile file;
+int ZEXPORT gzclose (
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;
@@ -984,9 +984,9 @@ int ZEXPORT gzclose (file)
errnum is set to Z_ERRNO and the application may consult errno
to get the exact error code.
*/
-const char * ZEXPORT gzerror (file, errnum)
- gzFile file;
- int *errnum;
+const char * ZEXPORT gzerror (
+ gzFile file,
+ int *errnum)
{
char *m;
gz_stream *s = (gz_stream*)file;
@@ -1014,8 +1014,8 @@ const char * ZEXPORT gzerror (file, errnum)
/* ===========================================================================
Clear the error and end-of-file flags, and do the same for the real file.
*/
-void ZEXPORT gzclearerr (file)
- gzFile file;
+void ZEXPORT gzclearerr (
+ gzFile file)
{
gz_stream *s = (gz_stream*)file;