您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ unzlocal_getLong函数代码示例

51自学网 2021-06-03 09:12:42
  C++
这篇教程C++ unzlocal_getLong函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中unzlocal_getLong函数的典型用法代码示例。如果您正苦于以下问题:C++ unzlocal_getLong函数的具体用法?C++ unzlocal_getLong怎么用?C++ unzlocal_getLong使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了unzlocal_getLong函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: unzlocal_CheckCurrentFileCoherencyHeader

/*  Read the local header of the current zipfile  Check the coherency of the local header and info in the end of central        directory about this file  store in *piSizeVar the size of extra info in local header        (filename and size of extra field data)*/static int unzlocal_CheckCurrentFileCoherencyHeader(unz_s* s, uInt* piSizeVar,													uLong *poffset_local_extrafield,													uInt  *psize_local_extrafield) {	uLong uMagic,uData,uFlags;	uLong size_filename;	uLong size_extra_field;	int err=UNZ_OK;	*piSizeVar = 0;	*poffset_local_extrafield = 0;	*psize_local_extrafield = 0;	s->_stream->seek(s->cur_file_info_internal.offset_curfile +								s->byte_before_the_zipfile, SEEK_SET);	if (s->_stream->err())		return UNZ_ERRNO;	if (err==UNZ_OK) {		if (unzlocal_getLong(s->_stream,&uMagic) != UNZ_OK)			err=UNZ_ERRNO;		else if (uMagic!=0x04034b50)			err=UNZ_BADZIPFILE;	}	if (unzlocal_getShort(s->_stream,&uData) != UNZ_OK)		err=UNZ_ERRNO;/*	else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion))		err=UNZ_BADZIPFILE;*/	if (unzlocal_getShort(s->_stream,&uFlags) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&uData) != UNZ_OK)		err=UNZ_ERRNO;	else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method))		err=UNZ_BADZIPFILE;	if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) &&	                     (s->cur_file_info.compression_method!=Z_DEFLATED))		err=UNZ_BADZIPFILE;	if (unzlocal_getLong(s->_stream,&uData) != UNZ_OK) /* date/time */		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&uData) != UNZ_OK) /* crc */		err=UNZ_ERRNO;	else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) &&		                      ((uFlags & 8)==0))		err=UNZ_BADZIPFILE;	if (unzlocal_getLong(s->_stream,&uData) != UNZ_OK) /* size compr */		err=UNZ_ERRNO;	else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) &&							  ((uFlags & 8)==0))		err=UNZ_BADZIPFILE;	if (unzlocal_getLong(s->_stream,&uData) != UNZ_OK) /* size uncompr */		err=UNZ_ERRNO;	else if ((err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) &&							  ((uFlags & 8)==0))		err=UNZ_BADZIPFILE;	if (unzlocal_getShort(s->_stream,&size_filename) != UNZ_OK)		err=UNZ_ERRNO;	else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename))		err=UNZ_BADZIPFILE;	*piSizeVar += (uInt)size_filename;	if (unzlocal_getShort(s->_stream,&size_extra_field) != UNZ_OK)		err=UNZ_ERRNO;	*poffset_local_extrafield= s->cur_file_info_internal.offset_curfile +									SIZEZIPLOCALHEADER + size_filename;	*psize_local_extrafield = (uInt)size_extra_field;	*piSizeVar += (uInt)size_extra_field;	return err;}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:89,


示例2: pathname

