#include
#include
#include "unzip.h"
#define dir_delimter '/'
#define MAX_FILENAME 512
#define READ_SIZE 8192
int main( int argc, char **argv )
{
if ( argc < )
{
printf( "usage:\n%s {file to unzip}\n", argv[ ] );
return -;
}
// Open the zip file
unzFile *zipfile = unzOpen( argv[ ] );
if ( zipfile == NULL )
{
printf( "%s: not found\n" );
return -;
}
// Get info about the zip file
unz_global_info global_info;
if ( unzGetGlobalInfo( zipfile, &global_info ) != UNZ_OK )
{
printf( "could not read file global info\n" );
unzClose( zipfile );
return -;
}
// Buffer to hold data read from the zip file.
char rea