1
/*********************************************************************NVMH1****
5
Copyright (C) 1999, 2000 NVIDIA Corporation
6
This file is provided without support, instruction, or implied warranty of any
7
kind. NVIDIA makes no guarantee of its fitness for a particular purpose and is
8
not liable under any circumstances for any damages or loss whatsoever arising
9
from the use or inability to use this file or items derived from it.
14
******************************************************************************/
18
#endif // __nv_util_h__
26
unsigned char * open(const char * filename, const char * inzipfile, unsigned int * size)
28
char filename_inzip[256];
34
uf = unzOpen(filename);
36
if (unzLocateFile(uf,inzipfile,0)!=UNZ_OK) //CASESENSITIVITY
38
printf("file %s not found in the zipfile\n",filename);
42
unz_file_info file_info;
44
err = unzGetCurrentFileInfo(uf,&file_info,filename_inzip,sizeof(filename_inzip),NULL,0,NULL,0);
48
printf("error %d with zipfile in unzGetCurrentFileInfo\n",err);
53
err = unzOpenCurrentFile(uf);
56
printf("error %d with zipfile in unzOpenCurrentFile\n",err);
60
*size = file_info.uncompressed_size;
61
buf = new unsigned char[file_info.uncompressed_size];
63
unsigned int count = 0;
67
err = unzReadCurrentFile(uf,&buf[count],65535);
70
printf("error %d with zipfile in unzReadCurrentFile\n",err);
76
assert(count == file_info.uncompressed_size);
79
err = unzCloseCurrentFile (uf);
82
printf("error %d with zipfile in unzCloseCurrentFile\n",err);
90
unzCloseCurrentFile(uf); /* don't lose the error */
b'\\ No newline at end of file'