]> git.sur5r.net Git - cc65/blobdiff - include/zlib.h
Fixed _textcolor definition.
[cc65] / include / zlib.h
index 8fa6a2bd12c7c035e545e7a04f7e79e0a3fd6bbb..8ced898004a4cc7364a2c2d0f839a0e0e0971e5c 100644 (file)
-/*****************************************************************************/\r
-/*                                                                           */\r
-/*                                  zlib.h                                   */\r
-/*                                                                           */\r
-/*              Decompression routines for the 'deflate' format              */\r
-/*                                                                           */\r
-/*                                                                           */\r
-/*                                                                           */\r
-/* (C) 2000-2015 Piotr Fusik <fox@scene.pl>                                  */\r
-/*                                                                           */\r
-/* This file is based on the zlib.h from 'zlib' general purpose compression  */\r
-/* library, version 1.1.3, (C) 1995-1998 Jean-loup Gailly and Mark Adler.    */\r
-/*                                                                           */\r
-/*  Jean-loup Gailly        Mark Adler                                       */\r
-/*  jloup@gzip.org          madler@alumni.caltech.edu                        */\r
-/*                                                                           */\r
-/* This software is provided 'as-is', without any expressed or implied       */\r
-/* warranty.  In no event will the authors be held liable for any damages    */\r
-/* arising from the use of this software.                                    */\r
-/*                                                                           */\r
-/* Permission is granted to anyone to use this software for any purpose,     */\r
-/* including commercial applications, and to alter it and redistribute it    */\r
-/* freely, subject to the following restrictions:                            */\r
-/*                                                                           */\r
-/* 1. The origin of this software must not be misrepresented; you must not   */\r
-/*    claim that you wrote the original software. If you use this software   */\r
-/*    in a product, an acknowledgment in the product documentation would be  */\r
-/*    appreciated but is not required.                                       */\r
-/* 2. Altered source versions must be plainly marked as such, and must not   */\r
-/*    be misrepresented as being the original software.                      */\r
-/* 3. This notice may not be removed or altered from any source              */\r
-/*    distribution.                                                          */\r
-/*                                                                           */\r
-/*****************************************************************************/\r
-\r
-\r
-\r
-#ifndef _ZLIB_H\r
-#define _ZLIB_H\r
-\r
-#define Z_OK         0\r
-#define Z_DATA_ERROR (-3)\r
-/* Return codes for uncompress() */\r
-\r
-#define Z_DEFLATED   8\r
-/* The deflate compression method (the only one supported) */\r
-\r
-#define Z_NULL       0\r
-\r
-\r
-unsigned __fastcall__ inflatemem (char* dest, const char* source);\r
-/*\r
-     Decompresses the source buffer into the destination buffer.\r
-   Returns the size of the uncompressed data (number of bytes written starting\r
-   from dest).\r
-\r
-     This function expects data in the DEFLATE format, described in RFC\r
-   (Request for Comments) 1951 in the file\r
-   ftp://ds.internic.net/rfc/rfc1951.txt.\r
-\r
-     This function does not exist in the original zlib. Its implementation\r
-   using original zlib might be following:\r
-\r
-   unsigned inflatemem (char* dest, const char* source)\r
-   {\r
-     z_stream stream;\r
-\r
-     stream.next_in = (Bytef*) source;\r
-     stream.avail_in = 65535;\r
-\r
-     stream.next_out = dest;\r
-     stream.avail_out = 65535;\r
-\r
-     stream.zalloc = (alloc_func) 0;\r
-     stream.zfree = (free_func) 0;\r
-\r
-     inflateInit2(&stream, -MAX_WBITS);\r
-     inflate(&stream, Z_FINISH);\r
-     inflateEnd(&stream);\r
-\r
-     return stream.total_out;\r
-   }\r
-*/\r
-\r
-\r
-int __fastcall__ uncompress (char* dest, unsigned* destLen,\r
-                             const char* source, unsigned sourceLen);\r
-/*\r
-   Original zlib description:\r
-\r
-     Decompresses the source buffer into the destination buffer.  sourceLen is\r
-   the byte length of the source buffer. Upon entry, destLen is the total\r
-   size of the destination buffer, which must be large enough to hold the\r
-   entire uncompressed data. (The size of the uncompressed data must have\r
-   been saved previously by the compressor and transmitted to the decompressor\r
-   by some mechanism outside the scope of this compression library.)\r
-   Upon exit, destLen is the actual size of the compressed buffer.\r
-     This function can be used to decompress a whole file at once if the\r
-   input file is mmap'ed.\r
-\r
-     uncompress returns Z_OK if success, Z_MEM_ERROR if there was not\r
-   enough memory, Z_BUF_ERROR if there was not enough room in the output\r
-   buffer, or Z_DATA_ERROR if the input data was corrupted.\r
-\r
-   Implementation notes:\r
-\r
-     This function expects data in the ZLIB format, described in RFC 1950\r
-   in the file ftp://ds.internic.net/rfc/rfc1950.txt. The ZLIB format is\r
-   essentially the DEFLATE format plus a very small header and Adler-32\r
-   checksum.\r
-\r
-     Z_MEM_ERROR and Z_BUF_ERROR are never returned in this implementation.\r
-*/\r
-\r
-\r
-unsigned long __fastcall__ adler32 (unsigned long adler, const char* buf,\r
-                                    unsigned len);\r
-\r
-/*\r
-   Original zlib description:\r
-\r
-     Update a running Adler-32 checksum with the bytes buf[0..len-1] and\r
-   return the updated checksum. If buf is NULL, this function returns\r
-   the required initial value for the checksum.\r
-   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed\r
-   much faster. Usage example:\r
-\r
-     unsigned long adler = adler32(0L, Z_NULL, 0);\r
-\r
-     while (read_buffer(buffer, length) != EOF) {\r
-       adler = adler32(adler, buffer, length);\r
-     }\r
-     if (adler != original_adler) error();\r
-\r
-   Implementation notes:\r
-\r
-     This function isn't actually much faster than crc32(), but it is smaller\r
-   and does not use any lookup tables.\r
-*/\r
-\r
-\r
-unsigned long __fastcall__ crc32 (unsigned long crc, const char* buf,\r
-                                  unsigned len);\r
-/*\r
-   Original zlib description:\r
-\r
-     Update a running crc with the bytes buf[0..len-1] and return the updated\r
-   crc. If buf is NULL, this function returns the required initial value\r
-   for the crc. Pre- and post-conditioning (one's complement) is performed\r
-   within this function so it shouldn't be done by the application.\r
-   Usage example:\r
-\r
-     unsigned long crc = crc32(0L, Z_NULL, 0);\r
-\r
-     while (read_buffer(buffer, length) != EOF) {\r
-       crc = crc32(crc, buffer, length);\r
-     }\r
-     if (crc != original_crc) error();\r
-\r
-   Implementation notes:\r
-\r
-     This function uses statically allocated 1 KB lookup table. The table is\r
-   initialised before it is used for the first time (that is, if buffer is\r
-   NULL or length is zero, then the lookup table isn't initialised).\r
-*/\r
-\r
-\r
-/* end of zlib.h */\r
-#endif\r
-\r
-\r
-\r
+/*****************************************************************************/
+/*                                                                           */
+/*                                  zlib.h                                   */
+/*                                                                           */
+/*              Decompression routines for the 'deflate' format              */
+/*                                                                           */
+/*                                                                           */
+/*                                                                           */
+/* (C) 2000-2015 Piotr Fusik <fox@scene.pl>                                  */
+/*                                                                           */
+/* This file is based on the zlib.h from 'zlib' general purpose compression  */
+/* library, version 1.1.3, (C) 1995-1998 Jean-loup Gailly and Mark Adler.    */
+/*                                                                           */
+/*  Jean-loup Gailly        Mark Adler                                       */
+/*  jloup@gzip.org          madler@alumni.caltech.edu                        */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+
+
+#ifndef _ZLIB_H
+#define _ZLIB_H
+
+#define Z_OK         0
+#define Z_DATA_ERROR (-3)
+/* Return codes for uncompress() */
+
+#define Z_DEFLATED   8
+/* The deflate compression method (the only one supported) */
+
+#define Z_NULL       0
+
+
+unsigned __fastcall__ inflatemem (char* dest, const char* source);
+/*
+     Decompresses the source buffer into the destination buffer.
+   Returns the size of the uncompressed data (number of bytes written starting
+   from dest).
+
+     This function expects data in the DEFLATE format, described in RFC
+   (Request for Comments) 1951 in the file
+   ftp://ds.internic.net/rfc/rfc1951.txt.
+
+     This function does not exist in the original zlib. Its implementation
+   using original zlib might be following:
+
+   unsigned inflatemem (char* dest, const char* source)
+   {
+     z_stream stream;
+
+     stream.next_in = (Bytef*) source;
+     stream.avail_in = 65535;
+
+     stream.next_out = dest;
+     stream.avail_out = 65535;
+
+     stream.zalloc = (alloc_func) 0;
+     stream.zfree = (free_func) 0;
+
+     inflateInit2(&stream, -MAX_WBITS);
+     inflate(&stream, Z_FINISH);
+     inflateEnd(&stream);
+
+     return stream.total_out;
+   }
+*/
+
+
+int __fastcall__ uncompress (char* dest, unsigned* destLen,
+                             const char* source, unsigned sourceLen);
+/*
+   Original zlib description:
+
+     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.)
+   Upon exit, destLen is the actual size of the compressed buffer.
+     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.
+
+   Implementation notes:
+
+     This function expects data in the ZLIB format, described in RFC 1950
+   in the file ftp://ds.internic.net/rfc/rfc1950.txt. The ZLIB format is
+   essentially the DEFLATE format plus a very small header and Adler-32
+   checksum.
+
+     Z_MEM_ERROR and Z_BUF_ERROR are never returned in this implementation.
+*/
+
+
+unsigned long __fastcall__ adler32 (unsigned long adler, const char* buf,
+                                    unsigned len);
+
+/*
+   Original zlib description:
+
+     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.
+   An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
+   much faster. Usage example:
+
+     unsigned long adler = adler32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       adler = adler32(adler, buffer, length);
+     }
+     if (adler != original_adler) error();
+
+   Implementation notes:
+
+     This function isn't actually much faster than crc32(), but it is smaller
+   and does not use any lookup tables.
+*/
+
+
+unsigned long __fastcall__ crc32 (unsigned long crc, const char* buf,
+                                  unsigned len);
+/*
+   Original zlib description:
+
+     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:
+
+     unsigned long crc = crc32(0L, Z_NULL, 0);
+
+     while (read_buffer(buffer, length) != EOF) {
+       crc = crc32(crc, buffer, length);
+     }
+     if (crc != original_crc) error();
+
+   Implementation notes:
+
+     This function uses statically allocated 1 KB lookup table. The table is
+   initialised before it is used for the first time (that is, if buffer is
+   NULL or length is zero, then the lookup table isn't initialised).
+*/
+
+
+/* end of zlib.h */
+#endif
+
+
+