mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-17 13:29:41 -04:00
889fbc5b0b
--HG-- branch : trunk rename : contrib/extractor/CMakeLists.txt => contrib/map_extractor/CMakeLists.txt rename : contrib/extractor/README.linux => contrib/map_extractor/README.linux rename : contrib/extractor/System.cpp => contrib/map_extractor/System.cpp rename : contrib/extractor/VC90_AD.sln => contrib/map_extractor/VC90_AD.sln rename : contrib/extractor/VC90_ad.vcproj => contrib/map_extractor/VC90_ad.vcproj rename : contrib/extractor/ad => contrib/map_extractor/ad rename : contrib/extractor/ad.exe => contrib/map_extractor/ad.exe rename : contrib/extractor/adt.cpp => contrib/map_extractor/adt.cpp rename : contrib/extractor/adt.h => contrib/map_extractor/adt.h rename : contrib/extractor/dbcfile.cpp => contrib/map_extractor/dbcfile.cpp rename : contrib/extractor/dbcfile.h => contrib/map_extractor/dbcfile.h rename : contrib/extractor/debug/zlib.lib => contrib/map_extractor/debug/zlib.lib rename : contrib/extractor/libmpq/CMakeLists.txt => contrib/map_extractor/libmpq/CMakeLists.txt rename : contrib/extractor/libmpq/common.cpp => contrib/map_extractor/libmpq/common.cpp rename : contrib/extractor/libmpq/common.h => contrib/map_extractor/libmpq/common.h rename : contrib/extractor/libmpq/explode.cpp => contrib/map_extractor/libmpq/explode.cpp rename : contrib/extractor/libmpq/explode.h => contrib/map_extractor/libmpq/explode.h rename : contrib/extractor/libmpq/extract.cpp => contrib/map_extractor/libmpq/extract.cpp rename : contrib/extractor/libmpq/huffman.cpp => contrib/map_extractor/libmpq/huffman.cpp rename : contrib/extractor/libmpq/huffman.h => contrib/map_extractor/libmpq/huffman.h rename : contrib/extractor/libmpq/mpq.cpp => contrib/map_extractor/libmpq/mpq.cpp rename : contrib/extractor/libmpq/mpq.h => contrib/map_extractor/libmpq/mpq.h rename : contrib/extractor/libmpq/parser.cpp => contrib/map_extractor/libmpq/parser.cpp rename : contrib/extractor/libmpq/wave.cpp => contrib/map_extractor/libmpq/wave.cpp rename : contrib/extractor/libmpq/wave.h => contrib/map_extractor/libmpq/wave.h rename : contrib/extractor/libmpq/zconf.h => contrib/map_extractor/libmpq/zconf.h rename : contrib/extractor/libmpq/zlib.h => contrib/map_extractor/libmpq/zlib.h rename : contrib/extractor/loadlib/CMakeLists.txt => contrib/map_extractor/loadlib/CMakeLists.txt rename : contrib/extractor/loadlib/adt.cpp => contrib/map_extractor/loadlib/adt.cpp rename : contrib/extractor/loadlib/adt.h => contrib/map_extractor/loadlib/adt.h rename : contrib/extractor/loadlib/loadlib.cpp => contrib/map_extractor/loadlib/loadlib.cpp rename : contrib/extractor/loadlib/loadlib.h => contrib/map_extractor/loadlib/loadlib.h rename : contrib/extractor/loadlib/wdt.cpp => contrib/map_extractor/loadlib/wdt.cpp rename : contrib/extractor/loadlib/wdt.h => contrib/map_extractor/loadlib/wdt.h rename : contrib/extractor/mpq_libmpq.cpp => contrib/map_extractor/mpq_libmpq.cpp rename : contrib/extractor/mpq_libmpq.h => contrib/map_extractor/mpq_libmpq.h rename : contrib/extractor/release/zlib.lib => contrib/map_extractor/release/zlib.lib
74 lines
2.8 KiB
C
74 lines
2.8 KiB
C
/*
|
|
* common.h -- defines and structs used by the config files.
|
|
*
|
|
* Copyright (C) 2003 Maik Broemme <mbroemme@plusserver.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: common.h,v 1.4 2004/02/12 00:41:55 mbroemme Exp $
|
|
*/
|
|
|
|
#define LIBMPQ_CONF_FL_INCREMENT 512 /* i hope we did not need more :) */
|
|
#define LIBMPQ_CONF_EXT ".conf" /* listdb file seems to be valid with this extension */
|
|
#define LIBMPQ_CONF_HEADER "LIBMPQ_VERSION" /* listdb file must include this entry to be valid */
|
|
#define LIBMPQ_CONF_BUFSIZE 4096 /* maximum number of bytes a line in the file could contain */
|
|
|
|
#define LIBMPQ_CONF_TYPE_CHAR 1 /* value in config file is from type char */
|
|
#define LIBMPQ_CONF_TYPE_INT 2 /* value in config file is from type int */
|
|
|
|
#define LIBMPQ_CONF_EOPEN_DIR -1 /* error on open directory */
|
|
#define LIBMPQ_CONF_EVALUE_NOT_FOUND -2 /* value for the option was not found */
|
|
|
|
#if defined( __GNUC__ )
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
|
|
#define _lseek lseek
|
|
#define _read read
|
|
#define _open open
|
|
#define _write write
|
|
#define _close close
|
|
#define _strdup strdup
|
|
|
|
#ifndef O_BINARY
|
|
#define O_BINARY 0
|
|
#endif
|
|
#else
|
|
#include <io.h>
|
|
#endif
|
|
|
|
#ifdef O_LARGEFILE
|
|
#define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY | O_LARGEFILE)
|
|
#else
|
|
#define MPQ_FILE_OPEN_FLAGS (O_RDONLY | O_BINARY)
|
|
#endif
|
|
|
|
#ifndef min
|
|
#define min(a, b) ((a < b) ? a : b)
|
|
#endif
|
|
|
|
int libmpq_init_buffer(mpq_archive *mpq_a);
|
|
int libmpq_read_hashtable(mpq_archive *mpq_a);
|
|
int libmpq_read_blocktable(mpq_archive *mpq_a);
|
|
int libmpq_file_read_file(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int filepos, char *buffer, unsigned int toread);
|
|
int libmpq_read_listfile(mpq_archive *mpq_a, FILE *fp);
|
|
|
|
int libmpq_conf_get_value(FILE *fp, char *search_value, void *return_value, int type, int size);
|
|
char *libmpq_conf_delete_char(char *buf, char *chars);
|
|
int libmpq_conf_get_array(FILE *fp, char *search_value, char ***filelist, int *entries);
|
|
int libmpq_free_listfile(char **filelist);
|
|
int libmpq_read_listfile(mpq_archive *mpq_a, FILE *fp);
|
|
|