aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/zlib/uncompr.c
diff options
context:
space:
mode:
authorf0b0s <f0b0s@yandex-team.ru>2022-02-10 16:46:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:51 +0300
commitdeabc5260ac2e17b8f5152ee060bec1740613540 (patch)
treebc498b2fe3c447d13c2abea85b429fee8dd485ef /contrib/libs/zlib/uncompr.c
parent2e6009493e74f88988b81f219b301f450331648d (diff)
downloadydb-deabc5260ac2e17b8f5152ee060bec1740613540.tar.gz
Restoring authorship annotation for <f0b0s@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/zlib/uncompr.c')
-rw-r--r--contrib/libs/zlib/uncompr.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/contrib/libs/zlib/uncompr.c b/contrib/libs/zlib/uncompr.c
index f03a1a865e..c0501ab2a7 100644
--- a/contrib/libs/zlib/uncompr.c
+++ b/contrib/libs/zlib/uncompr.c
@@ -1,14 +1,14 @@
-/* uncompr.c -- decompress a memory buffer
+/* uncompr.c -- decompress a memory buffer
* Copyright (C) 1995-2003, 2010, 2014, 2016 Jean-loup Gailly, Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#define ZLIB_INTERNAL
-#include "zlib.h"
-
-/* ===========================================================================
+ * For conditions of distribution and use, see copyright notice in zlib.h
+ */
+
+/* @(#) $Id$ */
+
+#define ZLIB_INTERNAL
+#include "zlib.h"
+
+/* ===========================================================================
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
@@ -18,24 +18,24 @@
*destLen is the size of the decompressed data and *sourceLen is the number
of source bytes consumed. Upon return, source + *sourceLen points to the
first unused input byte.
-
+
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, including if the input data is
an incomplete zlib stream.
-*/
+*/
int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
- Bytef *dest;
- uLongf *destLen;
- const Bytef *source;
+ Bytef *dest;
+ uLongf *destLen;
+ const Bytef *source;
uLong *sourceLen;
-{
- z_stream stream;
- int err;
+{
+ z_stream stream;
+ int err;
const uInt max = (uInt)-1;
uLong len, left;
Byte buf[1]; /* for detection of incomplete stream when *destLen == 0 */
-
+
len = *sourceLen;
if (*destLen) {
left = *destLen;
@@ -46,18 +46,18 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
dest = buf;
}
- stream.next_in = (z_const Bytef *)source;
+ stream.next_in = (z_const Bytef *)source;
stream.avail_in = 0;
- stream.zalloc = (alloc_func)0;
- stream.zfree = (free_func)0;
+ stream.zalloc = (alloc_func)0;
+ stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
-
- err = inflateInit(&stream);
- if (err != Z_OK) return err;
-
+
+ err = inflateInit(&stream);
+ if (err != Z_OK) return err;
+
stream.next_out = dest;
stream.avail_out = 0;
-
+
do {
if (stream.avail_out == 0) {
stream.avail_out = left > (uLong)max ? max : (uInt)left;
@@ -81,7 +81,7 @@ int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
err == Z_NEED_DICT ? Z_DATA_ERROR :
err == Z_BUF_ERROR && left + stream.avail_out ? Z_DATA_ERROR :
err;
-}
+}
int ZEXPORT uncompress (dest, destLen, source, sourceLen)
Bytef *dest;