srcanamdw/codescanner/pyinstaller/source/zlib/unzip.h
author noe\swadi
Thu, 18 Feb 2010 12:29:02 +0530
changeset 1 22878952f6e2
permissions -rw-r--r--
Committing the CodeScanner Core tool This component has been moved from the StaticAnaApps package. BUG : 5889 (http://developer.symbian.org/webbugs/show_bug.cgi?id=5889).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     1
/* unzip.h -- IO for uncompress .zip files using zlib
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     2
   Version 1.01e, February 12th, 2005
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     3
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     4
   Copyright (C) 1998-2005 Gilles Vollant
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     5
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     6
   This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     7
     WinZip, InfoZip tools and compatible.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     8
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
     9
   Multi volume ZipFile (span) are not supported.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    10
   Encryption compatible with pkzip 2.04g only supported
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    11
   Old compressions used by old PKZip 1.x are not supported
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    12
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    13
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    14
   I WAIT FEEDBACK at mail info@winimage.com
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    15
   Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    16
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    17
   Condition of use and distribution are the same than zlib :
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    18
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    19
  This software is provided 'as-is', without any express or implied
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    20
  warranty.  In no event will the authors be held liable for any damages
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    21
  arising from the use of this software.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    22
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    23
  Permission is granted to anyone to use this software for any purpose,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    24
  including commercial applications, and to alter it and redistribute it
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    25
  freely, subject to the following restrictions:
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    26
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    27
  1. The origin of this software must not be misrepresented; you must not
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    28
     claim that you wrote the original software. If you use this software
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    29
     in a product, an acknowledgment in the product documentation would be
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    30
     appreciated but is not required.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    31
  2. Altered source versions must be plainly marked as such, and must not be
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    32
     misrepresented as being the original software.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    33
  3. This notice may not be removed or altered from any source distribution.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    34
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    35
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    36
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    37
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    38
/* for more info about .ZIP format, see
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    39
      http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    40
      http://www.info-zip.org/pub/infozip/doc/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    41
   PkWare has also a specification at :
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    42
      ftp://ftp.pkware.com/probdesc.zip
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    43
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    44
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    45
#ifndef _unz_H
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    46
#define _unz_H
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    47
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    48
#ifdef __cplusplus
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    49
extern "C" {
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    50
#endif
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    51
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    52
#ifndef _ZLIB_H
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    53
#include "zlib.h"
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    54
#endif
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    55
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    56
#ifndef _ZLIBIOAPI_H
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    57
#include "ioapi.h"
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    58
#endif
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    59
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    60
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    61
/* like the STRICT of WIN32, we define a pointer that cannot be converted
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    62
    from (void*) without cast */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    63
typedef struct TagunzFile__ { int unused; } unzFile__;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    64
typedef unzFile__ *unzFile;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    65
#else
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    66
typedef voidp unzFile;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    67
#endif
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    68
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    69
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    70
#define UNZ_OK                          (0)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    71
#define UNZ_END_OF_LIST_OF_FILE         (-100)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    72
#define UNZ_ERRNO                       (Z_ERRNO)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    73
#define UNZ_EOF                         (0)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    74
#define UNZ_PARAMERROR                  (-102)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    75
#define UNZ_BADZIPFILE                  (-103)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    76
#define UNZ_INTERNALERROR               (-104)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    77
#define UNZ_CRCERROR                    (-105)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    78
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    79
/* tm_unz contain date/time info */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    80
typedef struct tm_unz_s
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    81
{
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    82
    uInt tm_sec;            /* seconds after the minute - [0,59] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    83
    uInt tm_min;            /* minutes after the hour - [0,59] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    84
    uInt tm_hour;           /* hours since midnight - [0,23] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    85
    uInt tm_mday;           /* day of the month - [1,31] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    86
    uInt tm_mon;            /* months since January - [0,11] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    87
    uInt tm_year;           /* years - [1980..2044] */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    88
} tm_unz;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    89
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    90
/* unz_global_info structure contain global data about the ZIPfile
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    91
   These data comes from the end of central dir */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    92
typedef struct unz_global_info_s
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    93
{
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    94
    uLong number_entry;         /* total number of entries in
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    95
                       the central dir on this disk */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    96
    uLong size_comment;         /* size of the global comment of the zipfile */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    97
} unz_global_info;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    98
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
    99
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   100
/* unz_file_info contain information about a file in the zipfile */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   101
typedef struct unz_file_info_s
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   102
{
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   103
    uLong version;              /* version made by                 2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   104
    uLong version_needed;       /* version needed to extract       2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   105
    uLong flag;                 /* general purpose bit flag        2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   106
    uLong compression_method;   /* compression method              2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   107
    uLong dosDate;              /* last mod file date in Dos fmt   4 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   108
    uLong crc;                  /* crc-32                          4 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   109
    uLong compressed_size;      /* compressed size                 4 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   110
    uLong uncompressed_size;    /* uncompressed size               4 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   111
    uLong size_filename;        /* filename length                 2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   112
    uLong size_file_extra;      /* extra field length              2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   113
    uLong size_file_comment;    /* file comment length             2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   114
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   115
    uLong disk_num_start;       /* disk number start               2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   116
    uLong internal_fa;          /* internal file attributes        2 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   117
    uLong external_fa;          /* external file attributes        4 bytes */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   118
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   119
    tm_unz tmu_date;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   120
} unz_file_info;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   121
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   122
extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   123
                                                 const char* fileName2,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   124
                                                 int iCaseSensitivity));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   125
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   126
   Compare two filename (fileName1,fileName2).
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   127
   If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   128
   If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   129
                                or strcasecmp)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   130
   If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   131
    (like 1 on Unix, 2 on Windows)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   132
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   133
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   134
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   135
extern unzFile ZEXPORT unzOpen OF((const char *path));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   136
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   137
  Open a Zip file. path contain the full pathname (by example,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   138
     on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   139
     "zlib/zlib113.zip".
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   140
     If the zipfile cannot be opened (file don't exist or in not valid), the
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   141
       return value is NULL.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   142
     Else, the return value is a unzFile Handle, usable with other function
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   143
       of this unzip package.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   144
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   145
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   146
extern unzFile ZEXPORT unzOpen2 OF((const char *path,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   147
                                    zlib_filefunc_def* pzlib_filefunc_def));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   148
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   149
   Open a Zip file, like unzOpen, but provide a set of file low level API
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   150
      for read/write the zip file (see ioapi.h)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   151
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   152
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   153
extern int ZEXPORT unzClose OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   154
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   155
  Close a ZipFile opened with unzipOpen.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   156
  If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   157
    these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   158
  return UNZ_OK if there is no problem. */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   159
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   160
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   161
                                        unz_global_info *pglobal_info));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   162
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   163
  Write info about the ZipFile in the *pglobal_info structure.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   164
  No preparation of the structure is needed
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   165
  return UNZ_OK if there is no problem. */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   166
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   167
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   168
extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   169
                                           char *szComment,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   170
                                           uLong uSizeBuf));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   171
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   172
  Get the global comment string of the ZipFile, in the szComment buffer.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   173
  uSizeBuf is the size of the szComment buffer.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   174
  return the number of byte copied or an error code <0
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   175
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   176
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   177
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   178
/***************************************************************************/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   179
/* Unzip package allow you browse the directory of the zipfile */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   180
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   181
extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   182
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   183
  Set the current file of the zipfile to the first file.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   184
  return UNZ_OK if there is no problem
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   185
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   186
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   187
extern int ZEXPORT unzGoToNextFile OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   188
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   189
  Set the current file of the zipfile to the next file.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   190
  return UNZ_OK if there is no problem
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   191
  return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   192
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   193
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   194
extern int ZEXPORT unzLocateFile OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   195
                     const char *szFileName,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   196
                     int iCaseSensitivity));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   197
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   198
  Try locate the file szFileName in the zipfile.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   199
  For the iCaseSensitivity signification, see unzStringFileNameCompare
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   200
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   201
  return value :
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   202
  UNZ_OK if the file is found. It becomes the current file.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   203
  UNZ_END_OF_LIST_OF_FILE if the file is not found
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   204
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   205
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   206
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   207
/* ****************************************** */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   208
/* Ryan supplied functions */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   209
/* unz_file_info contain information about a file in the zipfile */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   210
typedef struct unz_file_pos_s
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   211
{
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   212
    uLong pos_in_zip_directory;   /* offset in zip file directory */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   213
    uLong num_of_file;            /* # of file */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   214
} unz_file_pos;
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   215
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   216
extern int ZEXPORT unzGetFilePos(
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   217
    unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   218
    unz_file_pos* file_pos);
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   219
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   220
extern int ZEXPORT unzGoToFilePos(
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   221
    unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   222
    unz_file_pos* file_pos);
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   223
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   224
/* ****************************************** */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   225
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   226
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   227
                         unz_file_info *pfile_info,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   228
                         char *szFileName,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   229
                         uLong fileNameBufferSize,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   230
                         void *extraField,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   231
                         uLong extraFieldBufferSize,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   232
                         char *szComment,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   233
                         uLong commentBufferSize));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   234
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   235
  Get Info about the current file
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   236
  if pfile_info!=NULL, the *pfile_info structure will contain somes info about
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   237
        the current file
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   238
  if szFileName!=NULL, the filemane string will be copied in szFileName
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   239
            (fileNameBufferSize is the size of the buffer)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   240
  if extraField!=NULL, the extra field information will be copied in extraField
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   241
            (extraFieldBufferSize is the size of the buffer).
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   242
            This is the Central-header version of the extra field
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   243
  if szComment!=NULL, the comment string of the file will be copied in szComment
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   244
            (commentBufferSize is the size of the buffer)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   245
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   246
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   247
/***************************************************************************/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   248
/* for reading the content of the current zipfile, you can open it, read data
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   249
   from it, and close it (you can close it before reading all the file)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   250
   */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   251
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   252
extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   253
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   254
  Open for reading data the current file in the zipfile.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   255
  If there is no error, the return value is UNZ_OK.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   256
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   257
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   258
extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   259
                                                  const char* password));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   260
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   261
  Open for reading data the current file in the zipfile.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   262
  password is a crypting password
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   263
  If there is no error, the return value is UNZ_OK.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   264
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   265
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   266
extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   267
                                           int* method,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   268
                                           int* level,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   269
                                           int raw));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   270
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   271
  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   272
    if raw==1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   273
  *method will receive method of compression, *level will receive level of
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   274
     compression
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   275
  note : you can set level parameter as NULL (if you did not want known level,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   276
         but you CANNOT set method parameter as NULL
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   277
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   278
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   279
extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   280
                                           int* method,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   281
                                           int* level,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   282
                                           int raw,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   283
                                           const char* password));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   284
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   285
  Same than unzOpenCurrentFile, but open for read raw the file (not uncompress)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   286
    if raw==1
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   287
  *method will receive method of compression, *level will receive level of
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   288
     compression
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   289
  note : you can set level parameter as NULL (if you did not want known level,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   290
         but you CANNOT set method parameter as NULL
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   291
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   292
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   293
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   294
extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   295
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   296
  Close the file in zip opened with unzOpenCurrentFile
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   297
  Return UNZ_CRCERROR if all the file was read but the CRC is not good
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   298
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   299
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   300
extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   301
                      voidp buf,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   302
                      unsigned len));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   303
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   304
  Read bytes from the current file (opened by unzOpenCurrentFile)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   305
  buf contain buffer where data must be copied
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   306
  len the size of buf.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   307
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   308
  return the number of byte copied if somes bytes are copied
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   309
  return 0 if the end of file was reached
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   310
  return <0 with error code if there is an error
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   311
    (UNZ_ERRNO for IO error, or zLib error for uncompress error)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   312
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   313
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   314
extern z_off_t ZEXPORT unztell OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   315
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   316
  Give the current position in uncompressed data
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   317
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   318
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   319
extern int ZEXPORT unzeof OF((unzFile file));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   320
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   321
  return 1 if the end of file was reached, 0 elsewhere
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   322
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   323
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   324
extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   325
                                             voidp buf,
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   326
                                             unsigned len));
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   327
/*
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   328
  Read extra field from the current file (opened by unzOpenCurrentFile)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   329
  This is the local-header version of the extra field (sometimes, there is
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   330
    more info in the local-header version than in the central-header)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   331
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   332
  if buf==NULL, it return the size of the local extra field
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   333
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   334
  if buf!=NULL, len is the size of the buffer, the extra header is copied in
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   335
    buf.
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   336
  the return value is the number of bytes copied in buf, or (if <0)
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   337
    the error code
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   338
*/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   339
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   340
/***************************************************************************/
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   341
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   342
/* Get the current file offset */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   343
extern uLong ZEXPORT unzGetOffset (unzFile file);
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   344
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   345
/* Set the current file offset */
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   346
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   347
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   348
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   349
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   350
#ifdef __cplusplus
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   351
}
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   352
#endif
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   353
22878952f6e2 Committing the CodeScanner Core tool
noe\swadi
parents:
diff changeset
   354
#endif /* _unz_H */