Compare commits
19 Commits
amxmodx-0.
...
amxmodx-0.
Author | SHA1 | Date | |
---|---|---|---|
62e6b1c859 | |||
5464977fb7 | |||
f5fc9d026f | |||
d5cb120ab4 | |||
7cbe114cf0 | |||
84771f11a7 | |||
8b35ce2145 | |||
9d3ea5513b | |||
94219ae71a | |||
f4130105b0 | |||
e4d11b321d | |||
c53f54fe20 | |||
c95e1d8ae3 | |||
4ee81cd1ca | |||
9a98b20d1b | |||
ff9bce89f2 | |||
2d9e405b18 | |||
4a74dce0cd | |||
473699e7c8 |
@ -47,6 +47,15 @@
|
|||||||
#define FFHL_VERSION 4
|
#define FFHL_VERSION 4
|
||||||
#define FFHL_MIN_VERSION 4
|
#define FFHL_MIN_VERSION 4
|
||||||
|
|
||||||
|
#define NEXT_PARAM() \
|
||||||
|
if (parm > paramCount) \
|
||||||
|
{ \
|
||||||
|
strcpy(outbuf, ""); \
|
||||||
|
len = 0; \
|
||||||
|
AMXXLOG_Log("[AMXX] Plugin did not format a string correctly (parameter %d (total %d), line %d, \"%s\")", parm, paramCount, amx->curline, g_plugins.findPluginFast(amx)); \
|
||||||
|
return outbuf; \
|
||||||
|
}
|
||||||
|
|
||||||
/*version history:
|
/*version history:
|
||||||
* 1 (BAILOPAN) - Simplest form possible, no reverse
|
* 1 (BAILOPAN) - Simplest form possible, no reverse
|
||||||
* 2 (BAILOPAN) - One language per file with full reverse
|
* 2 (BAILOPAN) - One language per file with full reverse
|
||||||
@ -627,8 +636,9 @@ const char *CLangMngr::Format(const char *src, ...)
|
|||||||
|
|
||||||
char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
||||||
{
|
{
|
||||||
cell *src = get_amxaddr(amx, params[parm++]);
|
int paramCount = *params / sizeof(cell);
|
||||||
static char outbuf[4096];
|
static char outbuf[4096];
|
||||||
|
cell *src = get_amxaddr(amx, params[parm++]);
|
||||||
char *outptr = outbuf;
|
char *outptr = outbuf;
|
||||||
enum State
|
enum State
|
||||||
{
|
{
|
||||||
@ -646,6 +656,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
if (*src=='L')
|
if (*src=='L')
|
||||||
{
|
{
|
||||||
cell langName = params[parm]; // "en" case (langName contains the address to the string)
|
cell langName = params[parm]; // "en" case (langName contains the address to the string)
|
||||||
|
NEXT_PARAM();
|
||||||
cell *pAmxLangName = get_amxaddr(amx, params[parm++]); // other cases
|
cell *pAmxLangName = get_amxaddr(amx, params[parm++]); // other cases
|
||||||
const char *cpLangName=NULL;
|
const char *cpLangName=NULL;
|
||||||
// Handle player ids (1-32) and server language
|
// Handle player ids (1-32) and server language
|
||||||
@ -673,6 +684,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
if (!cpLangName || strlen(cpLangName) < 1)
|
if (!cpLangName || strlen(cpLangName) < 1)
|
||||||
cpLangName = "en";
|
cpLangName = "en";
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
NEXT_PARAM();
|
||||||
char *key = get_amxstring(amx, params[parm++], 1, len);
|
char *key = get_amxstring(amx, params[parm++], 1, len);
|
||||||
const char *def = GetDef(cpLangName, key);
|
const char *def = GetDef(cpLangName, key);
|
||||||
if (def == NULL)
|
if (def == NULL)
|
||||||
@ -709,6 +721,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
{
|
{
|
||||||
char tmpString[256];
|
char tmpString[256];
|
||||||
char *tmpPtr = tmpString;
|
char *tmpPtr = tmpString;
|
||||||
|
NEXT_PARAM();
|
||||||
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
||||||
while (*tmpCell)
|
while (*tmpCell)
|
||||||
*tmpPtr++ = *tmpCell++;
|
*tmpPtr++ = *tmpCell++;
|
||||||
@ -719,15 +732,23 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
case 'g':
|
case 'g':
|
||||||
case 'f':
|
case 'f':
|
||||||
{
|
{
|
||||||
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'd':
|
case 'd':
|
||||||
{
|
{
|
||||||
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
*outptr++ = '%';
|
||||||
|
*outptr++ = *(ptr-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
outptr += strlen(outptr);
|
outptr += strlen(outptr);
|
||||||
}
|
}
|
||||||
@ -764,6 +785,8 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
char format[16];
|
char format[16];
|
||||||
format[0] = '%';
|
format[0] = '%';
|
||||||
char *ptr = format+1;
|
char *ptr = format+1;
|
||||||
|
if (*src != '%')
|
||||||
|
{
|
||||||
while (!isalpha(*ptr++ = *src++))
|
while (!isalpha(*ptr++ = *src++))
|
||||||
/*nothing*/;
|
/*nothing*/;
|
||||||
--src;
|
--src;
|
||||||
@ -772,6 +795,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
{
|
{
|
||||||
case 's':
|
case 's':
|
||||||
{
|
{
|
||||||
|
NEXT_PARAM();
|
||||||
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
||||||
while (*tmpCell)
|
while (*tmpCell)
|
||||||
*tmpPtr++ = *tmpCell++;
|
*tmpPtr++ = *tmpCell++;
|
||||||
@ -782,15 +806,28 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||||||
case 'g':
|
case 'g':
|
||||||
case 'f':
|
case 'f':
|
||||||
{
|
{
|
||||||
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, *(REAL*)get_amxaddr(amx, params[parm++]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'i':
|
case 'i':
|
||||||
case 'd':
|
case 'd':
|
||||||
{
|
{
|
||||||
|
NEXT_PARAM();
|
||||||
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
sprintf(outptr, format, (int)*get_amxaddr(amx, params[parm++]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
*outptr++ = '%';
|
||||||
|
*outptr++ = *(ptr-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
*outptr++ = '%';
|
||||||
|
*outptr++ = '%';
|
||||||
|
src++;
|
||||||
}
|
}
|
||||||
outptr += strlen(outptr);
|
outptr += strlen(outptr);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ $mm = "../metamod/metamod";
|
|||||||
|
|
||||||
@CPP_SOURCE_FILES = ("meta_api.cpp", "CFile.cpp", "CVault.cpp", "vault.cpp", "float.cpp", "file.cpp", "modules.cpp", "CMisc.cpp", "CTask.cpp", "string.cpp", "amxmodx.cpp", "CEvent.cpp", "CCmd.cpp", "CLogEvent.cpp", "srvcmd.cpp", "strptime.cpp", "amxcore.cpp", "amxtime.cpp", "power.cpp", "amxxlog.cpp", "fakemeta.cpp", "MMGR/MMGR.cpp", "amxxfile.cpp", "CLang.cpp", "md5.cpp", "emsg.cpp", "CForward.cpp", "CPlugin.cpp", "CModule.cpp", "CMenu.cpp", "util.cpp");
|
@CPP_SOURCE_FILES = ("meta_api.cpp", "CFile.cpp", "CVault.cpp", "vault.cpp", "float.cpp", "file.cpp", "modules.cpp", "CMisc.cpp", "CTask.cpp", "string.cpp", "amxmodx.cpp", "CEvent.cpp", "CCmd.cpp", "CLogEvent.cpp", "srvcmd.cpp", "strptime.cpp", "amxcore.cpp", "amxtime.cpp", "power.cpp", "amxxlog.cpp", "fakemeta.cpp", "MMGR/MMGR.cpp", "amxxfile.cpp", "CLang.cpp", "md5.cpp", "emsg.cpp", "CForward.cpp", "CPlugin.cpp", "CModule.cpp", "CMenu.cpp", "util.cpp");
|
||||||
|
|
||||||
@C_SOURCE_FILES = ("minilzo/minilzo.c");
|
@C_SOURCE_FILES = ();
|
||||||
my %OPTIONS, %OPT;
|
my %OPTIONS, %OPT;
|
||||||
|
|
||||||
$OPT{"debug"} = "-g -ggdb";
|
$OPT{"debug"} = "-g -ggdb";
|
||||||
@ -59,10 +59,10 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
`cp amx.cpp amx.c`;
|
`ln -s amx.cpp amx.c`;
|
||||||
push(@C_SOURCE_FILES, "amx.c");
|
push(@C_SOURCE_FILES, "amx.c");
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
} else {
|
} else {
|
||||||
@ -180,7 +180,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -218,5 +218,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -Lzlib/ -shared -ldl -lm @LINK -lz -o $outdir/$bin";
|
||||||
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#include "amxmodx.h"
|
#include "amxmodx.h"
|
||||||
#include "amxxfile.h"
|
#include "amxxfile.h"
|
||||||
#include "minilzo/minilzo.h"
|
#include "zlib/zlib.h"
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
****** AMXXFILE ******
|
****** AMXXFILE ******
|
||||||
@ -51,7 +51,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef lzo_byte mint8_t;
|
typedef char mint8_t;
|
||||||
typedef int16_t mint16_t;
|
typedef int16_t mint16_t;
|
||||||
typedef int32_t mint32_t;
|
typedef int32_t mint32_t;
|
||||||
|
|
||||||
@ -85,13 +85,6 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
|
|||||||
m_Status = Err_None;
|
m_Status = Err_None;
|
||||||
m_CellSize = cellsize;
|
m_CellSize = cellsize;
|
||||||
|
|
||||||
// Make sure the decompressor runs
|
|
||||||
if (lzo_init() != LZO_E_OK)
|
|
||||||
{
|
|
||||||
m_Status = Err_DecompressorInit;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_pFile = fopen(filename, "rb");
|
m_pFile = fopen(filename, "rb");
|
||||||
if (!m_pFile)
|
if (!m_pFile)
|
||||||
{
|
{
|
||||||
@ -103,7 +96,7 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
|
|||||||
DATAREAD(&magic, sizeof(magic), 1);
|
DATAREAD(&magic, sizeof(magic), 1);
|
||||||
|
|
||||||
m_OldFile = false;
|
m_OldFile = false;
|
||||||
if (magic != 0x524C4542)
|
if (magic != 0x414D5842)
|
||||||
{
|
{
|
||||||
// check for old file
|
// check for old file
|
||||||
AMX_HEADER hdr;
|
AMX_HEADER hdr;
|
||||||
@ -131,7 +124,13 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
|
|||||||
m_pFile = NULL;
|
m_pFile = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
} else if ( magic == 0x524C4542 ) {
|
||||||
|
//we have an invalid, old, RLEB file
|
||||||
|
m_Status = Err_OldFile;
|
||||||
|
fclose(m_pFile);
|
||||||
|
m_pFile = NULL;
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
|
||||||
// try to find the section
|
// try to find the section
|
||||||
mint8_t numOfPlugins;
|
mint8_t numOfPlugins;
|
||||||
@ -171,6 +170,7 @@ CAmxxReader::CAmxxReader(const char *filename, int cellsize)
|
|||||||
fseek(m_pFile, 0, SEEK_END);
|
fseek(m_pFile, 0, SEEK_END);
|
||||||
m_SectionLength = ftell(m_pFile) - (long)entry.offset;
|
m_SectionLength = ftell(m_pFile) - (long)entry.offset;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CAmxxReader::~CAmxxReader()
|
CAmxxReader::~CAmxxReader()
|
||||||
@ -205,11 +205,15 @@ size_t CAmxxReader::GetBufferSize()
|
|||||||
if (!m_pFile)
|
if (!m_pFile)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
|
long save = ftell(m_pFile);
|
||||||
|
|
||||||
if (m_OldFile)
|
if (m_OldFile)
|
||||||
{
|
{
|
||||||
rewind(m_pFile);
|
rewind(m_pFile);
|
||||||
AMX_HEADER hdr;
|
AMX_HEADER hdr;
|
||||||
DATAREAD(&hdr, sizeof(hdr), 1);
|
DATAREAD(&hdr, sizeof(hdr), 1);
|
||||||
|
fseek(m_pFile, save, SEEK_SET);
|
||||||
return hdr.stp;
|
return hdr.stp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,6 +221,7 @@ size_t CAmxxReader::GetBufferSize()
|
|||||||
|
|
||||||
TableEntry entry;
|
TableEntry entry;
|
||||||
DATAREAD(&entry, sizeof(entry), 1);
|
DATAREAD(&entry, sizeof(entry), 1);
|
||||||
|
fseek(m_pFile, save, SEEK_SET);
|
||||||
return entry.origSize + 1; // +1 : safe
|
return entry.origSize + 1; // +1 : safe
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,16 +260,18 @@ CAmxxReader::Error CAmxxReader::GetSection(void *buffer)
|
|||||||
TableEntry entry;
|
TableEntry entry;
|
||||||
DATAREAD(&entry, sizeof(entry), 1);
|
DATAREAD(&entry, sizeof(entry), 1);
|
||||||
fseek(m_pFile, entry.offset, SEEK_SET);
|
fseek(m_pFile, entry.offset, SEEK_SET);
|
||||||
|
// AMXXLOG_Log("|||| Offset needed: %d At: %d", entry.offset, ftell(m_pFile));
|
||||||
|
uLongf destLen = GetBufferSize();
|
||||||
// read the data to a temporary buffer
|
// read the data to a temporary buffer
|
||||||
lzo_byte *tempBuffer = new lzo_byte[m_SectionLength + 1];
|
char *tempBuffer = new char[m_SectionLength + 1];
|
||||||
|
//fread(tempBuffer, sizeof(char), m_SectionLength, m_pFile);
|
||||||
DATAREAD((void*)tempBuffer, 1, m_SectionLength);
|
DATAREAD((void*)tempBuffer, 1, m_SectionLength);
|
||||||
// decompress
|
// decompress
|
||||||
lzo_uint destLen = GetBufferSize();
|
// AMXXLOG_Log("|||| First Bytes: %d %d %d %d", tempBuffer[0], tempBuffer[1], tempBuffer[2], tempBuffer[3]);
|
||||||
int result = lzo1x_decompress_safe(tempBuffer, m_SectionLength,
|
int result = uncompress((Bytef *)buffer, &destLen,
|
||||||
(lzo_byte*)buffer, &destLen,
|
(Bytef *)tempBuffer, m_SectionLength);
|
||||||
NULL /*unused*/ );
|
// AMXXLOG_Log("|||| Result: %d, m_SectionLength=%d, destLen=%d", result, m_SectionLength, destLen);
|
||||||
if (result != LZO_E_OK)
|
if (result != Z_OK)
|
||||||
{
|
{
|
||||||
m_Status = Err_Decompress;
|
m_Status = Err_Decompress;
|
||||||
return Err_Decompress;
|
return Err_Decompress;
|
||||||
|
@ -44,7 +44,8 @@ public:
|
|||||||
Err_FileInvalid,
|
Err_FileInvalid,
|
||||||
Err_SectionNotFound,
|
Err_SectionNotFound,
|
||||||
Err_DecompressorInit,
|
Err_DecompressorInit,
|
||||||
Err_Decompress
|
Err_Decompress,
|
||||||
|
Err_OldFile,
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1,451 +0,0 @@
|
|||||||
/* lzoconf.h -- configuration for the LZO real-time data compression library
|
|
||||||
|
|
||||||
This file is part of the LZO real-time data compression library.
|
|
||||||
|
|
||||||
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
The LZO library 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.
|
|
||||||
|
|
||||||
The LZO library 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 the LZO library; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/opensource/lzo/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __LZOCONF_H
|
|
||||||
#define __LZOCONF_H
|
|
||||||
|
|
||||||
#define LZO_VERSION 0x1080
|
|
||||||
#define LZO_VERSION_STRING "1.08"
|
|
||||||
#define LZO_VERSION_DATE "Jul 12 2002"
|
|
||||||
|
|
||||||
/* internal Autoconf configuration file - only used when building LZO */
|
|
||||||
#if defined(LZO_HAVE_CONFIG_H)
|
|
||||||
# include <config.h>
|
|
||||||
#endif
|
|
||||||
#include <limits.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// LZO requires a conforming <limits.h>
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
|
|
||||||
# error "invalid CHAR_BIT"
|
|
||||||
#endif
|
|
||||||
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
|
|
||||||
# error "check your compiler installation"
|
|
||||||
#endif
|
|
||||||
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
|
|
||||||
# error "your limits.h macros are broken"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* workaround a cpp bug under hpux 10.20 */
|
|
||||||
#define LZO_0xffffffffL 4294967295ul
|
|
||||||
|
|
||||||
#if !defined(LZO_UINT32_C)
|
|
||||||
# if (UINT_MAX < LZO_0xffffffffL)
|
|
||||||
# define LZO_UINT32_C(c) c ## UL
|
|
||||||
# else
|
|
||||||
# define LZO_UINT32_C(c) c ## U
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// architecture defines
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
#if !defined(__LZO_WIN) && !defined(__LZO_DOS) && !defined(__LZO_OS2)
|
|
||||||
# if defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows)
|
|
||||||
# define __LZO_WIN
|
|
||||||
# elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
|
|
||||||
# define __LZO_WIN
|
|
||||||
# elif defined(__NT__) || defined(__NT_DLL__) || defined(__WINDOWS_386__)
|
|
||||||
# define __LZO_WIN
|
|
||||||
# elif defined(__DOS__) || defined(__MSDOS__) || defined(MSDOS)
|
|
||||||
# define __LZO_DOS
|
|
||||||
# elif defined(__OS2__) || defined(__OS2V2__) || defined(OS2)
|
|
||||||
# define __LZO_OS2
|
|
||||||
# elif defined(__palmos__)
|
|
||||||
# define __LZO_PALMOS
|
|
||||||
# elif defined(__TOS__) || defined(__atarist__)
|
|
||||||
# define __LZO_TOS
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (UINT_MAX < LZO_0xffffffffL)
|
|
||||||
# if defined(__LZO_WIN)
|
|
||||||
# define __LZO_WIN16
|
|
||||||
# elif defined(__LZO_DOS)
|
|
||||||
# define __LZO_DOS16
|
|
||||||
# elif defined(__LZO_PALMOS)
|
|
||||||
# define __LZO_PALMOS16
|
|
||||||
# elif defined(__LZO_TOS)
|
|
||||||
# define __LZO_TOS16
|
|
||||||
# elif defined(__C166__)
|
|
||||||
# else
|
|
||||||
/* porting hint: for pure 16-bit architectures try compiling
|
|
||||||
* everything with -D__LZO_STRICT_16BIT */
|
|
||||||
# error "16-bit target not supported - contact me for porting hints"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(__LZO_i386)
|
|
||||||
# if defined(__LZO_DOS) || defined(__LZO_WIN16)
|
|
||||||
# define __LZO_i386
|
|
||||||
# elif defined(__i386__) || defined(__386__) || defined(_M_IX86)
|
|
||||||
# define __LZO_i386
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__LZO_STRICT_16BIT)
|
|
||||||
# if (UINT_MAX < LZO_0xffffffffL)
|
|
||||||
# include <lzo16bit.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* memory checkers */
|
|
||||||
#if !defined(__LZO_CHECKER)
|
|
||||||
# if defined(__BOUNDS_CHECKING_ON)
|
|
||||||
# define __LZO_CHECKER
|
|
||||||
# elif defined(__CHECKER__)
|
|
||||||
# define __LZO_CHECKER
|
|
||||||
# elif defined(__INSURE__)
|
|
||||||
# define __LZO_CHECKER
|
|
||||||
# elif defined(__PURIFY__)
|
|
||||||
# define __LZO_CHECKER
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// integral and pointer types
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Integral types with 32 bits or more */
|
|
||||||
#if !defined(LZO_UINT32_MAX)
|
|
||||||
# if (UINT_MAX >= LZO_0xffffffffL)
|
|
||||||
typedef unsigned int lzo_uint32;
|
|
||||||
typedef int lzo_int32;
|
|
||||||
# define LZO_UINT32_MAX UINT_MAX
|
|
||||||
# define LZO_INT32_MAX INT_MAX
|
|
||||||
# define LZO_INT32_MIN INT_MIN
|
|
||||||
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
|
||||||
typedef unsigned long lzo_uint32;
|
|
||||||
typedef long lzo_int32;
|
|
||||||
# define LZO_UINT32_MAX ULONG_MAX
|
|
||||||
# define LZO_INT32_MAX LONG_MAX
|
|
||||||
# define LZO_INT32_MIN LONG_MIN
|
|
||||||
# else
|
|
||||||
# error "lzo_uint32"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* lzo_uint is used like size_t */
|
|
||||||
#if !defined(LZO_UINT_MAX)
|
|
||||||
# if (UINT_MAX >= LZO_0xffffffffL)
|
|
||||||
typedef unsigned int lzo_uint;
|
|
||||||
typedef int lzo_int;
|
|
||||||
# define LZO_UINT_MAX UINT_MAX
|
|
||||||
# define LZO_INT_MAX INT_MAX
|
|
||||||
# define LZO_INT_MIN INT_MIN
|
|
||||||
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
|
||||||
typedef unsigned long lzo_uint;
|
|
||||||
typedef long lzo_int;
|
|
||||||
# define LZO_UINT_MAX ULONG_MAX
|
|
||||||
# define LZO_INT_MAX LONG_MAX
|
|
||||||
# define LZO_INT_MIN LONG_MIN
|
|
||||||
# else
|
|
||||||
# error "lzo_uint"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef int lzo_bool;
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// memory models
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Memory model for the public code segment. */
|
|
||||||
#if !defined(__LZO_CMODEL)
|
|
||||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
|
||||||
# define __LZO_CMODEL __far
|
|
||||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
|
||||||
# define __LZO_CMODEL __near
|
|
||||||
# else
|
|
||||||
# define __LZO_CMODEL
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Memory model for the public data segment. */
|
|
||||||
#if !defined(__LZO_DMODEL)
|
|
||||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
|
||||||
# define __LZO_DMODEL __far
|
|
||||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
|
||||||
# define __LZO_DMODEL __near
|
|
||||||
# else
|
|
||||||
# define __LZO_DMODEL
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Memory model that allows to access memory at offsets of lzo_uint. */
|
|
||||||
#if !defined(__LZO_MMODEL)
|
|
||||||
# if (LZO_UINT_MAX <= UINT_MAX)
|
|
||||||
# define __LZO_MMODEL
|
|
||||||
# elif defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
|
||||||
# define __LZO_MMODEL __huge
|
|
||||||
# define LZO_999_UNSUPPORTED
|
|
||||||
# elif defined(__LZO_PALMOS16) || defined(__LZO_TOS16)
|
|
||||||
# define __LZO_MMODEL
|
|
||||||
# else
|
|
||||||
# error "__LZO_MMODEL"
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* no typedef here because of const-pointer issues */
|
|
||||||
#define lzo_byte unsigned char __LZO_MMODEL
|
|
||||||
#define lzo_bytep unsigned char __LZO_MMODEL *
|
|
||||||
#define lzo_charp char __LZO_MMODEL *
|
|
||||||
#define lzo_voidp void __LZO_MMODEL *
|
|
||||||
#define lzo_shortp short __LZO_MMODEL *
|
|
||||||
#define lzo_ushortp unsigned short __LZO_MMODEL *
|
|
||||||
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
|
|
||||||
#define lzo_int32p lzo_int32 __LZO_MMODEL *
|
|
||||||
#define lzo_uintp lzo_uint __LZO_MMODEL *
|
|
||||||
#define lzo_intp lzo_int __LZO_MMODEL *
|
|
||||||
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
|
|
||||||
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
|
|
||||||
|
|
||||||
#ifndef lzo_sizeof_dict_t
|
|
||||||
# define lzo_sizeof_dict_t sizeof(lzo_bytep)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// calling conventions and function types
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* linkage */
|
|
||||||
#if !defined(__LZO_EXTERN_C)
|
|
||||||
# ifdef __cplusplus
|
|
||||||
# define __LZO_EXTERN_C extern "C"
|
|
||||||
# else
|
|
||||||
# define __LZO_EXTERN_C extern
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* calling convention */
|
|
||||||
#if !defined(__LZO_CDECL)
|
|
||||||
# if defined(__LZO_DOS16) || defined(__LZO_WIN16)
|
|
||||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
|
||||||
# elif defined(__LZO_i386) && defined(_MSC_VER)
|
|
||||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
|
||||||
# elif defined(__LZO_i386) && defined(__WATCOMC__)
|
|
||||||
# define __LZO_CDECL __LZO_CMODEL __cdecl
|
|
||||||
# else
|
|
||||||
# define __LZO_CDECL __LZO_CMODEL
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if !defined(__LZO_ENTRY)
|
|
||||||
# define __LZO_ENTRY __LZO_CDECL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* C++ exception specification for extern "C" function types */
|
|
||||||
#if !defined(__cplusplus)
|
|
||||||
# undef LZO_NOTHROW
|
|
||||||
# define LZO_NOTHROW
|
|
||||||
#elif !defined(LZO_NOTHROW)
|
|
||||||
# define LZO_NOTHROW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_ENTRY *lzo_compress_t) ( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_ENTRY *lzo_decompress_t) ( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_ENTRY *lzo_optimize_t) ( lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_ENTRY *lzo_compress_dict_t)(const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem,
|
|
||||||
const lzo_byte *dict, lzo_uint dict_len );
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_ENTRY *lzo_decompress_dict_t)(const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem,
|
|
||||||
const lzo_byte *dict, lzo_uint dict_len );
|
|
||||||
|
|
||||||
|
|
||||||
/* assembler versions always use __cdecl */
|
|
||||||
typedef int
|
|
||||||
(__LZO_CDECL *lzo_compress_asm_t)( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
typedef int
|
|
||||||
(__LZO_CDECL *lzo_decompress_asm_t)( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
|
|
||||||
/* a progress indicator callback function */
|
|
||||||
typedef void (__LZO_ENTRY *lzo_progress_callback_t) (lzo_uint, lzo_uint);
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// export information
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* DLL export information */
|
|
||||||
#if !defined(__LZO_EXPORT1)
|
|
||||||
# define __LZO_EXPORT1
|
|
||||||
#endif
|
|
||||||
#if !defined(__LZO_EXPORT2)
|
|
||||||
# define __LZO_EXPORT2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* exported calling convention for C functions */
|
|
||||||
#if !defined(LZO_PUBLIC)
|
|
||||||
# define LZO_PUBLIC(_rettype) \
|
|
||||||
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_ENTRY
|
|
||||||
#endif
|
|
||||||
#if !defined(LZO_EXTERN)
|
|
||||||
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
|
|
||||||
#endif
|
|
||||||
#if !defined(LZO_PRIVATE)
|
|
||||||
# define LZO_PRIVATE(_rettype) static _rettype __LZO_ENTRY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* exported __cdecl calling convention for assembler functions */
|
|
||||||
#if !defined(LZO_PUBLIC_CDECL)
|
|
||||||
# define LZO_PUBLIC_CDECL(_rettype) \
|
|
||||||
__LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
|
|
||||||
#endif
|
|
||||||
#if !defined(LZO_EXTERN_CDECL)
|
|
||||||
# define LZO_EXTERN_CDECL(_rettype) __LZO_EXTERN_C LZO_PUBLIC_CDECL(_rettype)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* exported global variables (LZO currently uses no static variables and
|
|
||||||
* is fully thread safe) */
|
|
||||||
#if !defined(LZO_PUBLIC_VAR)
|
|
||||||
# define LZO_PUBLIC_VAR(_type) \
|
|
||||||
__LZO_EXPORT1 _type __LZO_EXPORT2 __LZO_DMODEL
|
|
||||||
#endif
|
|
||||||
#if !defined(LZO_EXTERN_VAR)
|
|
||||||
# define LZO_EXTERN_VAR(_type) extern LZO_PUBLIC_VAR(_type)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
// error codes and prototypes
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Error codes for the compression/decompression functions. Negative
|
|
||||||
* values are errors, positive values will be used for special but
|
|
||||||
* normal events.
|
|
||||||
*/
|
|
||||||
#define LZO_E_OK 0
|
|
||||||
#define LZO_E_ERROR (-1)
|
|
||||||
#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */
|
|
||||||
#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */
|
|
||||||
#define LZO_E_INPUT_OVERRUN (-4)
|
|
||||||
#define LZO_E_OUTPUT_OVERRUN (-5)
|
|
||||||
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
|
|
||||||
#define LZO_E_EOF_NOT_FOUND (-7)
|
|
||||||
#define LZO_E_INPUT_NOT_CONSUMED (-8)
|
|
||||||
|
|
||||||
|
|
||||||
/* lzo_init() should be the first function you call.
|
|
||||||
* Check the return code !
|
|
||||||
*
|
|
||||||
* lzo_init() is a macro to allow checking that the library and the
|
|
||||||
* compiler's view of various types are consistent.
|
|
||||||
*/
|
|
||||||
#define lzo_init() __lzo_init2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
|
|
||||||
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
|
|
||||||
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
|
|
||||||
(int)sizeof(lzo_compress_t))
|
|
||||||
LZO_EXTERN(int) __lzo_init2(unsigned,int,int,int,int,int,int,int,int,int);
|
|
||||||
|
|
||||||
/* version functions (useful for shared libraries) */
|
|
||||||
LZO_EXTERN(unsigned) lzo_version(void);
|
|
||||||
LZO_EXTERN(const char *) lzo_version_string(void);
|
|
||||||
LZO_EXTERN(const char *) lzo_version_date(void);
|
|
||||||
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
|
|
||||||
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
|
|
||||||
|
|
||||||
/* string functions */
|
|
||||||
LZO_EXTERN(int)
|
|
||||||
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
|
|
||||||
LZO_EXTERN(lzo_voidp)
|
|
||||||
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
|
||||||
LZO_EXTERN(lzo_voidp)
|
|
||||||
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
|
||||||
LZO_EXTERN(lzo_voidp)
|
|
||||||
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
|
|
||||||
|
|
||||||
/* checksum functions */
|
|
||||||
LZO_EXTERN(lzo_uint32)
|
|
||||||
lzo_adler32(lzo_uint32 _adler, const lzo_byte *_buf, lzo_uint _len);
|
|
||||||
LZO_EXTERN(lzo_uint32)
|
|
||||||
lzo_crc32(lzo_uint32 _c, const lzo_byte *_buf, lzo_uint _len);
|
|
||||||
|
|
||||||
/* misc. */
|
|
||||||
LZO_EXTERN(lzo_bool) lzo_assert(int _expr);
|
|
||||||
LZO_EXTERN(int) _lzo_config_check(void);
|
|
||||||
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
|
|
||||||
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
|
|
||||||
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
|
|
||||||
|
|
||||||
/* align a char pointer on a boundary that is a multiple of `size' */
|
|
||||||
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
|
|
||||||
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
|
|
||||||
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
|
|
||||||
|
|
||||||
/* deprecated - only for backward compatibility */
|
|
||||||
#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size)
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -1,100 +0,0 @@
|
|||||||
/* minilzo.h -- mini subset of the LZO real-time data compression library
|
|
||||||
|
|
||||||
This file is part of the LZO real-time data compression library.
|
|
||||||
|
|
||||||
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
|
||||||
All Rights Reserved.
|
|
||||||
|
|
||||||
The LZO library 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.
|
|
||||||
|
|
||||||
The LZO library 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 the LZO library; see the file COPYING.
|
|
||||||
If not, write to the Free Software Foundation, Inc.,
|
|
||||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
|
|
||||||
Markus F.X.J. Oberhumer
|
|
||||||
<markus@oberhumer.com>
|
|
||||||
http://www.oberhumer.com/opensource/lzo/
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* NOTE:
|
|
||||||
* the full LZO package can be found at
|
|
||||||
* http://www.oberhumer.com/opensource/lzo/
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __MINILZO_H
|
|
||||||
#define __MINILZO_H
|
|
||||||
|
|
||||||
#define MINILZO_VERSION 0x1080
|
|
||||||
|
|
||||||
#ifdef __LZOCONF_H
|
|
||||||
# error "you cannot use both LZO and miniLZO"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#undef LZO_HAVE_CONFIG_H
|
|
||||||
#include "lzoconf.h"
|
|
||||||
|
|
||||||
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
|
|
||||||
# error "version mismatch in header files"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
//
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Memory required for the wrkmem parameter.
|
|
||||||
* When the required size is 0, you can also pass a NULL pointer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
|
|
||||||
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
|
|
||||||
#define LZO1X_MEM_DECOMPRESS (0)
|
|
||||||
|
|
||||||
|
|
||||||
/* compression */
|
|
||||||
LZO_EXTERN(int)
|
|
||||||
lzo1x_1_compress ( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem );
|
|
||||||
|
|
||||||
/* decompression */
|
|
||||||
LZO_EXTERN(int)
|
|
||||||
lzo1x_decompress ( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem /* NOT USED */ );
|
|
||||||
|
|
||||||
/* safe decompression with overrun testing */
|
|
||||||
LZO_EXTERN(int)
|
|
||||||
lzo1x_decompress_safe ( const lzo_byte *src, lzo_uint src_len,
|
|
||||||
lzo_byte *dst, lzo_uintp dst_len,
|
|
||||||
lzo_voidp wrkmem /* NOT USED */ );
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
} /* extern "C" */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* already included */
|
|
||||||
|
|
@ -132,6 +132,8 @@ int load_amxscript(AMX *amx, void **program, const char *filename, char error[64
|
|||||||
case CAmxxReader::Err_Decompress:
|
case CAmxxReader::Err_Decompress:
|
||||||
strcpy(error, "Internal error: Decompress");
|
strcpy(error, "Internal error: Decompress");
|
||||||
return (amx->error = AMX_ERR_NOTFOUND);
|
return (amx->error = AMX_ERR_NOTFOUND);
|
||||||
|
case CAmxxReader::Err_OldFile:
|
||||||
|
strcpy(error, "Plugin uses deprecated format. Update compiler");
|
||||||
default:
|
default:
|
||||||
strcpy(error, "Unknown error");
|
strcpy(error, "Unknown error");
|
||||||
return (amx->error = AMX_ERR_NOTFOUND);
|
return (amx->error = AMX_ERR_NOTFOUND);
|
||||||
@ -894,6 +896,7 @@ void *Module_ReqFnptr(const char *funcName)
|
|||||||
REGISTER_FUNC("amx_Execv", amx_Execv)
|
REGISTER_FUNC("amx_Execv", amx_Execv)
|
||||||
REGISTER_FUNC("amx_Allot", amx_Allot)
|
REGISTER_FUNC("amx_Allot", amx_Allot)
|
||||||
REGISTER_FUNC("amx_FindPublic", amx_FindPublic)
|
REGISTER_FUNC("amx_FindPublic", amx_FindPublic)
|
||||||
|
REGISTER_FUNC("amx_FindNative", amx_FindNative)
|
||||||
|
|
||||||
// Natives / Forwards
|
// Natives / Forwards
|
||||||
REGISTER_FUNC("AddNatives", MNF_AddNatives)
|
REGISTER_FUNC("AddNatives", MNF_AddNatives)
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\zlib\zlib.lib"
|
||||||
OutputFile="debug/amxx_mm.dll"
|
OutputFile="debug/amxx_mm.dll"
|
||||||
Version="0.1"
|
Version="0.1"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
@ -386,7 +386,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalOptions="/MACHINE:I386"
|
AdditionalOptions="/MACHINE:I386"
|
||||||
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib"
|
AdditionalDependencies="odbc32.lib odbccp32.lib ..\jit\jits.lib ..\zlib\zlib.lib"
|
||||||
OutputFile="jitrelease/amxx_mm.dll"
|
OutputFile="jitrelease/amxx_mm.dll"
|
||||||
LinkIncremental="1"
|
LinkIncremental="1"
|
||||||
SuppressStartupBanner="TRUE"
|
SuppressStartupBanner="TRUE"
|
||||||
@ -646,9 +646,6 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\meta_api.cpp">
|
RelativePath="..\meta_api.cpp">
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\minilzo\minilzo.c">
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\modules.cpp">
|
RelativePath="..\modules.cpp">
|
||||||
</File>
|
</File>
|
||||||
|
@ -2478,6 +2478,7 @@ PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
|||||||
PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
|
PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
|
|
||||||
// *** Exports ***
|
// *** Exports ***
|
||||||
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
C_DLLEXPORT int AMXX_Query(int *interfaceVersion, amxx_module_info_s *moduleInfo)
|
||||||
@ -2542,6 +2543,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
|||||||
REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV);
|
REQFUNC("amx_Execv", g_fn_AmxExecv, PFN_AMX_EXECV);
|
||||||
REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC);
|
REQFUNC("amx_FindPublic", g_fn_AmxFindPublic, PFN_AMX_FINDPUBLIC);
|
||||||
REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT);
|
REQFUNC("amx_Allot", g_fn_AmxAllot, PFN_AMX_ALLOT);
|
||||||
|
REQFUNC("amx_FindNative", g_fn_AmxFindNative, PFN_AMX_FINDNATIVE);
|
||||||
|
|
||||||
// Natives / Forwards
|
// Natives / Forwards
|
||||||
REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES);
|
REQFUNC("AddNatives", g_fn_AddNatives, PFN_ADD_NATIVES);
|
||||||
|
@ -1947,6 +1947,7 @@ typedef int (*PFN_AMX_EXEC) (AMX* /*amx*/, cell* /*return val*/, int /*in
|
|||||||
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
typedef int (*PFN_AMX_EXECV) (AMX* /*amx*/, cell* /*return val*/, int /*index*/, int /*numparams*/, cell[] /*params*/);
|
||||||
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
typedef int (*PFN_AMX_ALLOT) (AMX* /*amx*/, int /*length*/, cell* /*amx_addr*/, cell** /*phys_addr*/);
|
||||||
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
typedef int (*PFN_AMX_FINDPUBLIC) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
|
typedef int (*PFN_AMX_FINDNATIVE) (AMX* /*amx*/, char* /*func name*/, int* /*index*/);
|
||||||
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/);
|
typedef int (*PFN_LOAD_AMXSCRIPT) (AMX* /*amx*/, void** /*code*/, const char* /*path*/, char[64] /*error info*/);
|
||||||
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
typedef int (*PFN_UNLOAD_AMXSCRIPT) (AMX* /*amx*/,void** /*code*/);
|
||||||
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
typedef cell (*PFN_REAL_TO_CELL) (REAL /*x*/);
|
||||||
@ -2007,6 +2008,7 @@ extern PFN_REGISTER_SPFORWARD g_fn_RegisterSPForward;
|
|||||||
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
extern PFN_REGISTER_SPFORWARD_BYNAME g_fn_RegisterSPForwardByName;
|
||||||
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
extern PFN_UNREGISTER_SPFORWARD g_fn_UnregisterSPForward;
|
||||||
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
extern PFN_MERGEDEFINITION_FILE g_fn_MergeDefinition_File;
|
||||||
|
extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||||
|
|
||||||
#ifdef MAY_NEVER_BE_DEFINED
|
#ifdef MAY_NEVER_BE_DEFINED
|
||||||
// Function prototypes for intellisense and similar systems
|
// Function prototypes for intellisense and similar systems
|
||||||
@ -2100,8 +2102,10 @@ void MF_Log(const char *fmt, ...);
|
|||||||
#define MF_AmxExecv g_fn_AmxExecv
|
#define MF_AmxExecv g_fn_AmxExecv
|
||||||
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
#define MF_AmxFindPublic g_fn_AmxFindPublic
|
||||||
#define MF_AmxAllot g_fn_AmxAllot
|
#define MF_AmxAllot g_fn_AmxAllot
|
||||||
|
#define MF_AmxFindNative g_fn_AmxFindNative
|
||||||
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
#define MF_LoadAmxScript g_fn_LoadAmxScript
|
||||||
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
#define MF_UnloadAmxScript g_fn_UnloadAmxScript
|
||||||
|
#define MF_MergeDefinitionFile g_fn_MergeDefinition_File
|
||||||
#define amx_ctof g_fn_CellToReal
|
#define amx_ctof g_fn_CellToReal
|
||||||
#define amx_ftoc g_fn_RealToCell
|
#define amx_ftoc g_fn_RealToCell
|
||||||
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
#define MF_RegisterSPForwardByName g_fn_RegisterSPForwardByName
|
||||||
|
323
amxmodx/zlib/zconf.h
Executable file
323
amxmodx/zlib/zconf.h
Executable file
@ -0,0 +1,323 @@
|
|||||||
|
/* zconf.h -- configuration of the zlib compression library
|
||||||
|
* Copyright (C) 1995-2003 Jean-loup Gailly.
|
||||||
|
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* @(#) $Id$ */
|
||||||
|
|
||||||
|
#ifndef ZCONF_H
|
||||||
|
#define ZCONF_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If you *really* need a unique prefix for all types and library functions,
|
||||||
|
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
|
||||||
|
*/
|
||||||
|
#ifdef Z_PREFIX
|
||||||
|
# define deflateInit_ z_deflateInit_
|
||||||
|
# define deflate z_deflate
|
||||||
|
# define deflateEnd z_deflateEnd
|
||||||
|
# define inflateInit_ z_inflateInit_
|
||||||
|
# define inflate z_inflate
|
||||||
|
# define inflateEnd z_inflateEnd
|
||||||
|
# define deflateInit2_ z_deflateInit2_
|
||||||
|
# define deflateSetDictionary z_deflateSetDictionary
|
||||||
|
# define deflateCopy z_deflateCopy
|
||||||
|
# define deflateReset z_deflateReset
|
||||||
|
# define deflatePrime z_deflatePrime
|
||||||
|
# define deflateParams z_deflateParams
|
||||||
|
# define deflateBound z_deflateBound
|
||||||
|
# define inflateInit2_ z_inflateInit2_
|
||||||
|
# define inflateSetDictionary z_inflateSetDictionary
|
||||||
|
# define inflateSync z_inflateSync
|
||||||
|
# define inflateSyncPoint z_inflateSyncPoint
|
||||||
|
# define inflateCopy z_inflateCopy
|
||||||
|
# define inflateReset z_inflateReset
|
||||||
|
# define compress z_compress
|
||||||
|
# define compress2 z_compress2
|
||||||
|
# define compressBound z_compressBound
|
||||||
|
# define uncompress z_uncompress
|
||||||
|
# define adler32 z_adler32
|
||||||
|
# define crc32 z_crc32
|
||||||
|
# define get_crc_table z_get_crc_table
|
||||||
|
|
||||||
|
# define Byte z_Byte
|
||||||
|
# define uInt z_uInt
|
||||||
|
# define uLong z_uLong
|
||||||
|
# define Bytef z_Bytef
|
||||||
|
# define charf z_charf
|
||||||
|
# define intf z_intf
|
||||||
|
# define uIntf z_uIntf
|
||||||
|
# define uLongf z_uLongf
|
||||||
|
# define voidpf z_voidpf
|
||||||
|
# define voidp z_voidp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MSDOS__) && !defined(MSDOS)
|
||||||
|
# define MSDOS
|
||||||
|
#endif
|
||||||
|
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
|
||||||
|
# define OS2
|
||||||
|
#endif
|
||||||
|
#if defined(_WINDOWS) && !defined(WINDOWS)
|
||||||
|
# define WINDOWS
|
||||||
|
#endif
|
||||||
|
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||||
|
# define WIN32
|
||||||
|
#endif
|
||||||
|
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
|
||||||
|
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
|
||||||
|
# ifndef SYS16BIT
|
||||||
|
# define SYS16BIT
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||||
|
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||||
|
*/
|
||||||
|
#ifdef SYS16BIT
|
||||||
|
# define MAXSEG_64K
|
||||||
|
#endif
|
||||||
|
#ifdef MSDOS
|
||||||
|
# define UNALIGNED_OK
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __STDC_VERSION__
|
||||||
|
# ifndef STDC
|
||||||
|
# define STDC
|
||||||
|
# endif
|
||||||
|
# if __STDC_VERSION__ >= 199901L
|
||||||
|
# ifndef STDC99
|
||||||
|
# define STDC99
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||||
|
# define STDC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef STDC
|
||||||
|
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||||
|
# define const /* note: need a more gentle solution here */
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Some Mac compilers merge all .h files incorrectly: */
|
||||||
|
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||||
|
# define NO_DUMMY_DECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Maximum value for memLevel in deflateInit2 */
|
||||||
|
#ifndef MAX_MEM_LEVEL
|
||||||
|
# ifdef MAXSEG_64K
|
||||||
|
# define MAX_MEM_LEVEL 8
|
||||||
|
# else
|
||||||
|
# define MAX_MEM_LEVEL 9
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||||
|
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||||
|
* created by gzip. (Files created by minigzip can still be extracted by
|
||||||
|
* gzip.)
|
||||||
|
*/
|
||||||
|
#ifndef MAX_WBITS
|
||||||
|
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The memory requirements for deflate are (in bytes):
|
||||||
|
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||||
|
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||||
|
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||||
|
the default memory requirements from 256K to 128K, compile with
|
||||||
|
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||||
|
Of course this will generally degrade compression (there's no free lunch).
|
||||||
|
|
||||||
|
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||||
|
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||||
|
for small objects.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Type declarations */
|
||||||
|
|
||||||
|
#ifndef OF /* function prototypes */
|
||||||
|
# ifdef STDC
|
||||||
|
# define OF(args) args
|
||||||
|
# else
|
||||||
|
# define OF(args) ()
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||||
|
* model programming (small or medium model with some far allocations).
|
||||||
|
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||||
|
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||||
|
* just define FAR to be empty.
|
||||||
|
*/
|
||||||
|
#ifdef SYS16BIT
|
||||||
|
# if defined(M_I86SM) || defined(M_I86MM)
|
||||||
|
/* MSC small or medium model */
|
||||||
|
# define SMALL_MEDIUM
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
# define FAR _far
|
||||||
|
# else
|
||||||
|
# define FAR far
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||||
|
/* Turbo C small or medium model */
|
||||||
|
# define SMALL_MEDIUM
|
||||||
|
# ifdef __BORLANDC__
|
||||||
|
# define FAR _far
|
||||||
|
# else
|
||||||
|
# define FAR far
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(WINDOWS) || defined(WIN32)
|
||||||
|
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||||
|
* This is not mandatory, but it offers a little performance increase.
|
||||||
|
*/
|
||||||
|
# ifdef ZLIB_DLL
|
||||||
|
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||||
|
# ifdef ZLIB_INTERNAL
|
||||||
|
# define ZEXTERN extern __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define ZEXTERN extern __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
# endif /* ZLIB_DLL */
|
||||||
|
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||||
|
* define ZLIB_WINAPI.
|
||||||
|
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||||
|
*/
|
||||||
|
# ifdef ZLIB_WINAPI
|
||||||
|
# ifdef FAR
|
||||||
|
# undef FAR
|
||||||
|
# endif
|
||||||
|
# include <windows.h>
|
||||||
|
/* No need for _export, use ZLIB.DEF instead. */
|
||||||
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||||
|
# define ZEXPORT WINAPI
|
||||||
|
# ifdef WIN32
|
||||||
|
# define ZEXPORTVA WINAPIV
|
||||||
|
# else
|
||||||
|
# define ZEXPORTVA FAR CDECL
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (__BEOS__)
|
||||||
|
# ifdef ZLIB_DLL
|
||||||
|
# ifdef ZLIB_INTERNAL
|
||||||
|
# define ZEXPORT __declspec(dllexport)
|
||||||
|
# define ZEXPORTVA __declspec(dllexport)
|
||||||
|
# else
|
||||||
|
# define ZEXPORT __declspec(dllimport)
|
||||||
|
# define ZEXPORTVA __declspec(dllimport)
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ZEXTERN
|
||||||
|
# define ZEXTERN extern
|
||||||
|
#endif
|
||||||
|
#ifndef ZEXPORT
|
||||||
|
# define ZEXPORT
|
||||||
|
#endif
|
||||||
|
#ifndef ZEXPORTVA
|
||||||
|
# define ZEXPORTVA
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef FAR
|
||||||
|
# define FAR
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__MACTYPES__)
|
||||||
|
typedef unsigned char Byte; /* 8 bits */
|
||||||
|
#endif
|
||||||
|
typedef unsigned int uInt; /* 16 bits or more */
|
||||||
|
typedef unsigned long uLong; /* 32 bits or more */
|
||||||
|
|
||||||
|
#ifdef SMALL_MEDIUM
|
||||||
|
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||||
|
# define Bytef Byte FAR
|
||||||
|
#else
|
||||||
|
typedef Byte FAR Bytef;
|
||||||
|
#endif
|
||||||
|
typedef char FAR charf;
|
||||||
|
typedef int FAR intf;
|
||||||
|
typedef uInt FAR uIntf;
|
||||||
|
typedef uLong FAR uLongf;
|
||||||
|
|
||||||
|
#ifdef STDC
|
||||||
|
typedef void const *voidpc;
|
||||||
|
typedef void FAR *voidpf;
|
||||||
|
typedef void *voidp;
|
||||||
|
#else
|
||||||
|
typedef Byte const *voidpc;
|
||||||
|
typedef Byte FAR *voidpf;
|
||||||
|
typedef Byte *voidp;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||||
|
# include <sys/types.h> /* for off_t */
|
||||||
|
# include <unistd.h> /* for SEEK_* and off_t */
|
||||||
|
# ifdef VMS
|
||||||
|
# include <unixio.h> /* for off_t */
|
||||||
|
# endif
|
||||||
|
# define z_off_t off_t
|
||||||
|
#endif
|
||||||
|
#ifndef SEEK_SET
|
||||||
|
# define SEEK_SET 0 /* Seek from beginning of file. */
|
||||||
|
# define SEEK_CUR 1 /* Seek from current position. */
|
||||||
|
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
|
||||||
|
#endif
|
||||||
|
#ifndef z_off_t
|
||||||
|
# define z_off_t long
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__OS400__)
|
||||||
|
#define NO_vsnprintf
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__MVS__)
|
||||||
|
# define NO_vsnprintf
|
||||||
|
# ifdef FAR
|
||||||
|
# undef FAR
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* MVS linker does not support external names larger than 8 bytes */
|
||||||
|
#if defined(__MVS__)
|
||||||
|
# pragma map(deflateInit_,"DEIN")
|
||||||
|
# pragma map(deflateInit2_,"DEIN2")
|
||||||
|
# pragma map(deflateEnd,"DEEND")
|
||||||
|
# pragma map(deflateBound,"DEBND")
|
||||||
|
# pragma map(inflateInit_,"ININ")
|
||||||
|
# pragma map(inflateInit2_,"ININ2")
|
||||||
|
# pragma map(inflateEnd,"INEND")
|
||||||
|
# pragma map(inflateSync,"INSY")
|
||||||
|
# pragma map(inflateSetDictionary,"INSEDI")
|
||||||
|
# pragma map(compressBound,"CMBND")
|
||||||
|
# pragma map(inflate_table,"INTABL")
|
||||||
|
# pragma map(inflate_fast,"INFA")
|
||||||
|
# pragma map(inflate_copyright,"INCOPY")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* ZCONF_H */
|
1200
amxmodx/zlib/zlib.h
Executable file
1200
amxmodx/zlib/zlib.h
Executable file
File diff suppressed because it is too large
Load Diff
BIN
amxmodx/zlib/zlib.lib
Executable file
BIN
amxmodx/zlib/zlib.lib
Executable file
Binary file not shown.
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,5 +172,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -272,6 +272,8 @@ static cell AMX_NATIVE_CALL cwpn_dmg(AMX *amx, cell *params){ // wid,att,vic,dmg
|
|||||||
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
CPlayer* pVic = GET_PLAYER_POINTER_I(vic);
|
||||||
|
|
||||||
pVic->pEdict->v.dmg_inflictor = NULL;
|
pVic->pEdict->v.dmg_inflictor = NULL;
|
||||||
|
|
||||||
|
if ( pAtt->index != pVic->index )
|
||||||
pAtt->saveHit( pVic , weapon , dmg, aim );
|
pAtt->saveHit( pVic , weapon , dmg, aim );
|
||||||
|
|
||||||
if ( !pAtt ) pAtt = pVic;
|
if ( !pAtt ) pAtt = pVic;
|
||||||
@ -337,7 +339,7 @@ static cell AMX_NATIVE_CALL is_custom(AMX *amx, cell *params){
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player,wid
|
||||||
int index = params[2];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
if (index<1||index>gpGlobals->maxClients){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
@ -349,7 +351,7 @@ static cell AMX_NATIVE_CALL dod_get_user_team(AMX *amx, cell *params){ // player
|
|||||||
}
|
}
|
||||||
|
|
||||||
static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params){ // player,wid
|
static cell AMX_NATIVE_CALL get_user_team(AMX *amx, cell *params){ // player,wid
|
||||||
int index = params[2];
|
int index = params[1];
|
||||||
if (index<1||index>gpGlobals->maxClients){
|
if (index<1||index>gpGlobals->maxClients){
|
||||||
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
MF_RaiseAmxError(amx,AMX_ERR_NATIVE);
|
||||||
return 0;
|
return 0;
|
||||||
@ -406,6 +408,9 @@ AMX_NATIVE_INFO base_Natives[] = {
|
|||||||
{ "get_weaponname", get_weapon_name },
|
{ "get_weaponname", get_weapon_name },
|
||||||
{ "get_user_weapon", get_user_weapon },
|
{ "get_user_weapon", get_user_weapon },
|
||||||
{ "dod_get_user_team", dod_get_user_team },
|
{ "dod_get_user_team", dod_get_user_team },
|
||||||
|
{ "dod_get_wpnname", get_weapon_name },
|
||||||
|
{ "dod_get_wpnlogname", get_weapon_logname },
|
||||||
|
{ "dod_is_melee", is_melee },
|
||||||
|
|
||||||
///*******************
|
///*******************
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
|
@ -45,12 +45,12 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
} else {
|
} else {
|
||||||
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
|
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($OPTIONS{"debug"})
|
if ($OPTIONS{"debug"})
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,5 +172,5 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -153,3 +153,4 @@ void UTIL_SetSize(edict_t *pev, const Vector &vecMin, const Vector &vecMax);
|
|||||||
extern AMX_NATIVE_INFO ent_Natives[];
|
extern AMX_NATIVE_INFO ent_Natives[];
|
||||||
|
|
||||||
#endif //_INCLUDE_ENGINE_ENTSTUFF
|
#endif //_INCLUDE_ENGINE_ENTSTUFF
|
||||||
|
|
||||||
|
@ -51,3 +51,4 @@ enum globals {
|
|||||||
extern AMX_NATIVE_INFO global_Natives[];
|
extern AMX_NATIVE_INFO global_Natives[];
|
||||||
|
|
||||||
#endif //_INCLUDE_ENGINE_GLOBAL
|
#endif //_INCLUDE_ENGINE_GLOBAL
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ static cell AMX_NATIVE_CALL register_message(AMX *amx, cell *params)
|
|||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
if (params[1]>0 && params[1] < 256) {
|
if (params[1]>0 && params[1] < 256) {
|
||||||
int id = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
int id = MF_RegisterSPForwardByName(amx, MF_GetAmxString(amx, params[2], 0, &len), FP_CELL, FP_CELL, FP_CELL, FP_CELL, FP_DONE);
|
||||||
// MF_Log("Registering message %d with result %d", params[1], id);
|
// MF_Log("Registering message %d with result %d", params[1], id);
|
||||||
msgHooks[params[1]] = id;
|
msgHooks[params[1]] = id;
|
||||||
return id;
|
return id;
|
||||||
|
@ -46,3 +46,4 @@ extern int msgHooks[256];
|
|||||||
extern int msgBlocks[256];
|
extern int msgBlocks[256];
|
||||||
|
|
||||||
#endif //_MSGS_INCLUDE_H
|
#endif //_MSGS_INCLUDE_H
|
||||||
|
|
||||||
|
@ -460,3 +460,4 @@
|
|||||||
#endif // USE_METAMOD
|
#endif // USE_METAMOD
|
||||||
|
|
||||||
#endif // __MODULECONFIG_H__
|
#endif // __MODULECONFIG_H__
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -139,7 +139,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -177,6 +177,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -46,7 +46,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,7 +135,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -173,6 +173,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -46,7 +46,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -135,7 +135,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -173,6 +173,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags $inc -shared -ldl -lm @LINK -lpq -lz -lcrypt -o $outdir/$bin";
|
$gcc = "gcc $cflags $inc -shared -ldl -lm @LINK -lpq -lz -lcrypt -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
@ -45,7 +45,7 @@ while ($cmd = shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = `g++ --version`;
|
$gcc = `gcc --version`;
|
||||||
if ($gcc =~ /2\.9/)
|
if ($gcc =~ /2\.9/)
|
||||||
{
|
{
|
||||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||||
@ -134,7 +134,7 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
$ofile = $file;
|
$ofile = $file;
|
||||||
$ofile =~ s/\.cpp/\.o/;
|
$ofile =~ s/\.cpp/\.o/;
|
||||||
$ofile = "$outdir/$ofile";
|
$ofile = "$outdir/$ofile";
|
||||||
$gcc = "g++ $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
$gcc = "gcc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||||
if (-e $ofile)
|
if (-e $ofile)
|
||||||
{
|
{
|
||||||
$file_time = (stat($file))[9];
|
$file_time = (stat($file))[9];
|
||||||
@ -172,6 +172,6 @@ for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$gcc = "g++ $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
$gcc = "gcc $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||||
print "$gcc\n";
|
print "$gcc\n";
|
||||||
`$gcc`;
|
`$gcc`;
|
||||||
|
BIN
plugins/amxxsc
BIN
plugins/amxxsc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -12,7 +12,7 @@
|
|||||||
#define _amxconst_included
|
#define _amxconst_included
|
||||||
|
|
||||||
#define AMXX_VERSION 0.2
|
#define AMXX_VERSION 0.2
|
||||||
#define AMXX_VERSION_STR "0.20"
|
stock const AMXX_VERSION_STR[]="0.20"
|
||||||
|
|
||||||
#define ADMIN_ALL 0 /* everyone */
|
#define ADMIN_ALL 0 /* everyone */
|
||||||
#define ADMIN_IMMUNITY (1<<0) /* flag "a" */
|
#define ADMIN_IMMUNITY (1<<0) /* flag "a" */
|
||||||
|
@ -140,7 +140,7 @@ native call_think(entity)
|
|||||||
|
|
||||||
/* Mirrors CBaseEntity->TakeDamage() - Forces an entity to take damage.
|
/* Mirrors CBaseEntity->TakeDamage() - Forces an entity to take damage.
|
||||||
Potential for crash. If you have problems with this, I suggest using fakedamage(). */
|
Potential for crash. If you have problems with this, I suggest using fakedamage(). */
|
||||||
native takedamage(idVictim,idInflictor,idAttacker,Float:takedmgdamage,damagetype);
|
native take_damage(idVictim,idInflictor,idAttacker,Float:takedmgdamage,damagetype);
|
||||||
|
|
||||||
/* Is entity valid? */
|
/* Is entity valid? */
|
||||||
native is_valid_ent(iIndex);
|
native is_valid_ent(iIndex);
|
||||||
@ -173,13 +173,13 @@ native copy_keyvalue(szClassName[],sizea,szKeyName[],sizeb,szValue[],sizec);
|
|||||||
native DispatchSpawn(iIndex);
|
native DispatchSpawn(iIndex);
|
||||||
|
|
||||||
/* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */
|
/* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */
|
||||||
native RadiusDamage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier);
|
native radius_damage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier);
|
||||||
|
|
||||||
/* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */
|
/* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */
|
||||||
native VelocityByAim(iIndex, iVelocity, Float:vRetValue[3]);
|
native velocity_by_aim(iIndex, iVelocity, Float:vRetValue[3]);
|
||||||
|
|
||||||
/* Will return the contents of a point (inside map? in sky? outside map? etc.). */
|
/* Will return the contents of a point (inside map? in sky? outside map? etc.). */
|
||||||
native PointContents(Float:fCheckAt[3]);
|
native point_contents(Float:fCheckAt[3]);
|
||||||
|
|
||||||
/* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3]
|
/* Trace a line from Start(X, Y, Z) to End(X, Y, Z), will return the point hit in vReturn[3]
|
||||||
* and an entity index if an entity is hit. */
|
* and an entity index if an entity is hit. */
|
||||||
@ -273,4 +273,21 @@ forward pfn_use(user, used);
|
|||||||
*/
|
*/
|
||||||
native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0});
|
native find_sphere_class(aroundent, _lookforclassname[], Float:radius, entlist[], maxents, Float:origin[3] = {0.0, 0.0, 0.0});
|
||||||
|
|
||||||
|
/* Backwards compatible */
|
||||||
|
/* Hurts/Kills players in a sphere, like an explosion, Multiplier determines damage. */
|
||||||
|
stock RadiusDamage(Float:fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier) {
|
||||||
|
return radius_damage(fExplodeAt[3], iDamageMultiplier, iRadiusMultiplier)
|
||||||
|
}
|
||||||
|
/* Gives you a velocity in the direction a player is looking, iVelocity is the multiplier. */
|
||||||
|
stock VelocityByAim(iIndex,iVelocity, Float:vRetValue[3]) {
|
||||||
|
return velocity_by_aim(iIndex,iVelocity,vRetValue)
|
||||||
|
}
|
||||||
|
/* Will return the contents of a point (inside map? in sky? outside map? etc.). */
|
||||||
|
stock PointContents(Float:fCheckAt[3]) {
|
||||||
|
return point_contents(fCheckAt[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
stock set_size(index, Float:mins[3], Float:maxs[3]) {
|
||||||
|
return entity_set_size(index,mins,maxs)
|
||||||
|
}
|
||||||
#include <engine_stocks>
|
#include <engine_stocks>
|
@ -18,7 +18,7 @@ stock is_entity(id)
|
|||||||
return is_valid_ent(id)
|
return is_valid_ent(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
stock get_build(classname[], value, number=0, NS_Version=NS_VERSION)
|
stock get_build(classname[], value, number=0, NS_Version)
|
||||||
{
|
{
|
||||||
return ns_get_build(classname, value, number, NS_Version)
|
return ns_get_build(classname, value, number, NS_Version)
|
||||||
}
|
}
|
||||||
@ -185,9 +185,9 @@ stock get_filename(szFile[], len=-1)
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
stock get_speedchange(id)
|
stock get_speedchange(id, speed)
|
||||||
{
|
{
|
||||||
return ns_get_speedchange(id)
|
return ns_get_speedchange(id, speed)
|
||||||
}
|
}
|
||||||
|
|
||||||
stock set_speedchange(id, speed)
|
stock set_speedchange(id, speed)
|
||||||
@ -311,6 +311,7 @@ stock get_res(id)
|
|||||||
stock get_class(id)
|
stock get_class(id)
|
||||||
{
|
{
|
||||||
return ns_get_class(id)
|
return ns_get_class(id)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -518,7 +518,7 @@ displayTeamMenu(id,pos) {
|
|||||||
}
|
}
|
||||||
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
else format(menuBody[len],511-len,"^n0. %L", id, pos ? "BACK" : "EXIT")
|
||||||
|
|
||||||
show_menu(id,keys,menuBody,-1,"TEAM_MENU")
|
show_menu(id,keys,menuBody,-1,"Team Menu")
|
||||||
}
|
}
|
||||||
|
|
||||||
public cmdTeamMenu(id,level,cid) {
|
public cmdTeamMenu(id,level,cid) {
|
||||||
|
Reference in New Issue
Block a user