/*  Open a Zip file. path contain the full pathname (by example,     on a Windows NT computer "c://test//zlib109.zip" or on an Unix computer	 "zlib/zlib109.zip".	 If the zipfile cannot be opened (file don't exist or in not valid), the	   return value is NULL.     Else, the return value is a unzFile Handle, usable with other function	   of this unzip package.*/unzFile unzOpen(Common::SeekableReadStream *stream) {	if (!stream)		return NULL;	unz_s *us = new unz_s;	uLong central_pos,uL;	uLong number_disk;          /* number of the current dist, used for								   spaning ZIP, unsupported, always 0*/	uLong number_disk_with_CD;  /* number the the disk with central dir, used								   for spaning ZIP, unsupported, always 0*/	uLong number_entry_CD;      /* total number of entries in	                               the central dir	                               (same than number_entry on nospan) */	int err=UNZ_OK;	us->_stream = stream;	central_pos = unzlocal_SearchCentralDir(*us->_stream);	if (central_pos==0)		err=UNZ_ERRNO;	us->_stream->seek(central_pos, SEEK_SET);	if (us->_stream->err())		err=UNZ_ERRNO;	/* the signature, already checked */	if (unzlocal_getLong(us->_stream,&uL)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of this disk */	if (unzlocal_getShort(us->_stream,&number_disk)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of the disk with the start of the central directory */	if (unzlocal_getShort(us->_stream,&number_disk_with_CD)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir on this disk */	if (unzlocal_getShort(us->_stream,&us->gi.number_entry)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir */	if (unzlocal_getShort(us->_stream,&number_entry_CD)!=UNZ_OK)		err=UNZ_ERRNO;	if ((number_entry_CD!=us->gi.number_entry) ||	    (number_disk_with_CD!=0) ||	    (number_disk!=0))		err=UNZ_BADZIPFILE;	/* size of the central directory */	if (unzlocal_getLong(us->_stream,&us->size_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* offset of start of central directory with respect to the	      starting disk number */	if (unzlocal_getLong(us->_stream,&us->offset_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* zipfile comment length */	if (unzlocal_getShort(us->_stream,&us->gi.size_comment)!=UNZ_OK)		err=UNZ_ERRNO;	if ((central_pos<us->offset_central_dir+us->size_central_dir) && (err==UNZ_OK))		err=UNZ_BADZIPFILE;	if (err != UNZ_OK) {		delete us->_stream;		delete us;		return NULL;	}	us->byte_before_the_zipfile = central_pos -		                    (us->offset_central_dir+us->size_central_dir);	us->central_pos = central_pos;	us->pfile_in_zip_read = NULL;	err = unzGoToFirstFile((unzFile)us);	while (err == UNZ_OK) {		// Get the file details		char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];		unzGetCurrentFileInfo(us, NULL, szCurrentFileName, sizeof(szCurrentFileName) - 1,							NULL, 0, NULL, 0);		// Save details into the hash		cached_file_in_zip fe;		fe.num_file = us->num_file;		fe.pos_in_central_dir = us->pos_in_central_dir;//.........这里部分代码省略.........
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:101,


示例3: unzlocal_GetCurrentFileInfoInternal

static int unzlocal_GetCurrentFileInfoInternal(unzFile file,                                              unz_file_info *pfile_info,                                              unz_file_info_internal *pfile_info_internal,                                              char *szFileName, uLong fileNameBufferSize,                                              void *extraField, uLong extraFieldBufferSize,                                              char *szComment,  uLong commentBufferSize){	unz_s* s;	unz_file_info file_info;	unz_file_info_internal file_info_internal;	int err=UNZ_OK;	uLong uMagic;	long lSeek=0;	if (file==NULL)		return UNZ_PARAMERROR;	s=(unz_s*)file;	s->_stream->seek(s->pos_in_central_dir+s->byte_before_the_zipfile, SEEK_SET);	if (s->_stream->err())		err=UNZ_ERRNO;	/* we check the magic */	if (err==UNZ_OK) {		if (unzlocal_getLong(s->_stream,&uMagic) != UNZ_OK)			err=UNZ_ERRNO;		else if (uMagic!=0x02014b50)			err=UNZ_BADZIPFILE;	}	if (unzlocal_getShort(s->_stream,&file_info.version) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.version_needed) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.flag) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.compression_method) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&file_info.dosDate) != UNZ_OK)		err=UNZ_ERRNO;	unzlocal_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date);	if (unzlocal_getLong(s->_stream,&file_info.crc) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&file_info.compressed_size) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&file_info.uncompressed_size) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.size_filename) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.size_file_extra) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.size_file_comment) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.disk_num_start) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getShort(s->_stream,&file_info.internal_fa) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&file_info.external_fa) != UNZ_OK)		err=UNZ_ERRNO;	if (unzlocal_getLong(s->_stream,&file_info_internal.offset_curfile) != UNZ_OK)		err=UNZ_ERRNO;	lSeek+=file_info.size_filename;	if ((err==UNZ_OK) && (szFileName!=NULL)) {		uLong uSizeRead ;		if (file_info.size_filename<fileNameBufferSize) {			*(szFileName+file_info.size_filename)='/0';			uSizeRead = file_info.size_filename;		} else			uSizeRead = fileNameBufferSize;		if ((file_info.size_filename>0) && (fileNameBufferSize>0))			if (s->_stream->read(szFileName,(uInt)uSizeRead)!=uSizeRead)				err=UNZ_ERRNO;		lSeek -= uSizeRead;	}	if ((err==UNZ_OK) && (extraField!=NULL)) {		uLong uSizeRead ;		if (file_info.size_file_extra<extraFieldBufferSize)			uSizeRead = file_info.size_file_extra;		else			uSizeRead = extraFieldBufferSize;//.........这里部分代码省略.........
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:101,


示例4: pathname

/*  Open a Zip file. path contain the full pathname (by example,     on a Windows NT computer "c://test//zlib109.zip" or on an Unix computer	 "zlib/zlib109.zip".	 If the zipfile cannot be opened (file don't exist or in not valid), the	   return value is NULL.     Else, the return value is a unzFile Handle, usable with other function	   of this unzip package.*/extern unzFile ZEXPORT unzOpen(const char *path){	unz_s us;	unz_s *s;	uLong central_pos,uL;	FILE * fin ;	uLong number_disk;          /* number of the current dist, used for 								   spaning ZIP, unsupported, always 0*/	uLong number_disk_with_CD;  /* number the the disk with central dir, used								   for spaning ZIP, unsupported, always 0*/	uLong number_entry_CD;      /* total number of entries in	                               the central dir 	                               (same than number_entry on nospan) */	int err=UNZ_OK;        if (unz_copyright[0]!=' ')                return NULL;        fin=FCEUI_UTF8fopen_C(path,"rb");        //fin=fopen(path,"rb");	if (fin==NULL)		return NULL;	central_pos = unzlocal_SearchCentralDir(fin);	if (central_pos==0)		err=UNZ_ERRNO;	if (fseek(fin,central_pos,SEEK_SET)!=0)		err=UNZ_ERRNO;	/* the signature, already checked */	if (unzlocal_getLong(fin,&uL)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of this disk */	if (unzlocal_getShort(fin,&number_disk)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of the disk with the start of the central directory */	if (unzlocal_getShort(fin,&number_disk_with_CD)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir on this disk */	if (unzlocal_getShort(fin,&us.gi.number_entry)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir */	if (unzlocal_getShort(fin,&number_entry_CD)!=UNZ_OK)		err=UNZ_ERRNO;	if ((number_entry_CD!=us.gi.number_entry) ||		(number_disk_with_CD!=0) ||		(number_disk!=0))		err=UNZ_BADZIPFILE;	/* size of the central directory */	if (unzlocal_getLong(fin,&us.size_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* offset of start of central directory with respect to the 	      starting disk number */	if (unzlocal_getLong(fin,&us.offset_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* zipfile comment length */	if (unzlocal_getShort(fin,&us.gi.size_comment)!=UNZ_OK)		err=UNZ_ERRNO;	if ((central_pos<us.offset_central_dir+us.size_central_dir) && 		(err==UNZ_OK))		err=UNZ_BADZIPFILE;	if (err!=UNZ_OK)	{		fclose(fin);		return NULL;	}	us.file=fin;	us.byte_before_the_zipfile = central_pos -		                    (us.offset_central_dir+us.size_central_dir);	us.central_pos = central_pos;    us.pfile_in_zip_read = NULL;		s=(unz_s*)ALLOC(sizeof(unz_s));	*s=us;	unzGoToFirstFile((unzFile)s);		return (unzFile)s;	//.........这里部分代码省略.........
开发者ID:idispatch,项目名称:FCEUXpb,代码行数:101,


示例5: pathname

/*  Open a Zip file. path contain the full pathname (by example,     on a Windows NT computer "c://test//zlib114.zip" or on a Unix computer     "zlib/zlib114.zip".     If the zipfile cannot be opened (file doesn't exist or in not valid), the       return value is NULL.     Else, the return value is an unzFile Handle, usable with other function       of this unzip package.*/unzFile ZEXPORT unzOpen2 (    const char *path,    zlib_filefunc_def* pzlib_filefunc_def){    unz_s us;    unz_s *s;    uLong central_pos,uL;    uLong number_disk;          /* number of the current dist, used for                                   spaning ZIP, unsupported, always 0*/    uLong number_disk_with_CD;  /* number the the disk with central dir, used                                   for spaning ZIP, unsupported, always 0*/    uLong number_entry_CD;      /* total number of entries in                                   the central dir                                   (same than number_entry on nospan) */    int err=UNZ_OK;    if (unz_copyright[0]!=' ')        return NULL;    if (pzlib_filefunc_def==NULL)        fill_fopen_filefunc(&us.z_filefunc);    else        us.z_filefunc = *pzlib_filefunc_def;    us.filestream= (*(us.z_filefunc.zopen_file))(us.z_filefunc.opaque,                                                 path,                                                 ZLIB_FILEFUNC_MODE_READ |                                                 ZLIB_FILEFUNC_MODE_EXISTING);    if (us.filestream==NULL)        return NULL;    central_pos = unzlocal_SearchCentralDir(&us.z_filefunc,us.filestream);    if (central_pos==0)        err=UNZ_ERRNO;    if (ZSEEK(us.z_filefunc, us.filestream,                                      central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)        err=UNZ_ERRNO;    /* the signature, already checked */    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK)        err=UNZ_ERRNO;    /* number of this disk */    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)        err=UNZ_ERRNO;    /* number of the disk with the start of the central directory */    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)        err=UNZ_ERRNO;    /* total number of entries in the central dir on this disk */    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK)        err=UNZ_ERRNO;    /* total number of entries in the central dir */    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)        err=UNZ_ERRNO;    if ((number_entry_CD!=us.gi.number_entry) ||        (number_disk_with_CD!=0) ||        (number_disk!=0))        err=UNZ_BADZIPFILE;    /* size of the central directory */    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK)        err=UNZ_ERRNO;    /* offset of start of central directory with respect to the          starting disk number */    if (unzlocal_getLong(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK)        err=UNZ_ERRNO;    /* zipfile comment length */    if (unzlocal_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK)        err=UNZ_ERRNO;    if ((central_pos<us.offset_central_dir+us.size_central_dir) &&        (err==UNZ_OK))        err=UNZ_BADZIPFILE;    if (err!=UNZ_OK)    {        ZCLOSE(us.z_filefunc, us.filestream);        return NULL;    }    us.byte_before_the_zipfile = central_pos -                            (us.offset_central_dir+us.size_central_dir);//.........这里部分代码省略.........
开发者ID:Aura15,项目名称:OpenJK,代码行数:101,


示例6: pathname

/*  Open a Zip file. path contain the full pathname (by example,     on a Windows NT computer "c://test//zlib109.zip" or on an Unix computer	 "zlib/zlib109.zip".	 If the zipfile cannot be opened (file don't exist or in not valid), the	   return value is NULL.     Else, the return value is a unzFile Handle, usable with other function	   of this unzip package.*/unzFile unzOpen(Common::SeekableReadStream *stream) {	if (!stream)		return NULL;	unz_s *us = new unz_s;	uLong central_pos,uL;	uLong number_disk;          /* number of the current dist, used for								   spaning ZIP, unsupported, always 0*/	uLong number_disk_with_CD;  /* number the the disk with central dir, used								   for spaning ZIP, unsupported, always 0*/	uLong number_entry_CD;      /* total number of entries in	                               the central dir	                               (same than number_entry on nospan) */	int err=UNZ_OK;	us->_stream = stream;	central_pos = unzlocal_SearchCentralDir(*us->_stream);	if (central_pos==0)		err=UNZ_ERRNO;	us->_stream->seek(central_pos, SEEK_SET);	if (us->_stream->err())		err=UNZ_ERRNO;	/* the signature, already checked */	if (unzlocal_getLong(us->_stream,&uL)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of this disk */	if (unzlocal_getShort(us->_stream,&number_disk)!=UNZ_OK)		err=UNZ_ERRNO;	/* number of the disk with the start of the central directory */	if (unzlocal_getShort(us->_stream,&number_disk_with_CD)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir on this disk */	if (unzlocal_getShort(us->_stream,&us->gi.number_entry)!=UNZ_OK)		err=UNZ_ERRNO;	/* total number of entries in the central dir */	if (unzlocal_getShort(us->_stream,&number_entry_CD)!=UNZ_OK)		err=UNZ_ERRNO;	if ((number_entry_CD!=us->gi.number_entry) ||	    (number_disk_with_CD!=0) ||	    (number_disk!=0))		err=UNZ_BADZIPFILE;	/* size of the central directory */	if (unzlocal_getLong(us->_stream,&us->size_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* offset of start of central directory with respect to the	      starting disk number */	if (unzlocal_getLong(us->_stream,&us->offset_central_dir)!=UNZ_OK)		err=UNZ_ERRNO;	/* zipfile comment length */	if (unzlocal_getShort(us->_stream,&us->gi.size_comment)!=UNZ_OK)		err=UNZ_ERRNO;	if ((central_pos<us->offset_central_dir+us->size_central_dir) && (err==UNZ_OK))		err=UNZ_BADZIPFILE;	if (err!=UNZ_OK) {		delete us->_stream;		delete us;		return NULL;	}	us->byte_before_the_zipfile = central_pos -		                    (us->offset_central_dir+us->size_central_dir);	us->central_pos = central_pos;	us->pfile_in_zip_read = NULL;	unzGoToFirstFile((unzFile)us);	return (unzFile)us;}
开发者ID:havlenapetr,项目名称:Scummvm,代码行数:91,


示例7: unzlocal_CheckCurrentFileCoherencyHeader

static int unzlocal_CheckCurrentFileCoherencyHeader(unz_s *s, DWORD *piSizeVar, DWORD *poffset_local_extrafield, DWORD *psize_local_extrafield){  DWORD uMagic, uData, uFlags;  DWORD size_filename;  DWORD size_extra_field;  int err = UNZ_OK;  *piSizeVar = 0;  *poffset_local_extrafield = 0;  *psize_local_extrafield = 0;  if (ZSEEK(s->z_filefunc, s->filestream, s->cur_file_info_internal.offset_curfile + s->byte_before_the_zipfile, SEEK_SET) != 0)  {    return UNZ_ERRNO;  }  if (err == UNZ_OK)  {    if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uMagic) != UNZ_OK)    {      err = UNZ_ERRNO;    }    else if (uMagic != 0x04034b50)    {      err = UNZ_BADZIPFILE;    }  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &uFlags) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  {    err = UNZ_ERRNO;  }  else if ((err == UNZ_OK) && (uData != s->cur_file_info.compression_method))  {    err = UNZ_BADZIPFILE;  }  if ((err == UNZ_OK) && (s->cur_file_info.compression_method != 0) && (s->cur_file_info.compression_method != Z_DEFLATED))  {    err = UNZ_BADZIPFILE;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  // date/time   {    err = UNZ_ERRNO;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  // crc   {    err = UNZ_ERRNO;  }  else if ((err == UNZ_OK) && (uData != s->cur_file_info.crc) && ((uFlags &8) == 0))  {    err = UNZ_BADZIPFILE;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  // size compr   {    err = UNZ_ERRNO;  }  else if ((err == UNZ_OK) && (uData != s->cur_file_info.compressed_size) && ((uFlags &8) == 0))  {    err = UNZ_BADZIPFILE;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uData) != UNZ_OK)  // size uncompr   {    err = UNZ_ERRNO;  }  else if ((err == UNZ_OK) && (uData != s->cur_file_info.uncompressed_size) && ((uFlags &8) == 0))  {    err = UNZ_BADZIPFILE;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &size_filename) != UNZ_OK)  {    err = UNZ_ERRNO;  }  else if ((err == UNZ_OK) && (size_filename != s->cur_file_info.size_filename))  {    err = UNZ_BADZIPFILE;  }  *piSizeVar += (DWORD)size_filename;//.........这里部分代码省略.........
开发者ID:Doodle-Jump,项目名称:PC,代码行数:101,


示例8: unzlocal_GetCurrentFileInfoInternal

static int unzlocal_GetCurrentFileInfoInternal(unzFile file, unz_file_info *pfile_info, unz_file_info_internal *pfile_info_internal, char *szFileName, DWORD fileNameBufferSize, void *extraField, DWORD extraFieldBufferSize, char *szComment, DWORD commentBufferSize){  unz_s *s;  unz_file_info file_info;  unz_file_info_internal file_info_internal;  int err = UNZ_OK;  DWORD uMagic;  long lSeek = 0;  if (file == NULL)  {    return UNZ_PARAMERROR;  }  s = (unz_s*)file;  if (ZSEEK(s->z_filefunc, s->filestream, s->pos_in_central_dir + s->byte_before_the_zipfile, SEEK_SET) != 0)  {    err = UNZ_ERRNO;  }  /* we check the magic */  if (err == UNZ_OK)  {    if (unzlocal_getLong(&s->z_filefunc, s->filestream, &uMagic) != UNZ_OK)    {      err = UNZ_ERRNO;    }    else if (uMagic != 0x02014b50)    {      err = UNZ_BADZIPFILE;    }  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.version) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.version_needed) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.flag) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.compression_method) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &file_info.dosDate) != UNZ_OK)  {    err = UNZ_ERRNO;  }  unzlocal_DosDateToTmuDate(file_info.dosDate, &file_info.tmu_date);  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &file_info.crc) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &file_info.compressed_size) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getLong(&s->z_filefunc, s->filestream, &file_info.uncompressed_size) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.size_filename) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.size_file_extra) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.size_file_comment) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.disk_num_start) != UNZ_OK)  {    err = UNZ_ERRNO;  }  if (unzlocal_getShort(&s->z_filefunc, s->filestream, &file_info.internal_fa) != UNZ_OK)  {    err = UNZ_ERRNO;//.........这里部分代码省略.........
开发者ID:Doodle-Jump,项目名称:PC,代码行数:101,



注:本文中的unzlocal_getLong函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ unzlocal_getShort函数代码示例
C++ unzlocal_GetCurrentFileInfoInternal函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。