亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mpq.h

?? A*算法 A*算法 A*算法 A*算法A*算法A*算法
?? H
字號:
/*
 *  mpq.h -- some default types and defines.
 *
 *  Copyright (C) 2003 Maik Broemme <mbroemme@plusserver.de>
 *
 *  This source was adepted from the C++ version of StormLib.h and
 *  StormPort.h included in stormlib. The C++ version belongs to
 *  the following authors,
 *
 *  Ladislav Zezula <ladik.zezula.net>
 *  Marko Friedemann <marko.friedemann@bmx-chemnitz.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *  $Id: mpq.h,v 1.1 2005/04/09 22:09:18 ufoz Exp $
 */

#ifndef _MPQ_H
#define _MPQ_H
#ifdef _WIN32
#include <io.h>

#define snprintf _snprintf
//inline int open(const char* x, int y)
//{
//	return _open(x, y);
//}
//#define lseek _lseek
#define PATH_MAX 259
#else
#include <dirent.h>
//lseek ...
#include <unistd.h>
//PATH_MAX
//#include <linux/limits.h>
// size_t
#include <stdlib.h>
#define O_BINARY 0
#endif

#ifdef __cplusplus
extern "C" {
#endif

#define LIBMPQ_MAJOR_VERSION		0		/* Major version number... maybe sometimes we reach version 1 :) */
#define LIBMPQ_MINOR_VERSION		3		/* Minor version number - increased only for small changes */
#define LIBMPQ_PATCH_VERSION		0		/* Patchlevel - changed on bugfixes etc... */

#define LIBMPQ_TOOLS_SUCCESS		0		/* return value for all functions which success */
#define LIBMPQ_TOOLS_BUFSIZE		0x500		/* buffer size for the decryption engine */

#define LIBMPQ_EFILE			-1		/* error on file operation */
#define LIBMPQ_EFILE_FORMAT		-2		/* bad file format */
#define LIBMPQ_EFILE_CORRUPT		-3		/* file corrupt */
#define LIBMPQ_EFILE_NOT_FOUND		-4		/* file in archive not found */
#define LIBMPQ_EFILE_READ		-5		/* Read error in archive */
#define LIBMPQ_EALLOCMEM		-6		/* maybe not enough memory? :) */
#define LIBMPQ_EFREEMEM			-7		/* can not free memory */
#define LIBMPQ_EINV_RANGE		-8		/* Given filenumber is out of range */
#define LIBMPQ_EHASHTABLE		-9		/* error in reading hashtable */
#define LIBMPQ_EBLOCKTABLE		-10		/* error in reading blocktable */

#define LIBMPQ_ID_MPQ			0x1A51504D	/* MPQ archive header ID ('MPQ\x1A') */
#define LIBMPQ_HEADER_W3M		0x6D9E4B86	/* special value used by W3M Map Protector */
#define LIBMPQ_FLAG_PROTECTED		0x00000002	/* Set on protected MPQs (like W3M maps) */
#define LIBMPQ_HASH_ENTRY_DELETED	0xFFFFFFFE	/* Block index for deleted hash entry */
#define LIBMPQ_LISTFILE_HASH1		0xfd657910 /* Hashes of files that are in any mpq */
#define LIBMPQ_LISTFILE_HASH2		0x4e9b98a7
#define LIBMPQ_ATTRFILE_HASH1		0xd38437cb
#define LIBMPQ_ATTRFILE_HASH2		0x07dfeaec

#define LIBMPQ_FILE_COMPRESS_PKWARE	0x00000100	/* Compression made by PKWARE Data Compression Library */
#define LIBMPQ_FILE_COMPRESS_MULTI	0x00000200	/* Multiple compressions */
#define LIBMPQ_FILE_COMPRESSED		0x0000FF00	/* File is compressed */
#define LIBMPQ_FILE_EXISTS		0x80000000	/* Set if file exists, reset when the file was deleted */
#define LIBMPQ_FILE_ENCRYPTED		0x00010000	/* Indicates whether file is encrypted */

#define LIBMPQ_FILE_COMPRESSED_SIZE	1		/* MPQ compressed filesize of given file */
#define LIBMPQ_FILE_UNCOMPRESSED_SIZE	2		/* MPQ uncompressed filesize of given file */
#define LIBMPQ_FILE_COMPRESSION_TYPE	3		/* MPQ compression type of given file */
#define LIBMPQ_FILE_TYPE_INT		4		/* file is given by number */
#define LIBMPQ_FILE_TYPE_CHAR		5		/* file is given by name */
#define LIBMPQ_FILE_HASH1			6		/* hash value 1 */
#define LIBMPQ_FILE_HASH2			7		/* hash value 2 */

#define LIBMPQ_MPQ_ARCHIVE_SIZE		1		/* MPQ archive size */
#define LIBMPQ_MPQ_HASHTABLE_SIZE	2		/* MPQ archive hashtable size */
#define LIBMPQ_MPQ_BLOCKTABLE_SIZE	3		/* MPQ archive blocktable size */
#define LIBMPQ_MPQ_BLOCKSIZE		4		/* MPQ archive blocksize */
#define LIBMPQ_MPQ_NUMFILES		5		/* Number of files in the MPQ archive */
#define LIBMPQ_MPQ_COMPRESSED_SIZE	6		/* Compressed archive size */
#define LIBMPQ_MPQ_UNCOMPRESSED_SIZE	7		/* Uncompressed archive size */

#define LIBMPQ_HUFF_DECOMPRESS		0		/* Defines that we want to decompress using huffman trees. */

#define LIBMPQ_CONF_EFILE_OPEN		-1		/* error if a specific listfile was forced and could not be opened. */
#define LIBMPQ_CONF_EFILE_CORRUPT	-2		/* listfile seems to be corrupt */
#define LIBMPQ_CONF_EFILE_LIST_CORRUPT	-3		/* listfile seems correct, but filelist is broken */
#define LIBMPQ_CONF_EFILE_NOT_FOUND	-4		/* error if no matching listfile found */
#define LIBMPQ_CONF_EFILE_VERSION	-5		/* libmpq version does not match required listfile version */

#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif

#ifndef min
#define min(a, b) ((a < b) ? a : b)
#endif


typedef unsigned int	mpq_buffer[LIBMPQ_TOOLS_BUFSIZE];
typedef int		(*DECOMPRESS)(char *, int *, char *, int);
typedef struct {
	unsigned long	mask;		/* Decompression bit */
	DECOMPRESS	decompress;	/* Decompression function */
} decompress_table;

#pragma pack(push,1)
/* MPQ file header */
typedef struct {
	unsigned long	id;		/* The 0x1A51504D ('MPQ\x1A') signature */
	unsigned long	offset;		/* Offset of the first file (Relative to MPQ start) */
	unsigned long	archivesize;	/* Size of MPQ archive */
	unsigned short	offsetsc;	/* 0000 for SC and BW */
	unsigned short	blocksize;	/* Size of file block is (0x200 << blockSize) */
	unsigned long	hashtablepos;	/* File position of hashTable */
	unsigned long	blocktablepos;	/* File position of blockTable. Each entry has 16 bytes */
	unsigned long	hashtablesize;	/* Number of entries in hash table */
	unsigned long	blocktablesize;	/* Number of entries in the block table */
} mpq_header;// __attribute__ ((packed)) mpq_header;
#pragma pack(pop)

/* Hash entry. All files in the archive are searched by their hashes. */
typedef struct {
	unsigned int	name1;		/* The first two unsigned ints */
	unsigned int	name2;		/* are the encrypted file name */
	unsigned int	locale;		/* Locale information. */
	unsigned int	blockindex;	/* Index to file description block */
} mpq_hash;

/* File description block contains informations about the file */
typedef struct {
	unsigned int	filepos;	/* Block file starting position in the archive */
	unsigned int	csize;		/* Compressed file size */
	unsigned int	fsize;		/* Uncompressed file size */
	unsigned int	flags;		/* Flags */
} mpq_block;

/* File handle structure used since Diablo 1.00 (0x38 bytes) */
typedef struct {
	unsigned char	filename[PATH_MAX];	/* filename of the actual file in the archive */
	int		fd;		/* File handle */
	unsigned int	seed;		/* Seed used for file decrypt */
	unsigned int	filepos;	/* Current file position */
	unsigned int	offset;
	unsigned int	nblocks;	/* Number of blocks in the file (incl. the last noncomplete one) */
	unsigned int	*blockpos;	/* Position of each file block (only for compressed files) */
	int		blockposloaded;	/* TRUE if block positions loaded */
	unsigned int	offset2;	/* (Number of bytes somewhere ?) */
	mpq_hash	*mpq_h;		/* Hash table entry */
	mpq_block	*mpq_b;		/* File block pointer */

	/* Non-Storm.dll members */

	unsigned int	accessed;	/* Was something from the file already read? */
} mpq_file;

/* Archive handle structure used since Diablo 1.00 */
typedef struct {
	char	filename[PATH_MAX];	/* Opened archive file name */
	int		fd;		/* File handle */
	unsigned int	blockpos;	/* Position of loaded block in the file */
	unsigned int	blocksize;	/* Size of file block */
	unsigned char	*blockbuf;	/* Buffer (cache) for file block */
	unsigned int	bufpos;		/* Position in block buffer */
	unsigned int	mpqpos;		/* MPQ archive position in the file */
	unsigned int	filepos;	/* Current file pointer */
	unsigned int	openfiles;	/* Number of open files + 1 */
	mpq_buffer	buf;			/* MPQ buffer */
	mpq_header	*header;		/* MPQ file header */
	mpq_hash	*hashtable;		/* Hash table */
	mpq_block	*blocktable;	/* Block table */

	/* Non-Storm.dll members */

	unsigned int	flags;		/* See LIBMPQ_TOOLS_FLAG_XXXXX */
	unsigned int	maxblockindex;	/* The highest block table entry */
} mpq_archive;

char *libmpq_version();
int libmpq_archive_open(mpq_archive *mpq_a, unsigned char *mpq_filename);
int libmpq_archive_close(mpq_archive *mpq_a);
int libmpq_archive_info(mpq_archive *mpq_a, unsigned int infotype);
//int libmpq_file_extract(mpq_archive *mpq_a, const int number);\
/// *dest must have enough space
int libmpq_file_getdata(mpq_archive *mpq_a, const int number, unsigned char *dest);
int libmpq_file_info(mpq_archive *mpq_a, unsigned int infotype, const int number);
int libmpq_file_number(mpq_archive *mpq_a, const char *name);
int libmpq_file_number_from_hash(mpq_archive *mpq_a, unsigned int hash1, unsigned int hash2);
int libmpq_file_check(mpq_archive *mpq_a, void *file, int type);
int libmpq_hash_filename(mpq_archive *mpq_a, const unsigned char *pbKey, unsigned int *seed1, unsigned int*seed2);

int libmpq_pkzip_decompress(char *out_buf, int *out_length, char *in_buf, int in_length);
int libmpq_zlib_decompress(char *out_buf, int *out_length, char *in_buf, int in_length);
int libmpq_huff_decompress(char *out_buf, int *out_length, char *in_buf, int in_length);
int libmpq_wave_decompress_stereo(char *out_buf, int *out_length, char *in_buf, int in_length);
int libmpq_wave_decompress_mono(char *out_buf, int *out_length, char *in_buf, int in_length);
int libmpq_multi_decompress(char *out_buf, int *pout_length, char *in_buf, int in_length);

static decompress_table dcmp_table[] = {
	{0x08, libmpq_pkzip_decompress},		/* Decompression with Pkware Data Compression Library */
	{0x02, libmpq_zlib_decompress},			/* Decompression with the "zlib" library */
	{0x01, libmpq_huff_decompress},			/* Huffmann decompression */
	{0x80, libmpq_wave_decompress_stereo},		/* WAVE decompression for stereo waves */
	{0x40, libmpq_wave_decompress_mono}		/* WAVE decompression for mono waves */
};

#ifdef __cplusplus
};  // extern "C"
#endif



