Read unzip.h for more info
*/
+/* Modified my Joseph Wenninger*/
#include <stdio.h>
#include <stdlib.h>
#include "global.h"
#include "tables.h"
-#ifndef local
-# define local static
-#endif
-/* compile with -Dlocal if your debugger can't find static symbols */
*/
-local int unzlocal_getByte(fin,pi)
+ int unzlocal_getByte(fin,pi)
FILE *fin;
int *pi;
{
/* ===========================================================================
Reads a long in LSB order from the given gz_stream. Sets
*/
-local int unzlocal_getShort (fin,pX)
+ int unzlocal_getShort (fin,pX)
FILE* fin;
uLong *pX;
{
return err;
}
-local int unzlocal_getLong (fin,pX)
+ int unzlocal_getLong (fin,pX)
FILE* fin;
uLong *pX;
{
/* My own strcmpi / strcasecmp */
-local int strcmpcasenosensitive_internal (fileName1,fileName2)
+ int strcmpcasenosensitive_internal (fileName1,fileName2)
const char* fileName1;
const char* fileName2;
{
(like 1 on Unix, 2 on Windows)
*/
-extern int ZEXPORT unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
+ int unzStringFileNameCompare (fileName1,fileName2,iCaseSensitivity)
const char* fileName1;
const char* fileName2;
int iCaseSensitivity;
Locate the Central directory of a zipfile (at the end, just before
the global comment)
*/
-local uLong unzlocal_SearchCentralDir(fin)
+ uLong unzlocal_SearchCentralDir(fin)
FILE *fin;
{
unsigned char* buf;
Else, the return value is a unzFile Handle, usable with other function
of this unzip package.
*/
-extern unzFile ZEXPORT unzOpen (path)
+ unzFile unzOpen (path)
const char *path;
{
unz_s us;
If there is files inside the .Zip opened with unzipOpenCurrentFile (see later),
these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzClose (file)
+ int unzClose (file)
unzFile file;
{
unz_s* s;
Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed
return UNZ_OK if there is no problem. */
-extern int ZEXPORT unzGetGlobalInfo (file,pglobal_info)
+ int unzGetGlobalInfo (file,pglobal_info)
unzFile file;
unz_global_info *pglobal_info;
{
/*
Translate date/time from Dos format to tm_unz (readable more easilty)
*/
-local void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
+ void unzlocal_DosDateToTmuDate (ulDosDate, ptm)
uLong ulDosDate;
tm_unz* ptm;
{
/*
Get Info about the current file in the zipfile, with internal only info
*/
-local int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
+ int unzlocal_GetCurrentFileInfoInternal OF((unzFile file,
unz_file_info *pfile_info,
unz_file_info_internal
*pfile_info_internal,
char *szComment,
uLong commentBufferSize));
-local int unzlocal_GetCurrentFileInfoInternal (file,
+ int unzlocal_GetCurrentFileInfoInternal (file,
pfile_info,
pfile_info_internal,
szFileName, fileNameBufferSize,
No preparation of the structure is needed
return UNZ_OK if there is no problem.
*/
-extern int ZEXPORT unzGetCurrentFileInfo (file,
+ int unzGetCurrentFileInfo (file,
pfile_info,
szFileName, fileNameBufferSize,
extraField, extraFieldBufferSize,
Set the current file of the zipfile to the first file.
return UNZ_OK if there is no problem
*/
-extern int ZEXPORT unzGoToFirstFile (file)
+ int unzGoToFirstFile (file)
unzFile file;
{
int err=UNZ_OK;
return UNZ_OK if there is no problem
return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
*/
-extern int ZEXPORT unzGoToNextFile (file)
+ int unzGoToNextFile (file)
unzFile file;
{
unz_s* s;
void cacao_create_directoryList(unzFile file)
{
+ cacao_entry_s* ent;
unz_s* s=(unz_s*)file;
char *c;
int i;
return;
}
i=0;
- cacao_entry_s* ent=s->cacao_dir_list=(cacao_entry_s*)ALLOC(sizeof(cacao_entry_s));
+ ent = s->cacao_dir_list = (cacao_entry_s *) ALLOC(sizeof(cacao_entry_s));
ent->next=0;
ent->pos=s->pos_in_central_dir;
UNZ_OK if the file is found. It becomes the current file.
UNZ_END_OF_LIST_OF_FILE if the file is not found
*/
-extern int ZEXPORT unzLocateFile (file, szFileName, iCaseSensitivity)
+ int unzLocateFile (file, szFileName, iCaseSensitivity)
unzFile file;
const char *szFileName;
int iCaseSensitivity;
NULL,0,NULL,0,NULL,0);
}
}
+ return UNZ_END_OF_LIST_OF_FILE;
+ /*return 0;*/
}
/*
store in *piSizeVar the size of extra info in local header
(filename and size of extra field data)
*/
-local int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
+ int unzlocal_CheckCurrentFileCoherencyHeader (s,piSizeVar,
poffset_local_extrafield,
psize_local_extrafield)
unz_s* s;
Open for reading data the current file in the zipfile.
If there is no error and the file is opened, the return value is UNZ_OK.
*/
-extern int ZEXPORT unzOpenCurrentFile (file)
+ int unzOpenCurrentFile (file)
unzFile file;
{
int err=UNZ_OK;
return <0 with error code if there is an error
(UNZ_ERRNO for IO error, or zLib error for uncompress error)
*/
-extern int ZEXPORT unzReadCurrentFile (file, buf, len)
+ int unzReadCurrentFile (file, buf, len)
unzFile file;
voidp buf;
unsigned len;
/*
Give the current position in uncompressed data
*/
-extern z_off_t ZEXPORT unztell (file)
+ z_off_t unztell (file)
unzFile file;
{
unz_s* s;
/*
return 1 if the end of file was reached, 0 elsewhere
*/
-extern int ZEXPORT unzeof (file)
+ int unzeof (file)
unzFile file;
{
unz_s* s;
the return value is the number of bytes copied in buf, or (if <0)
the error code
*/
-extern int ZEXPORT unzGetLocalExtrafield (file,buf,len)
+ int unzGetLocalExtrafield (file,buf,len)
unzFile file;
voidp buf;
unsigned len;
Close the file in zip opened with unzipOpenCurrentFile
Return UNZ_CRCERROR if all the file was read but the CRC is not good
*/
-extern int ZEXPORT unzCloseCurrentFile (file)
+ int unzCloseCurrentFile (file)
unzFile file;
{
int err=UNZ_OK;
uSizeBuf is the size of the szComment buffer.
return the number of byte copied or an error code <0
*/
-extern int ZEXPORT unzGetGlobalComment (file, szComment, uSizeBuf)
+ int unzGetGlobalComment (file, szComment, uSizeBuf)
unzFile file;
char *szComment;
uLong uSizeBuf;