Index: lib/jar/jzlib.h |
=================================================================== |
--- a/lib/jar/jzlib.h |
+++ b/lib/jar/jzlib.h |
@@ -39,17 +39,17 @@ extern "C" { |
#ifdef MOZILLA_CLIENT |
#include "jzconf.h" |
#else |
#include "zconf.h" |
#endif |
#define ZLIB_VERSION "1.0.4" |
-/* |
+/* |
The 'zlib' compression library provides in-memory compression and |
decompression functions, including integrity checks of the uncompressed |
data. This version of the library supports only one compression method |
(deflation) but other algorithms may be added later and will have the same |
stream interface. |
For compression the application must provide the output buffer and |
may optionally provide the input buffer for optimization. For decompression, |
@@ -63,40 +63,40 @@ extern "C" { |
(providing more output space) before each call. |
The library does not install any signal handler. It is recommended to |
add at least a handler for SIGSEGV when decompressing; the library checks |
the consistency of the input data whenever possible but may go nuts |
for some forms of corrupted input. |
*/ |
-typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); |
-typedef void (*free_func) OF((voidpf opaque, voidpf address)); |
+typedef voidpf(*alloc_func) OF((voidpf opaque, uInt items, uInt size)); |
+typedef void(*free_func) OF((voidpf opaque, voidpf address)); |
struct internal_state; |
typedef struct z_stream_s { |
- Bytef *next_in; /* next input byte */ |
- uInt avail_in; /* number of bytes available at next_in */ |
- uLong total_in; /* total nb of input bytes read so far */ |
+ Bytef *next_in; /* next input byte */ |
+ uInt avail_in; /* number of bytes available at next_in */ |
+ uLong total_in; /* total nb of input bytes read so far */ |
- Bytef *next_out; /* next output byte should be put there */ |
- uInt avail_out; /* remaining free space at next_out */ |
- uLong total_out; /* total nb of bytes output so far */ |
+ Bytef *next_out; /* next output byte should be put there */ |
+ uInt avail_out; /* remaining free space at next_out */ |
+ uLong total_out; /* total nb of bytes output so far */ |
- char *msg; /* last error message, NULL if no error */ |
- struct internal_state FAR *state; /* not visible by applications */ |
+ char *msg; /* last error message, NULL if no error */ |
+ struct internal_state FAR *state; /* not visible by applications */ |
- alloc_func zalloc; /* used to allocate the internal state */ |
- free_func zfree; /* used to free the internal state */ |
- voidpf opaque; /* private data object passed to zalloc and zfree */ |
+ alloc_func zalloc; /* used to allocate the internal state */ |
+ free_func zfree; /* used to free the internal state */ |
+ voidpf opaque; /* private data object passed to zalloc and zfree */ |
- int data_type; /* best guess about the data type: ascii or binary */ |
- uLong adler; /* adler32 value of the uncompressed data */ |
- uLong reserved; /* reserved for future use */ |
+ int data_type; /* best guess about the data type: ascii or binary */ |
+ uLong adler; /* adler32 value of the uncompressed data */ |
+ uLong reserved; /* reserved for future use */ |
} z_stream; |
typedef z_stream FAR *z_streamp; |
/* |
The application must update next_in and avail_in when avail_in has |
dropped to zero. It must update next_out and avail_out when avail_out |
has dropped to zero. The application must initialize zalloc, zfree and |
@@ -120,76 +120,76 @@ typedef z_stream FAR *z_streamp; |
The fields total_in and total_out can be used for statistics or |
progress reports. After compression, total_in holds the total size of |
the uncompressed data and may be saved for use in the decompressor |
(particularly if the decompressor wants to decompress everything in |
a single step). |
*/ |
- /* constants */ |
+/* constants */ |
-#define Z_NO_FLUSH 0 |
+#define Z_NO_FLUSH 0 |
#define Z_PARTIAL_FLUSH 1 |
-#define Z_SYNC_FLUSH 2 |
-#define Z_FULL_FLUSH 3 |
-#define Z_FINISH 4 |
+#define Z_SYNC_FLUSH 2 |
+#define Z_FULL_FLUSH 3 |
+#define Z_FINISH 4 |
/* Allowed flush values; see deflate() below for details */ |
-#define Z_OK 0 |
-#define Z_STREAM_END 1 |
-#define Z_NEED_DICT 2 |
-#define Z_ERRNO (-1) |
+#define Z_OK 0 |
+#define Z_STREAM_END 1 |
+#define Z_NEED_DICT 2 |
+#define Z_ERRNO (-1) |
#define Z_STREAM_ERROR (-2) |
-#define Z_DATA_ERROR (-3) |
-#define Z_MEM_ERROR (-4) |
-#define Z_BUF_ERROR (-5) |
+#define Z_DATA_ERROR (-3) |
+#define Z_MEM_ERROR (-4) |
+#define Z_BUF_ERROR (-5) |
#define Z_VERSION_ERROR (-6) |
/* Return codes for the compression/decompression functions. Negative |
* values are errors, positive values are used for special but normal events. |
*/ |
-#define Z_NO_COMPRESSION 0 |
-#define Z_BEST_SPEED 1 |
-#define Z_BEST_COMPRESSION 9 |
-#define Z_DEFAULT_COMPRESSION (-1) |
+#define Z_NO_COMPRESSION 0 |
+#define Z_BEST_SPEED 1 |
+#define Z_BEST_COMPRESSION 9 |
+#define Z_DEFAULT_COMPRESSION (-1) |
/* compression levels */ |
-#define Z_FILTERED 1 |
-#define Z_HUFFMAN_ONLY 2 |
-#define Z_DEFAULT_STRATEGY 0 |
+#define Z_FILTERED 1 |
+#define Z_HUFFMAN_ONLY 2 |
+#define Z_DEFAULT_STRATEGY 0 |
/* compression strategy; see deflateInit2() below for details */ |
-#define Z_BINARY 0 |
-#define Z_ASCII 1 |
-#define Z_UNKNOWN 2 |
+#define Z_BINARY 0 |
+#define Z_ASCII 1 |
+#define Z_UNKNOWN 2 |
/* Possible values of the data_type field */ |
-#define Z_DEFLATED 8 |
+#define Z_DEFLATED 8 |
/* The deflate compression method (the only one supported in this version) */ |
-#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ |
+#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ |
#define zlib_version zlibVersion() |
/* for compatibility with versions < 1.0.2 */ |
- /* basic functions */ |
+/* basic functions */ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(const char *) zlibVersion (void); |
+PR_EXTERN(const char *) zlibVersion(void); |
#else |
-extern const char * EXPORT zlibVersion OF((void)); |
+extern const char *EXPORT zlibVersion OF((void)); |
#endif |
/* The application can compare zlibVersion and ZLIB_VERSION for consistency. |
If the first character differs, the library code actually used is |
not compatible with the zlib.h header file used by the application. |
This check is automatically made by deflateInit and inflateInit. |
*/ |
-/* |
+/* |
extern int EXPORT deflateInit OF((z_streamp strm, int level)); |
Initializes the internal stream state for compression. The fields |
zalloc, zfree and opaque must be initialized before by the caller. |
If zalloc and zfree are set to Z_NULL, deflateInit updates them to |
use default allocation functions. |
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: |
@@ -201,19 +201,18 @@ extern int EXPORT deflateInit OF((z_stre |
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not |
enough memory, Z_STREAM_ERROR if level is not a valid compression level, |
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible |
with the version assumed by the caller (ZLIB_VERSION). |
msg is set to null if there is no error message. deflateInit does not |
perform any compression: this will be done by deflate(). |
*/ |
- |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflate (z_streamp strm, int flush); |
+PR_EXTERN(int) deflate(z_streamp strm, int flush); |
#else |
extern int EXPORT deflate OF((z_streamp strm, int flush)); |
#endif |
/* |
Performs one or both of the following actions: |
- Compress more input starting at next_in and update next_in and avail_in |
accordingly. If not all input can be processed (because there is not |
@@ -256,17 +255,17 @@ extern int EXPORT deflate OF((z_streamp |
If the parameter flush is set to Z_FINISH, pending input is processed, |
pending output is flushed and deflate returns with Z_STREAM_END if there |
was enough output space; if deflate returns with Z_OK, this function must be |
called again with Z_FINISH and more output space (updated avail_out) but no |
more input data, until it returns with Z_STREAM_END or an error. After |
deflate has returned Z_STREAM_END, the only possible operations on the |
stream are deflateReset or deflateEnd. |
- |
+ |
Z_FINISH can be used immediately after deflateInit if all the compression |
is to be done in a single step. In this case, avail_out must be at least |
0.1% larger than avail_in plus 12 bytes. If deflate does not return |
Z_STREAM_END, then it must be called again as described above. |
deflate() may update data_type if it can make a good guess about |
the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered |
binary. This field is only for information purposes and does not affect |
@@ -274,53 +273,50 @@ extern int EXPORT deflate OF((z_streamp |
deflate() returns Z_OK if some progress has been made (more input |
processed or more output produced), Z_STREAM_END if all input has been |
consumed and all output has been produced (only when flush is set to |
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example |
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible. |
*/ |
- |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateEnd (z_streamp strm); |
+PR_EXTERN(int) deflateEnd(z_streamp strm); |
#else |
extern int EXPORT deflateEnd OF((z_streamp strm)); |
#endif |
/* |
All dynamically allocated data structures for this stream are freed. |
This function discards any unprocessed input and does not flush any |
pending output. |
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the |
stream state was inconsistent, Z_DATA_ERROR if the stream was freed |
prematurely (some input or output was discarded). In the error case, |
msg may be set but then points to a static string (which must not be |
deallocated). |
*/ |
- |
-/* |
+/* |
extern int EXPORT inflateInit OF((z_streamp strm)); |
Initializes the internal stream state for decompression. The fields |
zalloc, zfree and opaque must be initialized before by the caller. If |
zalloc and zfree are set to Z_NULL, inflateInit updates them to use default |
allocation functions. |
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not |
enough memory, Z_VERSION_ERROR if the zlib library version is incompatible |
with the version assumed by the caller. msg is set to null if there is no |
error message. inflateInit does not perform any decompression: this will be |
done by inflate(). |
*/ |
- |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) inflate (z_streamp strm, int flush); |
+PR_EXTERN(int) inflate(z_streamp strm, int flush); |
#else |
extern int EXPORT inflate OF((z_streamp strm, int flush)); |
#endif |
/* |
Performs one or both of the following actions: |
- Decompress more input starting at next_in and update next_in and avail_in |
accordingly. If not all input can be processed (because there is not |
@@ -367,39 +363,38 @@ extern int EXPORT inflate OF((z_streamp |
next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, |
Z_BUF_ERROR if no progress is possible or if there was not enough room in |
the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the |
application may then call inflateSync to look for a good compression block. |
In the Z_NEED_DICT case, strm->adler is set to the Adler32 value of the |
dictionary chosen by the compressor. |
*/ |
- |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) inflateEnd (z_streamp strm); |
+PR_EXTERN(int) inflateEnd(z_streamp strm); |
#else |
extern int EXPORT inflateEnd OF((z_streamp strm)); |
#endif |
/* |
All dynamically allocated data structures for this stream are freed. |
This function discards any unprocessed input and does not flush any |
pending output. |
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state |
was inconsistent. In the error case, msg may be set but then points to a |
static string (which must not be deallocated). |
*/ |
- /* Advanced functions */ |
+/* Advanced functions */ |
/* |
The following functions are needed only in some special applications. |
*/ |
-/* |
+/* |
extern int EXPORT deflateInit2 OF((z_streamp strm, |
int level, |
int method, |
int windowBits, |
int memLevel, |
int strategy)); |
This is another version of deflateInit with more compression options. The |
@@ -445,27 +440,25 @@ extern int EXPORT deflateInit2 OF((z_str |
information inside this buffer from call to call; the application |
must provide more input only by increasing avail_in. next_in is always |
reset by the library in this case. |
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was |
not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as |
an invalid method). msg is set to null if there is no error message. |
deflateInit2 does not perform any compression: this will be done by |
- deflate(). |
+ deflate(). |
*/ |
- |
+ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateSetDictionary (z_streamp strm, |
- const Bytef *dictionary, |
- uInt dictLength); |
+PR_EXTERN(int) deflateSetDictionary(z_streamp strm, const Bytef *dictionary, |
+ uInt dictLength); |
#else |
-extern int EXPORT deflateSetDictionary OF((z_streamp strm, |
- const Bytef *dictionary, |
- uInt dictLength)); |
+extern int EXPORT deflateSetDictionary |
+ OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); |
#endif |
/* |
Initializes the compression dictionary (history buffer) from the given |
byte sequence without producing any compressed output. This function must |
be called immediately after deflateInit or deflateInit2, before any call |
of deflate. The compressor and decompressor must use exactly the same |
dictionary (see inflateSetDictionary). |
The dictionary should consist of strings (byte sequences) that are likely |
@@ -480,21 +473,21 @@ extern int EXPORT deflateSetDictionary O |
which dictionary has been used by the compressor. (The Adler32 value |
applies to the whole dictionary even if only a subset of the dictionary is |
actually used by the compressor.) |
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a |
parameter is invalid (such as NULL dictionary) or the stream state |
is inconsistent (for example if deflate has already been called for this |
stream). deflateSetDictionary does not perform any compression: this will |
- be done by deflate(). |
+ be done by deflate(). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateCopy (z_streamp dest, z_streamp source); |
+PR_EXTERN(int) deflateCopy(z_streamp dest, z_streamp source); |
#else |
extern int EXPORT deflateCopy OF((z_streamp dest, z_streamp source)); |
#endif |
/* |
Sets the destination stream as a complete copy of the source stream. If |
the source stream is using an application-supplied history buffer, a new |
buffer is allocated for the destination stream. The compressed output |
buffer is always application-supplied. It's the responsibility of the |
@@ -510,32 +503,32 @@ extern int EXPORT deflateCopy OF((z_stre |
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not |
enough memory, Z_STREAM_ERROR if the source stream state was inconsistent |
(such as zalloc being NULL). msg is left unchanged in both source and |
destination. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateReset (z_streamp strm); |
+PR_EXTERN(int) deflateReset(z_streamp strm); |
#else |
extern int EXPORT deflateReset OF((z_streamp strm)); |
#endif |
/* |
This function is equivalent to deflateEnd followed by deflateInit, |
but does not free and reallocate all the internal compression state. |
The stream will keep the same compression level and any other attributes |
that may have been set by deflateInit2. |
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source |
stream state was inconsistent (such as zalloc or state being NULL). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateParams (z_streamp strm, int level, int strategy); |
+PR_EXTERN(int) deflateParams(z_streamp strm, int level, int strategy); |
#else |
extern int EXPORT deflateParams OF((z_streamp strm, int level, int strategy)); |
#endif |
/* |
Dynamically update the compression level and compression strategy. |
This can be used to switch between compression and straight copy of |
the input data, or to switch to a different kind of input data requiring |
a different strategy. If the compression level is changed, the input |
@@ -546,17 +539,17 @@ extern int EXPORT deflateParams OF((z_st |
a call of deflate(), since the currently available input may have to |
be compressed and flushed. In particular, strm->avail_out must be non-zero. |
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source |
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR |
if strm->avail_out was zero. |
*/ |
-/* |
+/* |
extern int EXPORT inflateInit2 OF((z_streamp strm, |
int windowBits)); |
This is another version of inflateInit with more compression options. The |
fields next_out, zalloc, zfree and opaque must be initialized before by |
the caller. |
The windowBits parameter is the base two logarithm of the maximum window |
@@ -582,23 +575,21 @@ extern int EXPORT inflateInit2 OF((z_str |
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was |
not enough memory, Z_STREAM_ERROR if a parameter is invalid (such as |
windowBits < 8). msg is set to null if there is no error message. |
inflateInit2 does not perform any decompression: this will be done by |
inflate(). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) inflateSetDictionary (z_streamp strm, |
- const Bytef *dictionary, |
- uInt dictLength); |
+PR_EXTERN(int) inflateSetDictionary(z_streamp strm, const Bytef *dictionary, |
+ uInt dictLength); |
#else |
-extern int EXPORT inflateSetDictionary OF((z_streamp strm, |
- const Bytef *dictionary, |
- uInt dictLength)); |
+extern int EXPORT inflateSetDictionary |
+ OF((z_streamp strm, const Bytef *dictionary, uInt dictLength)); |
#endif |
/* |
Initializes the decompression dictionary (history buffer) from the given |
uncompressed byte sequence. This function must be called immediately after |
a call of inflate if this call returned Z_NEED_DICT. The dictionary chosen |
by the compressor can be determined from the Adler32 value returned by this |
call of inflate. The compressor and decompressor must use exactly the same |
dictionary (see deflateSetDictionary). |
@@ -607,85 +598,84 @@ extern int EXPORT inflateSetDictionary O |
parameter is invalid (such as NULL dictionary) or the stream state is |
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the |
expected one (incorrect Adler32 value). inflateSetDictionary does not |
perform any decompression: this will be done by subsequent calls of |
inflate(). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) inflateSync (z_streamp strm); |
+PR_EXTERN(int) inflateSync(z_streamp strm); |
#else |
extern int EXPORT inflateSync OF((z_streamp strm)); |
#endif |
-/* |
+/* |
Skips invalid compressed data until the special marker (see deflate() |
above) can be found, or until all available input is skipped. No output |
is provided. |
inflateSync returns Z_OK if the special marker has been found, Z_BUF_ERROR |
if no more input was provided, Z_DATA_ERROR if no marker has been found, |
or Z_STREAM_ERROR if the stream structure was inconsistent. In the success |
case, the application may save the current current value of total_in which |
indicates where valid compressed data was found. In the error case, the |
application may repeatedly call inflateSync, providing more input each time, |
until success or end of the input data. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) inflateReset (z_streamp strm); |
+PR_EXTERN(int) inflateReset(z_streamp strm); |
#else |
extern int EXPORT inflateReset OF((z_streamp strm)); |
#endif |
/* |
This function is equivalent to inflateEnd followed by inflateInit, |
but does not free and reallocate all the internal decompression state. |
The stream will keep attributes that may have been set by inflateInit2. |
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source |
stream state was inconsistent (such as zalloc or state being NULL). |
*/ |
- |
- /* utility functions */ |
+/* utility functions */ |
/* |
The following utility functions are implemented on top of the |
basic stream-oriented functions. To simplify the interface, some |
default options are assumed (compression level, window size, |
standard memory allocation functions). The source code of these |
utility functions can easily be modified if you need special options. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) compress (Bytef *dest, uLongf *destLen, |
- const Bytef *source, uLong sourceLen); |
+PR_EXTERN(int) compress(Bytef *dest, uLongf *destLen, const Bytef *source, |
+ uLong sourceLen); |
#else |
-extern int EXPORT compress OF((Bytef *dest, uLongf *destLen, |
- const Bytef *source, uLong sourceLen)); |
+extern int EXPORT compress |
+ OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); |
#endif |
/* |
Compresses the source buffer into the destination buffer. sourceLen is |
the byte length of the source buffer. Upon entry, destLen is the total |
size of the destination buffer, which must be at least 0.1% larger than |
sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the |
compressed buffer. |
This function can be used to compress a whole file at once if the |
input file is mmap'ed. |
compress returns Z_OK if success, Z_MEM_ERROR if there was not |
enough memory, Z_BUF_ERROR if there was not enough room in the output |
buffer. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) uncompress (Bytef *dest, uLongf *destLen, |
- const Bytef *source, uLong sourceLen); |
+PR_EXTERN(int) uncompress(Bytef *dest, uLongf *destLen, const Bytef *source, |
+ uLong sourceLen); |
#else |
-extern int EXPORT uncompress OF((Bytef *dest, uLongf *destLen, |
- const Bytef *source, uLong sourceLen)); |
+extern int EXPORT uncompress |
+ OF((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); |
#endif |
/* |
Decompresses the source buffer into the destination buffer. sourceLen is |
the byte length of the source buffer. Upon entry, destLen is the total |
size of the destination buffer, which must be large enough to hold the |
entire uncompressed data. (The size of the uncompressed data must have |
been saved previously by the compressor and transmitted to the decompressor |
by some mechanism outside the scope of this compression library.) |
@@ -693,123 +683,122 @@ extern int EXPORT uncompress OF((Bytef * |
This function can be used to decompress a whole file at once if the |
input file is mmap'ed. |
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not |
enough memory, Z_BUF_ERROR if there was not enough room in the output |
buffer, or Z_DATA_ERROR if the input data was corrupted. |
*/ |
- |
typedef voidp gzFile; |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(gzFile) gzopen (const char *path, const char *mode); |
+PR_EXTERN(gzFile) gzopen(const char *path, const char *mode); |
#else |
-extern gzFile EXPORT gzopen OF((const char *path, const char *mode)); |
+extern gzFile EXPORT gzopen OF((const char *path, const char *mode)); |
#endif |
/* |
Opens a gzip (.gz) file for reading or writing. The mode parameter |
is as in fopen ("rb" or "wb") but can also include a compression level |
("wb9"). gzopen can be used to read a file which is not in gzip format; |
in this case gzread will directly read from the file without decompression. |
gzopen returns NULL if the file could not be opened or if there was |
insufficient memory to allocate the (de)compression state; errno |
can be checked to distinguish the two cases (if errno is zero, the |
zlib error is Z_MEM_ERROR). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(gzFile) gzdopen (int fd, const char *mode); |
+PR_EXTERN(gzFile) gzdopen(int fd, const char *mode); |
#else |
-extern gzFile EXPORT gzdopen OF((int fd, const char *mode)); |
+extern gzFile EXPORT gzdopen OF((int fd, const char *mode)); |
#endif |
/* |
gzdopen() associates a gzFile with the file descriptor fd. File |
descriptors are obtained from calls like open, dup, creat, pipe or |
fileno (in the file has been previously opened with fopen). |
The mode parameter is as in gzopen. |
The next call of gzclose on the returned gzFile will also close the |
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file |
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). |
gzdopen returns NULL if there was insufficient memory to allocate |
the (de)compression state. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) gzread (gzFile file, voidp buf, unsigned len); |
+PR_EXTERN(int) gzread(gzFile file, voidp buf, unsigned len); |
#else |
-extern int EXPORT gzread OF((gzFile file, voidp buf, unsigned len)); |
+extern int EXPORT gzread OF((gzFile file, voidp buf, unsigned len)); |
#endif |
/* |
Reads the given number of uncompressed bytes from the compressed file. |
If the input file was not in gzip format, gzread copies the given number |
of bytes into the buffer. |
gzread returns the number of uncompressed bytes actually read (0 for |
end of file, -1 for error). */ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) gzwrite (gzFile file, const voidp buf, unsigned len); |
+PR_EXTERN(int) gzwrite(gzFile file, const voidp buf, unsigned len); |
#else |
-extern int EXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len)); |
+extern int EXPORT gzwrite OF((gzFile file, const voidp buf, unsigned len)); |
#endif |
/* |
Writes the given number of uncompressed bytes into the compressed file. |
gzwrite returns the number of uncompressed bytes actually written |
(0 in case of error). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) gzflush (gzFile file, int flush); |
+PR_EXTERN(int) gzflush(gzFile file, int flush); |
#else |
-extern int EXPORT gzflush OF((gzFile file, int flush)); |
+extern int EXPORT gzflush OF((gzFile file, int flush)); |
#endif |
/* |
Flushes all pending output into the compressed file. The parameter |
flush is as in the deflate() function. The return value is the zlib |
error number (see function gzerror below). gzflush returns Z_OK if |
the flush parameter is Z_FINISH and all output could be flushed. |
gzflush should be called only when strictly necessary because it can |
degrade compression. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) gzclose (gzFile file); |
+PR_EXTERN(int) gzclose(gzFile file); |
#else |
-extern int EXPORT gzclose OF((gzFile file)); |
+extern int EXPORT gzclose OF((gzFile file)); |
#endif |
/* |
Flushes all pending output if necessary, closes the compressed file |
and deallocates all the (de)compression state. The return value is the zlib |
error number (see function gzerror below). |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(const char *) gzerror (gzFile file, int *errnum); |
+PR_EXTERN(const char *) gzerror(gzFile file, int *errnum); |
#else |
-extern const char * EXPORT gzerror OF((gzFile file, int *errnum)); |
+extern const char *EXPORT gzerror OF((gzFile file, int *errnum)); |
#endif |
/* |
Returns the error message for the last error which occurred on the |
given compressed file. errnum is set to zlib error number. If an |
error occurred in the file system and not in the compression library, |
errnum is set to Z_ERRNO and the application may consult errno |
to get the exact error code. |
*/ |
- /* checksum functions */ |
+/* checksum functions */ |
/* |
These functions are not related to compression but are exported |
anyway because they might be useful in applications using the |
compression library. |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(uLong) adler32 (uLong adler, const Bytef *buf, uInt len); |
+PR_EXTERN(uLong) adler32(uLong adler, const Bytef *buf, uInt len); |
#else |
extern uLong EXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); |
#endif |
/* |
Update a running Adler-32 checksum with the bytes buf[0..len-1] and |
return the updated checksum. If buf is NULL, this function returns |
the required initial value for the checksum. |
@@ -820,76 +809,75 @@ extern uLong EXPORT adler32 OF((uLong ad |
while (read_buffer(buffer, length) != EOF) { |
adler = adler32(adler, buffer, length); |
} |
if (adler != original_adler) error(); |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(uLong) crc32 (uLong crc, const Bytef *buf, uInt len); |
+PR_EXTERN(uLong) crc32(uLong crc, const Bytef *buf, uInt len); |
#else |
-extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); |
+extern uLong EXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); |
#endif |
/* |
Update a running crc with the bytes buf[0..len-1] and return the updated |
crc. If buf is NULL, this function returns the required initial value |
for the crc. Pre- and post-conditioning (one's complement) is performed |
within this function so it shouldn't be done by the application. |
Usage example: |
uLong crc = crc32(0L, Z_NULL, 0); |
while (read_buffer(buffer, length) != EOF) { |
crc = crc32(crc, buffer, length); |
} |
if (crc != original_crc) error(); |
*/ |
- |
- /* various hacks, don't look :) */ |
+/* various hacks, don't look :) */ |
/* deflateInit and inflateInit are macros to allow checking the zlib version |
* and the compiler's view of z_stream: |
*/ |
#ifdef MOZILLA_CLIENT |
-PR_EXTERN(int) deflateInit (z_streamp strm, int level, const char *version, |
- int stream_size); |
-PR_EXTERN(int) inflateInit_(z_streamp strm, const char *version, |
- int stream_size); |
-PR_EXTERN(int) deflateInit2_(z_streamp strm, int level, int method, |
- int windowBits, int memLevel, int strategy, |
- const char *version, int stream_size); |
-PR_EXTERN(int) inflateInit2_(z_streamp strm, int windowBits, |
- const char *version, int stream_size); |
+PR_EXTERN(int) deflateInit(z_streamp strm, int level, const char *version, |
+ int stream_size); |
+PR_EXTERN(int) |
+ inflateInit_(z_streamp strm, const char *version, int stream_size); |
+PR_EXTERN(int) deflateInit2_(z_streamp strm, int level, int method, |
+ int windowBits, int memLevel, int strategy, |
+ const char *version, int stream_size); |
+PR_EXTERN(int) inflateInit2_(z_streamp strm, int windowBits, |
+ const char *version, int stream_size); |
#else |
-extern int EXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, |
- int stream_size)); |
-extern int EXPORT inflateInit_ OF((z_streamp strm, const char *version, |
- int stream_size)); |
-extern int EXPORT deflateInit2_ OF((z_streamp strm, int level, int method, |
- int windowBits, int memLevel, int strategy, |
- const char *version, int stream_size)); |
-extern int EXPORT inflateInit2_ OF((z_streamp strm, int windowBits, |
- const char *version, int stream_size)); |
+extern int EXPORT deflateInit_ |
+ OF((z_streamp strm, int level, const char *version, int stream_size)); |
+extern int EXPORT inflateInit_ |
+ OF((z_streamp strm, const char *version, int stream_size)); |
+extern int EXPORT deflateInit2_ |
+ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, |
+ int strategy, const char *version, int stream_size)); |
+extern int EXPORT inflateInit2_ |
+ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); |
#endif /* MOZILLA_CLIENT */ |
- |
#define deflateInit(strm, level) \ |
- deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) |
-#define inflateInit(strm) \ |
- inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) |
+ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) |
+#define inflateInit(strm) inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) |
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ |
- deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ |
- (strategy), ZLIB_VERSION, sizeof(z_stream)) |
+ deflateInit2_((strm), (level), (method), (windowBits), (memLevel), \ |
+ (strategy), ZLIB_VERSION, sizeof(z_stream)) |
#define inflateInit2(strm, windowBits) \ |
- inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) |
+ inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) |
#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) |
- struct internal_state {int dummy;}; /* hack for buggy compilers */ |
+struct internal_state { |
+ int dummy; |
+}; /* hack for buggy compilers */ |
#endif |
uLongf *get_crc_table OF((void)); /* can be used by asm versions of crc32() */ |
#ifdef __cplusplus |
} |
#endif |