#endif					/* _MPQ_H */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av性久久久久蜜臀aⅴ流畅| eeuss鲁片一区二区三区 | 性做久久久久久| 久久99精品网久久| 在线观看欧美精品| 国产精品嫩草久久久久| 久久精品国产色蜜蜜麻豆| 欧美午夜精品一区二区三区 | 国产精品系列在线观看| 欧美三级蜜桃2在线观看| 中文字幕五月欧美| 欧美日韩国产高清一区二区三区 | 亚洲综合色区另类av| 国产成人午夜精品5599| 日韩免费在线观看| 午夜精品爽啪视频| 欧美午夜电影一区| 亚洲黄色小视频| 91麻豆swag| 成人欧美一区二区三区黑人麻豆| 国产一区二区看久久| 欧美一激情一区二区三区| 亚洲成人一区二区| 欧美午夜精品久久久| 一区二区三区蜜桃| 91传媒视频在线播放| 亚洲女人的天堂| 97国产精品videossex| 日韩一区中文字幕| 色先锋资源久久综合| 亚洲色图都市小说| 欧洲av在线精品| 亚洲动漫第一页| 欧美日韩高清一区二区三区| 亚洲一级二级在线| 欧美日本韩国一区二区三区视频| 亚洲一区二区成人在线观看| 91传媒视频在线播放| 偷拍一区二区三区四区| 欧美日韩www| 免费高清在线视频一区·| 欧美不卡在线视频| 国产一区不卡视频| 中文字幕视频一区二区三区久| 99精品一区二区| 亚洲一区二区三区四区五区黄| 欧美日韩国产一区二区三区地区| 视频一区二区欧美| 欧美精品一区二区三区四区| 国产另类ts人妖一区二区| 欧美韩国日本不卡| 一本色道综合亚洲| 美女一区二区三区| 国产精品乱码人人做人人爱| 色视频一区二区| 天天操天天干天天综合网| 精品国产亚洲在线| www.欧美亚洲| 亚洲高清在线精品| 久久婷婷一区二区三区| 91网址在线看| 久久99精品国产.久久久久久| 久久精品免视看| 欧美视频在线一区二区三区 | 亚洲va欧美va天堂v国产综合| 在线成人高清不卡| 丰满亚洲少妇av| 亚洲va韩国va欧美va精品| 26uuu另类欧美亚洲曰本| 色综合久久久久综合体桃花网| 日本视频免费一区| 亚洲日本欧美天堂| 一区二区三区自拍| 精品福利二区三区| 日本久久精品电影| 国产成人精品一区二区三区四区 | 9191久久久久久久久久久| 国产激情视频一区二区三区欧美| 一区二区三区精品视频| 久久人人爽爽爽人久久久| 欧美日韩精品一区二区三区 | 欧美二区在线观看| eeuss鲁片一区二区三区在线观看| 性做久久久久久久免费看| 国产精品久久免费看| 欧美大尺度电影在线| 91福利在线播放| 成人免费观看男女羞羞视频| 男人的天堂久久精品| 亚洲综合一区二区精品导航| 久久久美女毛片| 日韩精品资源二区在线| 欧美日韩精品欧美日韩精品一综合| 粉嫩一区二区三区在线看| 久久成人麻豆午夜电影| 亚洲超碰97人人做人人爱| 亚洲黄色录像片| 亚洲欧洲av色图| 中文字幕亚洲一区二区av在线| 精品国产一区二区三区忘忧草| 3751色影院一区二区三区| 91成人网在线| 一本到不卡免费一区二区| av中文字幕不卡| 成人美女视频在线看| 岛国一区二区在线观看| 国产suv精品一区二区三区| 狠狠狠色丁香婷婷综合久久五月| 人妖欧美一区二区| 日本午夜精品一区二区三区电影| 亚洲国产视频在线| 亚洲一区二区在线免费看| 一区二区在线观看视频| 一区二区三区自拍| 亚洲第一在线综合网站| 午夜精品福利久久久| 午夜精品久久久久久久| 日韩av中文在线观看| 人人狠狠综合久久亚洲| 裸体一区二区三区| 国内偷窥港台综合视频在线播放| 国产一区二三区好的| 国产精品99久久久久久有的能看| 国产精品一区二区视频| 成人国产精品视频| 色域天天综合网| 欧美另类z0zxhd电影| 91麻豆精品久久久久蜜臀| 欧美不卡在线视频| 久久久久久久久久久久久夜| 中文字幕va一区二区三区| 国产精品久久久久久户外露出| 亚洲人成网站精品片在线观看| 亚洲精品高清在线观看| 首页亚洲欧美制服丝腿| 久久国产欧美日韩精品| 91精品国产色综合久久不卡蜜臀 | 国产精品久久久久久户外露出| 国产精品美女www爽爽爽| 亚洲欧美另类在线| 日韩国产精品久久久久久亚洲| 国内外成人在线视频| 99精品国产视频| 欧美日韩亚洲综合在线| 精品国产凹凸成av人导航| 国产精品久久久久婷婷 | 亚洲私人黄色宅男| 亚洲成人av一区二区| 国产一区二区在线免费观看| 99热精品一区二区| 日韩三级免费观看| 国产精品全国免费观看高清| 亚洲影院在线观看| 国产伦精品一区二区三区免费迷 | 欧美精品一区二区不卡| 国产精品情趣视频| 奇米在线7777在线精品| 91免费国产在线观看| 欧美va日韩va| 亚洲小说欧美激情另类| 国产suv精品一区二区三区| 欧美日韩中文另类| 国产精品无人区| 免费观看91视频大全| 欧日韩精品视频| 国产精品卡一卡二| 韩国一区二区三区| 欧美美女网站色| ...中文天堂在线一区| 久久99精品久久久久久久久久久久 | www.亚洲免费av| 欧美精品一区视频| 日韩激情中文字幕| 99re热视频精品| 国产视频不卡一区| 久久电影国产免费久久电影| 欧美日韩视频一区二区| 国产精品久久看| 国产成人免费视频精品含羞草妖精| 欧美高清精品3d| 亚洲精品网站在线观看| 成人高清伦理免费影院在线观看| 欧美videofree性高清杂交| 亚洲午夜av在线| 93久久精品日日躁夜夜躁欧美| 久久精品人人爽人人爽| 国产中文字幕一区| 欧美一级搡bbbb搡bbbb| 亚欧色一区w666天堂| 91久久免费观看| 日韩理论片网站| 91碰在线视频| 亚洲日本护士毛茸茸| 91女厕偷拍女厕偷拍高清| 国产精品国产三级国产| 成人妖精视频yjsp地址| 欧美韩国日本综合| av在线综合网| 亚洲精品福利视频网站| 色8久久人人97超碰香蕉987|