Massive reorganization attempt - part 2
Moved old/defunct/unofficial modules out of trunk
This commit is contained in:
parent
54186736c8
commit
ab53914351
File diff suppressed because it is too large
Load Diff
2239
dlls/BB/amxxmodule.h
2239
dlls/BB/amxxmodule.h
File diff suppressed because it is too large
Load Diff
144
dlls/BB/bb.cpp
144
dlls/BB/bb.cpp
|
@ -1,144 +0,0 @@
|
|||
#include "bb.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_exp(AMX *amx,cell *params)
|
||||
{
|
||||
return amx_ftoc(GetUserExp(params[1]));
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_exp(AMX *amx,cell *params)
|
||||
{
|
||||
float Exp = amx_ctof(params[2]);
|
||||
SetUserExp(params[1], Exp );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_points(AMX *amx,cell *params)
|
||||
{
|
||||
return amx_ftoc(GetUserPoints(params[1]));
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_points(AMX *amx,cell *params)
|
||||
{
|
||||
float Exp = amx_ctof(params[2]);
|
||||
SetUserPoints(params[1], Exp );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_level(AMX *amx,cell *params)
|
||||
{
|
||||
return GetUserLevel(params[1]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_level(AMX *amx,cell *params)
|
||||
{
|
||||
if(GetUserLevel(params[1]) > params[2])
|
||||
{
|
||||
MF_LogError(amx,AMX_ERR_NATIVE,"Must set to a level higher than current one!");
|
||||
return 0;
|
||||
}
|
||||
SetUserLevel(params[1], params[2] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_speed(AMX *amx,cell *params)
|
||||
{
|
||||
return GetUserSpeed(params[1]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_speed(AMX *amx,cell *params)
|
||||
{
|
||||
SetUserSpeed(params[1], params[2] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_hitpoints(AMX *amx,cell *params)
|
||||
{
|
||||
return GetUserHitPoints(params[1]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_hitpoints(AMX *amx,cell *params)
|
||||
{
|
||||
SetUserHitPoints(params[1], params[2] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_user_skill(AMX *amx,cell *params)
|
||||
{
|
||||
return GetUserSkill(params[1]);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL set_user_skill(AMX *amx,cell *params)
|
||||
{
|
||||
SetUserSkill(params[1], params[2] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL send_progress_bar(AMX *amx,cell *params)
|
||||
{
|
||||
int len = 0;
|
||||
float time = amx_ctof(params[3]);
|
||||
SendProgressBar(params[1], MF_GetAmxString( amx, params[2], 0, &len ), time );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL send_show_objective(AMX *amx,cell *params)
|
||||
{
|
||||
int len = 0;
|
||||
SendShowObjective(params[1], MF_GetAmxString( amx, params[2], 0, &len ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL send_show_message(AMX *amx,cell *params)
|
||||
{
|
||||
int len = 0;
|
||||
float time = amx_ctof(params[2]);
|
||||
SendShowMessage(params[1], time, MF_GetAmxString( amx, params[2], 0, &len ), MF_GetAmxString( amx, params[3], 0, &len ) );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL reset_user_hud(AMX *amx,cell *params)
|
||||
{
|
||||
UpdateBBHud( params[1] );
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL is_user_zombie(AMX *amx,cell *params)
|
||||
{
|
||||
return IsUserZombie(params[1]);
|
||||
}
|
||||
|
||||
|
||||
AMX_NATIVE_INFO bb_Exports[] =
|
||||
{
|
||||
{"bb_is_user_zombie",is_user_zombie},
|
||||
{"bb_reset_user_hud", reset_user_hud},
|
||||
|
||||
{"bb_show_message",send_show_message},
|
||||
{"bb_show_objective", send_show_objective},
|
||||
{"bb_show_progress_bar", send_progress_bar},
|
||||
|
||||
{"bb_get_user_skill",get_user_skill},
|
||||
{"bb_set_user_skill", set_user_skill},
|
||||
|
||||
{"bb_get_user_hitpoints",get_user_hitpoints},
|
||||
{"bb_set_user_hitpoints", set_user_hitpoints},
|
||||
|
||||
{"bb_get_user_speed",get_user_speed},
|
||||
{"bb_set_user_speed", set_user_speed},
|
||||
|
||||
{"bb_get_user_exp",get_user_exp},
|
||||
{"bb_set_user_exp", set_user_exp},
|
||||
|
||||
{"bb_get_user_points",get_user_points},
|
||||
{"bb_set_user_points", set_user_points},
|
||||
|
||||
{"bb_get_user_level",get_user_level},
|
||||
{"bb_set_user_level", set_user_level},
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
MF_AddNatives(bb_Exports);
|
||||
}
|
115
dlls/BB/bb.h
115
dlls/BB/bb.h
|
@ -1,115 +0,0 @@
|
|||
// prevent double include
|
||||
#ifndef __BB_H__
|
||||
#define __BB_H__
|
||||
|
||||
#include "pdata.h"
|
||||
#include "bb_const.h"
|
||||
|
||||
void UpdateBBHud( long& target);
|
||||
|
||||
inline float GetUserExp( long& target)
|
||||
{ return GetPData(target, BB_PDATA_EXP, 100.0); }
|
||||
|
||||
inline void SetUserExp( long& target, float& exp)
|
||||
{ SetPData(target, BB_PDATA_EXP, exp); }
|
||||
|
||||
inline float GetUserPoints( long& target)
|
||||
{ return GetPData(target, BB_PDATA_POINT, 100.0); }
|
||||
|
||||
inline void SetUserPoints( long& target, float& points)
|
||||
{SetPData(target, BB_PDATA_POINT, points, true);}
|
||||
|
||||
inline long GetUserLevel(long& target)
|
||||
{ return GetPData(target,BB_PDATA_LEVEL,100); }
|
||||
|
||||
inline void SetUserLevel(long& target, long& level)
|
||||
{
|
||||
long i;
|
||||
float totalxp = 0.0;
|
||||
|
||||
for(i=1;i<=level;i++) {
|
||||
totalxp += 150.0 + ((i-1) * 300.0);
|
||||
}
|
||||
|
||||
SetUserExp( target, totalxp );
|
||||
|
||||
MESSAGE_BEGIN(MSG_ONE,120, NULL, MF_GetPlayerEdict( target) );
|
||||
WRITE_COORD(0);
|
||||
WRITE_BYTE(level);
|
||||
WRITE_BYTE( GetUserPoints(target) );
|
||||
MESSAGE_END();
|
||||
|
||||
MESSAGE_BEGIN(MSG_ALL,81, NULL, MF_GetPlayerEdict( target ));
|
||||
WRITE_BYTE( target );
|
||||
WRITE_SHORT( MF_GetPlayerFrags( target ) );
|
||||
WRITE_SHORT( MF_GetPlayerDeaths( target ) );
|
||||
WRITE_BYTE(level);
|
||||
MESSAGE_END();
|
||||
|
||||
SetPData(target,BB_PDATA_LEVEL,level);
|
||||
SetPData(target,BB_PDATA_LEVEL - 1,level);
|
||||
|
||||
}
|
||||
|
||||
inline long GetUserSpeed(long& target)
|
||||
{ return GetPData(target,BB_PDATA_SPEED,100); }
|
||||
|
||||
inline void SetUserSpeed(long& target, long& speed)
|
||||
{ SetPData(target,BB_PDATA_SPEED,speed, true);}
|
||||
|
||||
inline long GetUserHitPoints(long& target)
|
||||
{ return GetPData(target,BB_PDATA_HITPOINTS,100); }
|
||||
|
||||
inline void SetUserHitPoints(long& target, long& hitpoints)
|
||||
{ SetPData(target,BB_PDATA_HITPOINTS,hitpoints, true); }
|
||||
|
||||
inline long GetUserSkill(long& target)
|
||||
{ return GetPData(target,BB_PDATA_SKILL,100); }
|
||||
|
||||
inline void SetUserSkill(long& target, long& skill )
|
||||
{ SetPData(target,BB_PDATA_SKILL,skill,true); }
|
||||
|
||||
inline bool IsUserZombie(long& target)
|
||||
{
|
||||
return ( (MF_GetPlayerEdict( target ))->v.team == 2);
|
||||
}
|
||||
|
||||
inline void SendProgressBar( long& target, char* message, float& time)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, 122, NULL, MF_GetPlayerEdict( target));
|
||||
WRITE_STRING(message);
|
||||
WRITE_COORD(time);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
inline void SendShowObjective( long& target, char* message)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, 122, NULL, MF_GetPlayerEdict( target));
|
||||
WRITE_COORD(-1);
|
||||
WRITE_BYTE(144);
|
||||
WRITE_STRING(message);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
inline void SendShowMessage( long& target, float& duration, char* message, char* message2)
|
||||
{
|
||||
MESSAGE_BEGIN(MSG_ONE, 122, NULL, MF_GetPlayerEdict( target));
|
||||
WRITE_COORD(duration);
|
||||
WRITE_BYTE(32);
|
||||
WRITE_STRING(message);
|
||||
WRITE_STRING(message2);
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
void UpdateBBHud( long& target)
|
||||
{
|
||||
MESSAGE_BEGIN( MSG_ONE, 113, NULL, MF_GetPlayerEdict( target) );
|
||||
WRITE_BYTE( GetUserHitPoints(target) );
|
||||
WRITE_BYTE( GetUserSpeed(target) );
|
||||
WRITE_BYTE( GetUserSkill(target) );
|
||||
WRITE_BYTE( GetUserPoints(target) );
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/* BrainBread Fun Module
|
||||
*
|
||||
* (c) 2005, XxAvalanchexX (converted to module by Rukia)
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _brainbread_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _brainbread_included
|
||||
|
||||
#pragma library BBFUN
|
||||
|
||||
#include <bb_const>
|
||||
#include <bb_stocks>
|
||||
|
||||
native bb_is_user_zombie(id)
|
||||
native bb_reset_user_hud(id)
|
||||
|
||||
native bb_show_message(id,Float:time = -1,message[],message2[] = "")
|
||||
native bb_show_objective(id,message[] = "")
|
||||
native bb_show_progress_bar(id,message[],time = 10)
|
||||
|
||||
native bb_get_user_skill(id)
|
||||
native bb_set_user_skill(id,skill)
|
||||
stock bb_add_user_skill(id,skill) bb_set_user_skill(id,bb_get_user_skill(id) + skill)
|
||||
|
||||
native Float:bb_get_user_exp(id)
|
||||
native bb_set_user_exp(id,Float:exp)
|
||||
stock bb_add_user_exp(id,Float:exp) bb_set_user_exp(id,bb_get_user_exp(id) + exp)
|
||||
|
||||
native Float:bb_get_user_points(id)
|
||||
native bb_set_user_points(id,Float:points)
|
||||
stock bb_add_user_points(id,Float:points) bb_set_user_ponts(id,bb_get_user_points(id) + points)
|
||||
|
||||
native bb_get_user_level(id)
|
||||
native bb_set_user_level(id,level)
|
||||
stock bb_add_user_level(id,level) bb_set_user_level(id,bb_get_user_level(id) + level)
|
||||
|
||||
native bb_get_user_speed(id)
|
||||
native bb_set_user_speed(id,speed)
|
||||
stock bb_add_user_speed(id,speed) bb_set_user_speed(id,bb_get_user_speed(id) + speed)
|
||||
|
||||
native bb_get_user_hitpoints(id)
|
||||
native bb_set_user_hitpoints(id,hitpoints)
|
||||
stock bb_add_user_hitpoints(id,hitpoints) bb_set_user_hitpoints(id,bb_get_user_hitpoints(id) + hitpoints)
|
BIN
dlls/BB/bb.ncb
BIN
dlls/BB/bb.ncb
Binary file not shown.
|
@ -1,21 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 8.00
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bb", "bb.vcproj", "{29798873-02F2-4075-AFE7-58CE8F9B5124}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
Release = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfiguration) = postSolution
|
||||
{29798873-02F2-4075-AFE7-58CE8F9B5124}.Debug.ActiveCfg = Debug|Win32
|
||||
{29798873-02F2-4075-AFE7-58CE8F9B5124}.Debug.Build.0 = Debug|Win32
|
||||
{29798873-02F2-4075-AFE7-58CE8F9B5124}.Release.ActiveCfg = Release|Win32
|
||||
{29798873-02F2-4075-AFE7-58CE8F9B5124}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityAddIns) = postSolution
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,180 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="bb"
|
||||
ProjectGUID="{29798873-02F2-4075-AFE7-58CE8F9B5124}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;bb_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/bb.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/bb_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\Release/bb.pdb"
|
||||
ImportLibrary=".\Release/bb.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/bb.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1053"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;bb_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/bb.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="Debug/bb_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/bb_debug.pdb"
|
||||
ImportLibrary=".\Debug/bb_debug.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/bb.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1053"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\bb.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\bb.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\bb_const.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\moduleconfig.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\pdata.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,12 +0,0 @@
|
|||
// prevent double include
|
||||
#ifndef __BB_CONST__
|
||||
#define __BB_CONST__
|
||||
|
||||
#define BB_PDATA_LEVEL 505
|
||||
#define BB_PDATA_EXP 4
|
||||
#define BB_PDATA_POINT 432
|
||||
#define BB_PDATA_SPEED 501
|
||||
#define BB_PDATA_HITPOINTS 502
|
||||
#define BB_PDATA_SKILL 503
|
||||
|
||||
#endif
|
|
@ -1,26 +0,0 @@
|
|||
/* BrainBread Fun Module Constants
|
||||
*
|
||||
* (c) 2005, XxAvalanchexX (converted to module by Rukia)
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _brainbread_const_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _brainbread_const_included
|
||||
|
||||
|
||||
#define SPRAY_BSPRITZ 1
|
||||
#define SPRAY_BGUSH 2
|
||||
#define SPRAY_SMOKEPUFF 4
|
||||
#define SPRAY_EXPLOSION 5
|
||||
|
||||
#define DOT_GREEN 1
|
||||
#define DOT_RED 2
|
||||
#define DOT_WHITE 3
|
||||
#define DOT_LTBLUE 4
|
||||
#define DOT_BLUE 5
|
||||
#define DOT_ORANGE 6
|
||||
#define DOT_FLYELLOW 7
|
||||
#define DOT_FLGREEN 8
|
|
@ -1,112 +0,0 @@
|
|||
/* BrainBread Fun Module Stocks
|
||||
*
|
||||
* (c) 2005, XxAvalanchexX (converted to module by Rukia)
|
||||
*
|
||||
* This file is provided as is (no warranties).
|
||||
*/
|
||||
|
||||
#if defined _brainbread_stocks_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _brainbread_stocks_included
|
||||
|
||||
/* Used to create a spray */
|
||||
stock bb_spray(type,origin[3]) {
|
||||
|
||||
/* type: type of spray, see below */
|
||||
/* origin: origin of where spray comes from */
|
||||
|
||||
/* TYPES:
|
||||
SPRAY_BSPRITZ (1) = Blood spritz
|
||||
SPRAY_BGUSH (2) = Blood gush
|
||||
SPRAY_SMOKEPUFF (4) = Smoke puffs
|
||||
SPRAY_EXPLOSION (5) = Firey explosion */
|
||||
|
||||
message_begin(MSG_PVS,118,origin,0);
|
||||
write_byte(type);
|
||||
write_coord(origin[0]);
|
||||
write_coord(origin[1]);
|
||||
write_coord(origin[2]);
|
||||
write_coord(random_num(-1,1));
|
||||
write_coord(random_num(-1,1));
|
||||
write_coord(random_num(-1,1));
|
||||
write_coord(random_num(-1,1));
|
||||
write_coord(random_num(-1,1));
|
||||
write_coord(random_num(-1,1));
|
||||
message_end();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Used to create a spray, with more parameters */
|
||||
stock bb_spray_adv(type,origin[3],size[3],dir[3]) {
|
||||
|
||||
/* type: type of spray, see below */
|
||||
/* origin: origin of where spray comes from */
|
||||
/* size: size of spray, in XYZ format (I think), use a small number like -1 to 1 */
|
||||
/* dir: direction of spray, in XYZ format (I think), use a small number like -1 to 1 */
|
||||
|
||||
/* TYPES:
|
||||
SPRAY_BSPRITZ (1) = Blood spritz
|
||||
SPRAY_BGUSH (2) = Blood gush
|
||||
SPRAY_SMOKEPUFF (4) = Smoke puffs
|
||||
SPRAY_EXPLOSION (5) = Firey explosion */
|
||||
|
||||
message_begin(MSG_PVS,118,origin,0);
|
||||
write_byte(type);
|
||||
write_coord(origin[0]);
|
||||
write_coord(origin[1]);
|
||||
write_coord(origin[2]);
|
||||
write_coord(size[0]);
|
||||
write_coord(size[1]);
|
||||
write_coord(size[2]);
|
||||
write_coord(dir[0]);
|
||||
write_coord(dir[1]);
|
||||
write_coord(dir[2]);
|
||||
message_end();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Used to set dots on the radar */
|
||||
stock bb_radar(id,dot_id,dot_origin[3],dot_status,dot_type) {
|
||||
|
||||
/* dot_id: unique ID for this dot, use same ID to modify the same dot */
|
||||
/* dot_origin: the origin of where to place this dot */
|
||||
/* dot_status: 0 to remove the dot, 1 to add or modify the dot */
|
||||
/* dot_type: the type of dot, see below */
|
||||
|
||||
/* dot_origin and dot_type need not be set accurately when removing the dot */
|
||||
|
||||
/* TYPES:
|
||||
DOT_GREEN (1) = Green Dot, used to mark teammates
|
||||
DOT_RED (2) = Red Dot, used to mark enemies for zombies
|
||||
DOT_WHITE (3) = White Dot, used to mark mission zones
|
||||
DOT_LTBLUE (4) = Light Blue Dot, not used for BrainBread
|
||||
DOT_BLUE (5) = Blue Dot, used to mark the BlackHawk
|
||||
DOT_ORANGE (6) = Orange Dot, not used for BrainBread
|
||||
DOT_FLYELLOW (7) = Flashing Yellow Dot, used to mark the Case or Fred
|
||||
DOT_FLGREEN (8) = Flashing Green Dot, not used for BrainBread,
|
||||
it stops flashing and turns to white after 3 seconds */
|
||||
|
||||
message_begin(MSG_ONE,93,{0,0,0},id);
|
||||
write_short(dot_id);
|
||||
write_byte(1);
|
||||
write_coord(dot_origin[0]);
|
||||
write_coord(dot_origin[1]);
|
||||
write_coord(dot_origin[2]);
|
||||
write_byte(1);
|
||||
message_end();
|
||||
|
||||
message_begin(MSG_ONE,93,{0,0,0},id);
|
||||
write_short(dot_id);
|
||||
write_byte((dot_status > 0) ? 2 : 0);
|
||||
|
||||
if(dot_status > 0) {
|
||||
write_byte(dot_type);
|
||||
}
|
||||
|
||||
message_end();
|
||||
|
||||
return 1;
|
||||
}
|
|
@ -1,462 +0,0 @@
|
|||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "BBFUN"
|
||||
#define MODULE_VERSION "1.65"
|
||||
#define MODULE_AUTHOR "Avalanche"
|
||||
#define MODULE_URL "www.rcrclansite.com"
|
||||
#define MODULE_LOGTAG "BB"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Today"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX detach
|
||||
// #define FN_AMXX_DETACH OnAmxxDetach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
|
@ -1,40 +0,0 @@
|
|||
// prevent double include
|
||||
#ifndef __PDATA_H__
|
||||
#define __PDATA_H__
|
||||
|
||||
#include <extdll.h>
|
||||
#include "amxxmodule.h"
|
||||
|
||||
#if defined __linux__
|
||||
#define EXTRAOFFSET 5 // offsets 5 higher in Linux builds
|
||||
#else
|
||||
#define EXTRAOFFSET 0 // no change in Windows builds
|
||||
#endif // defined __linux__
|
||||
|
||||
inline edict_t* MF_GetEntityEdict( long& EntID )
|
||||
{
|
||||
if( (EntID > 0) && (EntID <= (gpGlobals->maxClients) ) )
|
||||
return MF_GetPlayerEdict( EntID );
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
template <typename ValueType>
|
||||
inline void SetPData( long& targetid, long offset, ValueType value, bool reset = false )
|
||||
{
|
||||
edict_t* target = MF_GetEntityEdict( targetid );
|
||||
if(target == NULL) return;
|
||||
|
||||
*((ValueType *)target->pvPrivateData + offset + EXTRAOFFSET) = value;
|
||||
if(reset) UpdateBBHud( targetid );
|
||||
};
|
||||
|
||||
template <typename ValueType>
|
||||
inline ValueType GetPData( long& targetid, long offset, ValueType value )
|
||||
{
|
||||
edict_t* target = MF_GetEntityEdict( targetid );
|
||||
if(target == NULL) return NULL;
|
||||
return *((ValueType *)target->pvPrivateData + offset + EXTRAOFFSET);
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,48 +0,0 @@
|
|||
#ifndef __MEMCONST_H__
|
||||
#define __MEMCONST_H__
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// Define memory address type
|
||||
#ifdef __amd64__
|
||||
typedef uint64_t maddress;
|
||||
#else
|
||||
typedef uint32_t maddress;
|
||||
#endif
|
||||
|
||||
// Number of bytes for different data types
|
||||
#define BYTE_BYTES 1
|
||||
#define WORD_BYTES 2
|
||||
#define DWORD_BYTES 4
|
||||
#define QWORD_BYTES 8
|
||||
#define FLOAT_BYTES 4
|
||||
|
||||
// Return codes for MemoryProtect
|
||||
#define MP_FAIL -1
|
||||
#define MP_OK 0
|
||||
|
||||
// Memory protection constants
|
||||
#ifdef __linux__
|
||||
#define MPROT_CODE PROT_READ|PROT_EXEC
|
||||
#define MPROT_DATA PROT_READ|PROT_WRITE
|
||||
#define MPROT_RODATA PROT_READ
|
||||
#define MPROT_CODE_EDIT PROT_READ|PROT_WRITE|PROT_EXEC
|
||||
#define MPROT_RODATA_EDIT PROT_READ|PROT_WRITE
|
||||
#else
|
||||
#define MPROT_CODE PAGE_EXECUTE_READ
|
||||
#define MPROT_DATA PAGE_READWRITE
|
||||
#define MPROT_RODATA PAGE_READONLY
|
||||
#define MPROT_CODE_EDIT PAGE_EXECUTE_READWRITE
|
||||
#define MPROT_RODATA_EDIT PAGE_READWRITE
|
||||
#endif
|
||||
|
||||
// Memory area types
|
||||
#define MEMTYPE_CODE 0 // Code (usually .text segment, requires mprotect or VirtualProtect)
|
||||
#define MEMTYPE_DATA 1 // Data (usually .data segment, writable by default)
|
||||
#define MEMTYPE_RODATA 2 // Read-Only Data (usually .rodata on Linux, .rdata on Windows)
|
||||
|
||||
#endif // #ifndef __MEMHACK_H__
|
|
@ -1,16 +0,0 @@
|
|||
#include "MemMisc.h"
|
||||
|
||||
extern AMX_NATIVE_INFO read_natives[];
|
||||
extern AMX_NATIVE_INFO write_natives[];
|
||||
extern AMX_NATIVE_INFO misc_natives[];
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
// Get Base Addresses for dll and engine; exit if unavailable.
|
||||
if(GetBaseAddresses() == false) return MF_LogError(NULL,AMX_ERR_MEMACCESS,"Unable to get base address of game or mod .dll!");
|
||||
|
||||
// Add natives if base is found.
|
||||
MF_AddNatives(read_natives);
|
||||
MF_AddNatives(write_natives);
|
||||
MF_AddNatives(misc_natives);
|
||||
}
|
Binary file not shown.
|
@ -1,19 +0,0 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual C++ Express 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "memhack", "MemHack.vcproj", "{B0190B77-FE9B-495F-8D7E-74D458EBE635}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B0190B77-FE9B-495F-8D7E-74D458EBE635}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B0190B77-FE9B-495F-8D7E-74D458EBE635}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B0190B77-FE9B-495F-8D7E-74D458EBE635}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B0190B77-FE9B-495F-8D7E-74D458EBE635}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,254 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="memhack"
|
||||
ProjectGUID="{B0190B77-FE9B-495F-8D7E-74D458EBE635}"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Program Files\Steam\hlsdk\Multiplayer Source\metamod\metamod-1.17.3\metamod";"C:\Program Files\Steam\hlsdk\Multiplayer Source\common";"C:\Program Files\Steam\hlsdk\Multiplayer Source\engine";"C:\Program Files\Steam\hlsdk\Multiplayer Source\dlls";"C:\Program Files\Steam\hlsdk\Multiplayer Source\pm_shared""
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MEMHACK_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/memhack_amxx.dll"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/memhack.pdb"
|
||||
SubSystem="2"
|
||||
ImportLibrary="$(OutDir)/memhack.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""C:\Program Files\Steam\hlsdk\Multiplayer Source\metamod\metamod-1.17.3\metamod";"C:\Program Files\Steam\hlsdk\Multiplayer Source\common";"C:\Program Files\Steam\hlsdk\Multiplayer Source\engine";"C:\Program Files\Steam\hlsdk\Multiplayer Source\dlls";"C:\Program Files\Steam\hlsdk\Multiplayer Source\pm_shared""
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MEMHACK_EXPORTS"
|
||||
RuntimeLibrary="0"
|
||||
StructMemberAlignment="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/memhack_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="false"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
OptimizeForWindows98="1"
|
||||
ImportLibrary="$(OutDir)/memhack.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\amxxmodule.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemHack.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemMisc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemMiscNatives.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemRead.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemReadNatives.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemWrite.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemWriteNatives.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemConst.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemMisc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemRead.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\MemWrite.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\moduleconfig.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,111 +0,0 @@
|
|||
#include "MemConst.h"
|
||||
|
||||
// Game memory addresses
|
||||
maddress gameDllAddress = NULL;
|
||||
maddress gameEngAddress = NULL;
|
||||
|
||||
bool GetBaseAddress(void *pAddr, maddress &pBaseAddr/*, size_t *memLength*/)
|
||||
{
|
||||
#ifdef WIN32
|
||||
MEMORY_BASIC_INFORMATION mem;
|
||||
if (!VirtualQuery(pAddr, &mem, sizeof(mem)))
|
||||
return false;
|
||||
|
||||
pBaseAddr = (maddress)mem.AllocationBase;
|
||||
|
||||
IMAGE_DOS_HEADER *dos = (IMAGE_DOS_HEADER *)(mem.AllocationBase);
|
||||
IMAGE_NT_HEADERS *pe = reinterpret_cast<IMAGE_NT_HEADERS*>( (unsigned long)dos + (unsigned long)dos->e_lfanew );
|
||||
if (pe->Signature != IMAGE_NT_SIGNATURE)
|
||||
return false;
|
||||
|
||||
//if (memLength)
|
||||
//*memLength = (size_t)(pe->OptionalHeader.SizeOfImage);
|
||||
return true;
|
||||
#else
|
||||
Dl_info info;
|
||||
struct stat buf;
|
||||
|
||||
if (!dladdr(pAddr, &info))
|
||||
return false;
|
||||
|
||||
if (!info.dli_fbase || !info.dli_fname)
|
||||
return false;
|
||||
|
||||
if (stat(info.dli_fname, &buf) != 0)
|
||||
return false;
|
||||
|
||||
if (pBaseAddr)
|
||||
*pBaseAddr = (unsigned char *)info.dli_fbase;
|
||||
//if (memLength)
|
||||
//*memLength = buf.st_size;
|
||||
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Wrapper for mprotect and VirtualProtect */
|
||||
int MemoryProtect(void *addr, size_t len, unsigned long newProt, unsigned long *oldProt, char memType) {
|
||||
int retVal;
|
||||
|
||||
#ifdef __linux__
|
||||
maddress alignAddr = (maddress)addr - ((maddress)addr % pageSize);
|
||||
retVal = mprotect((void*)alignAddr, pageSize, newProt);
|
||||
|
||||
// Linux's mprotect doesn't get the old protection flags, so we have to fake it
|
||||
switch (memType) {
|
||||
case MEMTYPE_CODE:
|
||||
*oldProt = MPROT_CODE;
|
||||
break;
|
||||
case MEMTYPE_RODATA:
|
||||
*oldProt = MPROT_RODATA;
|
||||
break;
|
||||
default:
|
||||
*oldProt = MPROT_CODE;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
retVal = VirtualProtect(addr, len, newProt, oldProt);
|
||||
// This will match the Windows return value with the Linux ones, done for consistency
|
||||
if (retVal == 0) {
|
||||
retVal = -1;
|
||||
} else {
|
||||
retVal = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
return retVal;
|
||||
}
|
||||
|
||||
// Linux won't work till I fix it for MEMTYPE_DATA
|
||||
#ifdef __linux__
|
||||
// Data section stuff
|
||||
maddress dataSectionStart;
|
||||
maddress dataSectionOffset;
|
||||
|
||||
int pageSize = sysconf(_SC_PAGESIZE);
|
||||
#endif
|
||||
|
||||
/* Gets real memory address */
|
||||
maddress GetRealMemoryAddress(maddress baseaddress, maddress address, char memType)
|
||||
{
|
||||
if(baseaddress == NULL) return address;
|
||||
|
||||
maddress realAddress = address;
|
||||
|
||||
switch (memType)
|
||||
{
|
||||
case MEMTYPE_CODE: case MEMTYPE_RODATA:
|
||||
realAddress = baseaddress + address;
|
||||
break;
|
||||
case MEMTYPE_DATA:
|
||||
// Linux's data segment is in a not so simple place in memory
|
||||
#ifdef __linux__
|
||||
realAddress = dataSectionStart + (address - dataSectionOffset);
|
||||
#else
|
||||
realAddress = baseaddress + address;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
return realAddress;
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
#ifndef __MEMMISC_H__
|
||||
#define __MEMMISC_H__
|
||||
|
||||
#include "MemConst.h"
|
||||
|
||||
#define SAMPLE_DLLFUNC reinterpret_cast<void*>(gpGamedllFuncs->dllapi_table->pfnThink)
|
||||
#define SAMPLE_ENGFUNC reinterpret_cast<void*>(g_engfuncs.pfnChangeLevel)
|
||||
|
||||
extern maddress gameDllAddress;
|
||||
extern maddress gameEngAddress;
|
||||
|
||||
inline maddress PickBaseAddress(long num)
|
||||
{
|
||||
if(num == 0) return gameDllAddress;
|
||||
else if(num == 1) return gameEngAddress;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
extern int MemoryProtect(void *addr, size_t len, unsigned long newProt, unsigned long *oldProt, char memType = MEMTYPE_CODE);
|
||||
extern maddress GetRealMemoryAddress(maddress baseaddress,maddress address, char memType);
|
||||
|
||||
extern bool GetBaseAddress(void *pAddr, maddress &pBaseAddr);
|
||||
|
||||
inline bool GetBaseAddresses( void )
|
||||
{
|
||||
bool success = false;
|
||||
|
||||
success = GetBaseAddress(SAMPLE_DLLFUNC, gameDllAddress);
|
||||
if(success == false) return false;
|
||||
|
||||
success = GetBaseAddress(SAMPLE_ENGFUNC, gameEngAddress);
|
||||
if(success == false) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#include "MemMisc.h"
|
||||
|
||||
#define NATIVE_MISC_ADDRESS params[1]
|
||||
#define NATIVE_MISC_BASEADDRESS PickBaseAddress(params[2])
|
||||
#define NATIVE_MISC_FLAGS params[3]
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_base(AMX *amx, cell *params)
|
||||
{
|
||||
cell *success = MF_GetAmxAddr(amx, params[2]);
|
||||
maddress BaseAddr = NULL;
|
||||
|
||||
bool is_success = GetBaseAddress((void*)(params[1]), BaseAddr);
|
||||
*success = is_success;
|
||||
|
||||
return cell(BaseAddr);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_realaddr(AMX *amx, cell *params)
|
||||
{
|
||||
return (cell)GetRealMemoryAddress(NATIVE_MISC_ADDRESS,NATIVE_MISC_BASEADDRESS,NATIVE_MISC_FLAGS);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_return_addr(AMX *amx, cell *params)
|
||||
{
|
||||
return (cell)PickBaseAddress(params[1]);
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO misc_natives[] = {
|
||||
{ "memhack_get_base", memhack_get_base },
|
||||
{ "memhack_get_realaddr", memhack_get_realaddr },
|
||||
{ "memhack_return_addr", memhack_return_addr },
|
||||
{ NULL, NULL }
|
||||
};
|
|
@ -1,56 +0,0 @@
|
|||
#include "MemMisc.h"
|
||||
|
||||
/* Functions that read different data types in memory */
|
||||
|
||||
template <typename Type>
|
||||
Type UTIL_ReadMemory(maddress BaseAddress, maddress StartAddress, char MemType, Type returnType)
|
||||
{
|
||||
maddress EndAddress = GetRealMemoryAddress(BaseAddress, StartAddress, MemType);
|
||||
|
||||
return *(Type*)EndAddress;
|
||||
}
|
||||
|
||||
char UTIL_ReadMemory_Byte(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, char(NULL));
|
||||
}
|
||||
|
||||
short UTIL_ReadMemory_Word(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, short(NULL));
|
||||
}
|
||||
|
||||
int32_t UTIL_ReadMemory_Dword(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, int32_t(NULL));
|
||||
}
|
||||
|
||||
long long UTIL_ReadMemory_Qword(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, (long long)(NULL));
|
||||
}
|
||||
|
||||
float UTIL_ReadMemory_Float(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, float(NULL));
|
||||
}
|
||||
|
||||
unsigned char UTIL_ReadMemory_UnsignedByte(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, (unsigned char)(NULL));
|
||||
}
|
||||
|
||||
unsigned short UTIL_ReadMemory_UnsignedWord(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, (unsigned short)(NULL));
|
||||
}
|
||||
|
||||
uint32_t UTIL_ReadMemory_UnsignedDword(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, uint32_t(NULL));
|
||||
}
|
||||
|
||||
maddress UTIL_ReadMemory_Pointer(maddress BaseAddress, maddress address, char memType)
|
||||
{
|
||||
return UTIL_ReadMemory( BaseAddress, address, memType, maddress(NULL));
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef __MEMREAD_H__
|
||||
#define __MEMREAD_H__
|
||||
|
||||
#include "MemMisc.h"
|
||||
|
||||
// Functions that read different data types in memory
|
||||
|
||||
// Base function
|
||||
template <typename Type>
|
||||
extern Type UTIL_ReadMemory(maddress BaseAddress, maddress StartAddress, char MemType, Type returnType);
|
||||
|
||||
// Inline stocks
|
||||
inline char UTIL_ReadMemory_Byte (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline short UTIL_ReadMemory_Word (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline int32_t UTIL_ReadMemory_Dword (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline long long UTIL_ReadMemory_Qword (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline float UTIL_ReadMemory_Float (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline unsigned char UTIL_ReadMemory_UnsignedByte (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline unsigned short UTIL_ReadMemory_UnsignedWord (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline uint32_t UTIL_ReadMemory_UnsignedDword (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
inline maddress UTIL_ReadMemory_Pointer (maddress baseaddress, maddress address, char memType = MEMTYPE_DATA);
|
||||
|
||||
#endif
|
|
@ -1,78 +0,0 @@
|
|||
#include "MemRead.h"
|
||||
|
||||
#define NATIVE_HACK_BASEADDRESS PickBaseAddress(params[2])
|
||||
#define NATIVE_HACK_ADDRESS params[1]
|
||||
#define NATIVE_HACK_FLAGS params[3]
|
||||
#define NATIVE_HACK_SIGNED params[4]
|
||||
#define NATIVE_HACK_MEMORY NATIVE_HACK_BASEADDRESS, NATIVE_HACK_ADDRESS, NATIVE_HACK_FLAGS
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_char(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_HACK_SIGNED)
|
||||
{
|
||||
char HackedMemory = UTIL_ReadMemory_Byte(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char HackedMemory = UTIL_ReadMemory_UnsignedByte(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_short(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_HACK_SIGNED)
|
||||
{
|
||||
short HackedMemory = UTIL_ReadMemory_Word(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned short HackedMemory = UTIL_ReadMemory_UnsignedWord(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_long(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_HACK_SIGNED)
|
||||
{
|
||||
long HackedMemory = UTIL_ReadMemory_Dword(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned long HackedMemory = UTIL_ReadMemory_UnsignedDword(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_quad(AMX *amx, cell *params)
|
||||
{
|
||||
long long HackedMemory = UTIL_ReadMemory_Qword(NATIVE_HACK_MEMORY);
|
||||
return amx_ftoc(float(HackedMemory));
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_float(AMX *amx, cell *params)
|
||||
{
|
||||
float HackedMemory = UTIL_ReadMemory_Float(NATIVE_HACK_MEMORY);
|
||||
return amx_ftoc(HackedMemory);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_get_pointer(AMX *amx, cell *params)
|
||||
{
|
||||
maddress HackedMemory = UTIL_ReadMemory_Pointer(NATIVE_HACK_MEMORY);
|
||||
return (cell)(HackedMemory);
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO read_natives[] = {
|
||||
{ "memhack_get_char", memhack_get_char },
|
||||
{ "memhack_get_short", memhack_get_short },
|
||||
{ "memhack_get_long", memhack_get_long },
|
||||
|
||||
{ "memhack_get_float", memhack_get_float },
|
||||
{ "memhack_get_quad", memhack_get_quad },
|
||||
{ "memhack_get_pointer", memhack_get_pointer },
|
||||
{ NULL, NULL }
|
||||
};
|
|
@ -1,78 +0,0 @@
|
|||
#include "MemMisc.h"
|
||||
|
||||
/* Functions that patch different data types in memory */
|
||||
template <typename Type>
|
||||
int UTIL_PatchMemory(maddress baseaddress, maddress address, Type patch, char memType, size_t byteType, bool extraProtect)
|
||||
{
|
||||
unsigned long oldProtect = 0;
|
||||
maddress realAddress = GetRealMemoryAddress(baseaddress, address, memType);
|
||||
|
||||
switch (memType)
|
||||
{
|
||||
case MEMTYPE_CODE:
|
||||
if (MemoryProtect((void*)realAddress, byteType, MPROT_CODE_EDIT, &oldProtect, memType) == MP_FAIL) return MP_FAIL;
|
||||
break;
|
||||
|
||||
case MEMTYPE_RODATA:
|
||||
if (MemoryProtect((void*)realAddress, byteType, MPROT_RODATA_EDIT, &oldProtect, memType) == MP_FAIL) return MP_FAIL;
|
||||
break;
|
||||
}
|
||||
|
||||
*(Type*)realAddress = patch;
|
||||
|
||||
if (memType == MEMTYPE_CODE)
|
||||
{
|
||||
MemoryProtect((void*)realAddress, byteType, oldProtect, &oldProtect);
|
||||
}
|
||||
else if(extraProtect == true)
|
||||
{
|
||||
if(memType == MEMTYPE_RODATA) MemoryProtect((void*)realAddress, byteType, oldProtect, &oldProtect);
|
||||
}
|
||||
|
||||
return MP_OK;
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Byte(maddress baseaddress, maddress address, char patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (char)patch, memType, BYTE_BYTES, true);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Word(maddress baseaddress, maddress address, short patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (short)patch, memType, WORD_BYTES, true);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Dword(maddress baseaddress, maddress address, int32_t patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (int32_t)patch, memType, DWORD_BYTES, true);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Qword(maddress baseaddress, maddress address, long long patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (long long)patch, memType, QWORD_BYTES, false);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Float(maddress baseaddress, maddress address, float patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (float)patch, memType, FLOAT_BYTES, false);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_UnsignedByte(maddress baseaddress, maddress address, unsigned char patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (unsigned char)patch, memType, BYTE_BYTES, false);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_UnsignedWord(maddress baseaddress, maddress address, unsigned short patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (unsigned short)patch, memType, WORD_BYTES, false);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_UnsignedDword(maddress baseaddress, maddress address, uint32_t patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (uint32_t)patch, memType, DWORD_BYTES, false);
|
||||
}
|
||||
|
||||
int UTIL_PatchMemory_Pointer(maddress baseaddress, maddress address, maddress patch, char memType)
|
||||
{
|
||||
return UTIL_PatchMemory(baseaddress, address, (maddress)patch, memType, DWORD_BYTES, true);
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
#ifndef __MEMWRITE_H__
|
||||
#define __MEMWRITE_H__
|
||||
|
||||
#include "MemMisc.h"
|
||||
|
||||
// Functions that patch different data types in memory
|
||||
|
||||
// Base function
|
||||
template <typename Type>
|
||||
inline int UTIL_PatchMemory(maddress baseaddress, maddress address, Type patch, char memType, size_t byteType, bool extraProtect);
|
||||
|
||||
// Inline stocks
|
||||
extern inline int UTIL_PatchMemory_Byte (maddress baseaddress, maddress address, char patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_Word (maddress baseaddress, maddress address, short patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_Dword (maddress baseaddress, maddress address, int32_t patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_Qword (maddress baseaddress, maddress address, long long patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_Float (maddress baseaddress, maddress address, float patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_UnsignedByte (maddress baseaddress, maddress address, unsigned char patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_UnsignedWord (maddress baseaddress, maddress address, unsigned short patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_UnsignedDword (maddress baseaddress, maddress address, uint32_t patch, char memType = MEMTYPE_DATA);
|
||||
extern inline int UTIL_PatchMemory_Pointer (maddress baseaddress, maddress address, maddress patch, char memType = MEMTYPE_DATA);
|
||||
|
||||
#endif
|
|
@ -1,72 +0,0 @@
|
|||
#include "MemWrite.h"
|
||||
|
||||
#define NATIVE_PATCH_BASEADDRESS PickBaseAddress(params[2])
|
||||
#define NATIVE_PATCH_ADDRESS params[1]
|
||||
#define NATIVE_PATCH_FLAGS params[4]
|
||||
#define NATIVE_PATCH_SIGNED params[5]
|
||||
#define NATIVE_PATCH_PARAMETER params[3]
|
||||
|
||||
#define NATIVE_PATCH_MEMORY NATIVE_PATCH_BASEADDRESS, NATIVE_PATCH_ADDRESS
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_char(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_PATCH_SIGNED)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Byte(NATIVE_PATCH_MEMORY, (char)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_UnsignedByte(NATIVE_PATCH_MEMORY, (unsigned char)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_short(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_PATCH_SIGNED)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Word(NATIVE_PATCH_MEMORY, (short)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_UnsignedWord(NATIVE_PATCH_MEMORY, (unsigned short)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_long(AMX *amx, cell *params)
|
||||
{
|
||||
if(NATIVE_PATCH_SIGNED)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Dword(NATIVE_PATCH_MEMORY, (long)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Dword(NATIVE_PATCH_MEMORY, (unsigned long)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_quad(AMX *amx, cell *params)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Qword(NATIVE_PATCH_MEMORY, (long long)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_float(AMX *amx, cell *params)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Float(NATIVE_PATCH_MEMORY, amx_ctof(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL memhack_set_pointer(AMX *amx, cell *params)
|
||||
{
|
||||
return (cell)UTIL_PatchMemory_Pointer(NATIVE_PATCH_MEMORY, (maddress)(NATIVE_PATCH_PARAMETER), NATIVE_PATCH_FLAGS);
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO write_natives[] = {
|
||||
{ "memhack_set_char", memhack_set_char },
|
||||
{ "memhack_set_short", memhack_set_short },
|
||||
{ "memhack_set_long", memhack_set_long },
|
||||
|
||||
{ "memhack_set_float", memhack_set_float },
|
||||
{ "memhack_set_quad", memhack_set_quad },
|
||||
{ "memhack_set_pointer", memhack_set_pointer },
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,20 +0,0 @@
|
|||
#include <memhack_const>
|
||||
|
||||
native memhack_get_char(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
native memhack_get_short(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
native memhack_get_long(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
|
||||
native Float:memhack_get_float(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA);
|
||||
native Float:memhack_get_quad(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA);
|
||||
native memhack_get_pointer(address,baseaddress = DLLBASE, memtype = MEMTYPE_DATA);
|
||||
|
||||
native memhack_set_char(address,baseaddress = DLLBASE, new_val, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
native memhack_set_short(address,baseaddress = DLLBASE, new_val, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
native memhack_set_long(address,baseaddress = DLLBASE, new_val, memtype = MEMTYPE_DATA, signtype = MEM_SIGNED);
|
||||
|
||||
native memhack_set_float(address,baseaddress = DLLBASE, Float:new_val, memtype = MEMTYPE_DATA);
|
||||
native memhack_set_quad(address,baseaddress = DLLBASE,Float:new_val, memtype = MEMTYPE_DATA);
|
||||
native memhack_set_pointer(address,baseaddress = DLLBASE, new_val, memtype = MEMTYPE_DATA);
|
||||
|
||||
native memhack_get_base(func_addr,&success);
|
||||
native memhack_get_realaddr(address,baseaddress,memtype = MEMTYPE_DATA);
|
|
@ -1,23 +0,0 @@
|
|||
#if defined _memhack_const_included
|
||||
#endinput
|
||||
#endif
|
||||
#define _memhack_const_included
|
||||
|
||||
// Different Address Bases
|
||||
#define MEM_DLLBASE 0
|
||||
#define MEM_ENGBASE 1
|
||||
#define MEM_NULLBASE 2
|
||||
|
||||
// Signed or unsigned
|
||||
#define MEM_SIGNED 0
|
||||
#define MEM_UNSIGNED 1
|
||||
|
||||
// Memory area types
|
||||
#define MEMTYPE_CODE 0 // Code (usually .text segment, requires mprotect or VirtualProtect)
|
||||
#define MEMTYPE_DATA 1 // Data (usually .data segment, writable by default)
|
||||
#define MEMTYPE_RODATA 2 // Read-Only Data (usually .rodata on Linux, .rdata on Windows)
|
||||
|
||||
// Return codes for patching (set natives)
|
||||
#define MP_FAIL -1
|
||||
#define MP_OK 0
|
||||
|
|
@ -1,463 +0,0 @@
|
|||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "MemHack"
|
||||
#define MODULE_VERSION "1.65"
|
||||
#define MODULE_AUTHOR "SD and Rukia"
|
||||
#define MODULE_URL "www.amxmodx.org"
|
||||
#define MODULE_LOGTAG "MEMHACK"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
#define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX dettach
|
||||
//#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta dettach
|
||||
//#define FN_META_DETTACH OnMetaDettach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
#include "amxxmodule.h"
|
||||
#include "ComboArray.h"
|
||||
|
||||
extern AMX_NATIVE_INFO bintrie_exports[];
|
||||
extern AMX_NATIVE_INFO bintrie_usage_exports[];
|
||||
extern ComboArray MasterTrie;
|
||||
|
||||
extern AMX_NATIVE_INFO list_exports[];
|
||||
extern AMX_NATIVE_INFO list_creation_exports[];
|
||||
extern ComboArray MasterList;
|
||||
|
||||
extern AMX_NATIVE_INFO map_exports[];
|
||||
extern AMX_NATIVE_INFO map_creation_exports[];
|
||||
extern ComboArray MasterMap;
|
||||
|
||||
|
||||
void OnAmxxAttach( void )
|
||||
{
|
||||
MF_AddNatives(bintrie_exports);
|
||||
MF_AddNatives(bintrie_usage_exports);
|
||||
|
||||
MF_AddNatives(list_exports);
|
||||
MF_AddNatives(list_creation_exports);
|
||||
|
||||
MF_AddNatives(map_exports);
|
||||
MF_AddNatives(map_creation_exports);
|
||||
}
|
||||
|
||||
void OnAmxxDetach( void )
|
||||
{
|
||||
JudyClearMasterTrie(&MasterTrie);
|
||||
JudyClearMasterList(&MasterList);
|
||||
JudyClearMasterMap(&MasterMap);
|
||||
}
|
|
@ -1,175 +0,0 @@
|
|||
# Microsoft Developer Studio Generated Dependency File, included by Array.mak
|
||||
|
||||
.\Array.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\BinTrieNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\BinTrieNativeFunctions.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\Capsule.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CArray.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CBinTrie.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\CKeytable.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CKeytable.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\JudyExtra.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\ListNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\ComboArray.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\ListNativeFunctions.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\MapNatives.cpp : \
|
||||
"..\..\..\..\..\..\program files\microsoft visual studio\vc98\include\basetsd.h"\
|
||||
".\amxxmodule.h"\
|
||||
".\Capsule.h"\
|
||||
".\CArray.h"\
|
||||
".\CBaseList.h"\
|
||||
".\CBaseMap.h"\
|
||||
".\CBinTrie.h"\
|
||||
".\CHashtable.h"\
|
||||
".\CKeytable.h"\
|
||||
".\ComboArray.h"\
|
||||
".\ComboTable.h"\
|
||||
".\GenericNatives.h"\
|
||||
".\Judy.h"\
|
||||
".\JudyEx.h"\
|
||||
".\JudyExtra.h"\
|
||||
".\JudyIncludes.h"\
|
||||
".\JudyVar.h"\
|
||||
".\JudyVec.h"\
|
||||
".\MapNativeFunctions.h"\
|
||||
".\moduleconfig.h"\
|
||||
".\NativeIncludes.h"\
|
||||
".\osdefs.h"\
|
||||
|
||||
|
||||
.\amxxmodule.cpp : \
|
||||
".\amxxmodule.h"\
|
||||
".\moduleconfig.h"\
|
||||
|
|
@ -1,237 +0,0 @@
|
|||
# Microsoft Developer Studio Project File - Name="Array" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
|
||||
|
||||
CFG=Array - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Array.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Array.mak" CFG="Array - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Array - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE "Array - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Array - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /FR /YX /FD /c
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "Array - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /YX /FD /GZ /c
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Array - Win32 Release"
|
||||
# Name "Array - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Array.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BinTrieNatives.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Capsule.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CArray.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CBinTrie.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CKeytable.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyExtra.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ListNatives.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapNatives.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Capsule.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CArray.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CBaseList.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CBaseMap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CBinTrie.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CHashtable.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\CKeytable.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ComboArray.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ComboTable.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyIncludes.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\amxxmodule.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\amxxmodule.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\BinTrieNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\GenericNatives.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Judy.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyEx.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyExtra.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyVar.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\JudyVec.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ListNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MapNativeFunctions.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\moduleconfig.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\NativeIncludes.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\osdefs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Judy.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
|
@ -1,29 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Array"=".\Array.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
Binary file not shown.
Binary file not shown.
|
@ -1,110 +0,0 @@
|
|||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: Array - Win32 Release--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPED.tmp" with contents
|
||||
[
|
||||
/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ARRAY_EXPORTS" /FR"Release/" /Fp"Release/Array.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
|
||||
"C:\Array\Array.cpp"
|
||||
"C:\Array\BinTrieNatives.cpp"
|
||||
"C:\Array\Capsule.cpp"
|
||||
"C:\Array\CArray.cpp"
|
||||
"C:\Array\CBinTrie.cpp"
|
||||
"C:\Array\CKeytable.cpp"
|
||||
"C:\Array\JudyExtra.cpp"
|
||||
"C:\Array\ListNatives.cpp"
|
||||
"C:\Array\MapNatives.cpp"
|
||||
"C:\Array\amxxmodule.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPED.tmp"
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPEE.tmp" with contents
|
||||
[
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"Release/Array.pdb" /machine:I386 /out:"Release/Array.dll" /implib:"Release/Array.lib"
|
||||
.\Release\Array.obj
|
||||
.\Release\BinTrieNatives.obj
|
||||
.\Release\Capsule.obj
|
||||
.\Release\CArray.obj
|
||||
.\Release\CBinTrie.obj
|
||||
.\Release\CKeytable.obj
|
||||
.\Release\JudyExtra.obj
|
||||
.\Release\ListNatives.obj
|
||||
.\Release\MapNatives.obj
|
||||
.\Release\amxxmodule.obj
|
||||
.\Judy.lib
|
||||
]
|
||||
Creating command line "link.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPEE.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
Array.cpp
|
||||
BinTrieNatives.cpp
|
||||
Capsule.cpp
|
||||
CArray.cpp
|
||||
CBinTrie.cpp
|
||||
CKeytable.cpp
|
||||
JudyExtra.cpp
|
||||
C:\Array\JudyExtra.cpp(10) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(15) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(20) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(23) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(34) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(41) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(66) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(102) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(107) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(112) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(115) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(127) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(132) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(137) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(140) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(160) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(164) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(167) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(190) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(205) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(210) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(215) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(218) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(230) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(235) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(240) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(243) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(258) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(266) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(274) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(277) : warning C4101: 'e' : unreferenced local variable
|
||||
C:\Array\JudyExtra.cpp(305) : warning C4101: 'e' : unreferenced local variable
|
||||
ListNatives.cpp
|
||||
MapNatives.cpp
|
||||
amxxmodule.cpp
|
||||
Linking...
|
||||
Creating library Release/Array.lib and object Release/Array.exp
|
||||
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
|
||||
Creating temporary file "C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPF2.tmp" with contents
|
||||
[
|
||||
/nologo /o"Release/Array.bsc"
|
||||
.\Release\Array.sbr
|
||||
.\Release\BinTrieNatives.sbr
|
||||
.\Release\Capsule.sbr
|
||||
.\Release\CArray.sbr
|
||||
.\Release\CBinTrie.sbr
|
||||
.\Release\CKeytable.sbr
|
||||
.\Release\JudyExtra.sbr
|
||||
.\Release\ListNatives.sbr
|
||||
.\Release\MapNatives.sbr
|
||||
.\Release\amxxmodule.sbr]
|
||||
Creating command line "bscmake.exe @C:\DOCUME~1\Edward\LOCALS~1\Temp\RSPF2.tmp"
|
||||
Creating browse info file...
|
||||
<h3>Output Window</h3>
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
Array.dll - 0 error(s), 33 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
|
@ -1,78 +0,0 @@
|
|||
#ifndef _bintrie_NATIVE_FUNC_INC_H
|
||||
#define _bintrie_NATIVE_FUNC_INC_H
|
||||
|
||||
#define JUDY_GLUE_FUNC( x , y ) x ## y
|
||||
|
||||
#define JUDY_GLUE_STR( x, y ) #x#y
|
||||
|
||||
#define JUDY_MASTER_EDIT_FUNCTIONS
|
||||
#define JUDY_MASTER_CLEAR_FUNC JUDY_GLUE_FUNC( bintrie , _clear )
|
||||
#define JUDY_MASTER_CLEAR_STR JUDY_GLUE_STR ( bintrie , _clear )
|
||||
|
||||
#define JUDY_MASTER_DELETE_FUNC JUDY_GLUE_FUNC( bintrie , _delete )
|
||||
#define JUDY_MASTER_DELETE_STR JUDY_GLUE_STR ( bintrie , _delete )
|
||||
|
||||
#define JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
#define JUDY_MASTER_SAVE_FUNC JUDY_GLUE_FUNC( bintrie , _save )
|
||||
#define JUDY_MASTER_SAVE_STR JUDY_GLUE_STR ( bintrie , _save )
|
||||
#define JUDY_SAVE_FUNC(bin,file) JudySaveBinTrie(bin , file )
|
||||
|
||||
#define JUDY_MASTER_LOAD_FUNC JUDY_GLUE_FUNC( bintrie , _load )
|
||||
#define JUDY_MASTER_LOAD_STR JUDY_GLUE_STR ( bintrie , _load )
|
||||
#define JUDY_LOAD_FUNC(bin, file) JudyLoadBinTrie(bin , file )
|
||||
|
||||
#define JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
#define JUDY_MASTER_COUNT_FUNC JUDY_GLUE_FUNC( bintrie , _count )
|
||||
#define JUDY_MASTER_COUNT_STR JUDY_GLUE_STR ( bintrie , _count )
|
||||
|
||||
#define JUDY_MASTER_BYCOUNT_FUNC JUDY_GLUE_FUNC( bintrie , _bycount )
|
||||
#define JUDY_MASTER_BYCOUNT_STR JUDY_GLUE_STR ( bintrie , _bycount )
|
||||
|
||||
#define JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
#define JUDY_SLAVE_COUNT_FUNC JUDY_GLUE_FUNC( bintrie , _size )
|
||||
#define JUDY_SLAVE_COUNT_STR JUDY_GLUE_STR ( bintrie , _size )
|
||||
|
||||
#define JUDY_SLAVE_BYCOUNT_FUNC JUDY_GLUE_FUNC( bintrie , _get_nth )
|
||||
#define JUDY_SLAVE_BYCOUNT_STR JUDY_GLUE_STR ( bintrie , _get_nth )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
#define JUDY_SLAVE_MEMORY_FUNC JUDY_GLUE_FUNC( bintrie , _memory )
|
||||
#define JUDY_SLAVE_MEMORY_STR JUDY_GLUE_STR ( bintrie , _memory )
|
||||
|
||||
#define JUDY_SLAVE_ISFILLED_FUNC JUDY_GLUE_FUNC( bintrie , _isfilled )
|
||||
#define JUDY_SLAVE_ISFILLED_STR JUDY_GLUE_STR ( bintrie , _isfilled )
|
||||
|
||||
#define JUDY_SLAVE_ISEMPTY_FUNC JUDY_GLUE_FUNC( bintrie , _isempty )
|
||||
#define JUDY_SLAVE_ISEMPTY_STR JUDY_GLUE_STR ( bintrie , _isempty )
|
||||
|
||||
#define NO_JUDY_SLAVE_REMOVE_FUNC
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
#define JUDY_SLAVE_FIRST_FUNC JUDY_GLUE_FUNC( bintrie , _first )
|
||||
#define JUDY_SLAVE_LAST_FUNC JUDY_GLUE_FUNC( bintrie , _last )
|
||||
|
||||
#define JUDY_SLAVE_FIRST_STR JUDY_GLUE_STR ( bintrie , _first )
|
||||
#define JUDY_SLAVE_LAST_STR JUDY_GLUE_STR ( bintrie , _last )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_FUNC JUDY_GLUE_FUNC( bintrie , _next )
|
||||
#define JUDY_SLAVE_PREV_FUNC JUDY_GLUE_FUNC( bintrie , _prev )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_STR JUDY_GLUE_STR ( bintrie , _next )
|
||||
#define JUDY_SLAVE_PREV_STR JUDY_GLUE_STR ( bintrie , _prev )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
#define JUDY_SLAVE_FIRSTEMPTY_FUNC JUDY_GLUE_FUNC( bintrie , _firstempty )
|
||||
#define JUDY_SLAVE_LASTEMPTY_FUNC JUDY_GLUE_FUNC( bintrie , _lastempty )
|
||||
|
||||
#define JUDY_SLAVE_FIRSTEMPTY_STR JUDY_GLUE_STR ( bintrie , _firstempty )
|
||||
#define JUDY_SLAVE_LASTEMPTY_STR JUDY_GLUE_STR ( bintrie , _lastempty )
|
||||
|
||||
#define JUDY_SLAVE_NEXTEMPTY_FUNC JUDY_GLUE_FUNC( bintrie , _nextempty )
|
||||
#define JUDY_SLAVE_PREVEMPTY_FUNC JUDY_GLUE_FUNC( bintrie , _prevempty )
|
||||
|
||||
#define JUDY_SLAVE_NEXTEMPTY_STR JUDY_GLUE_STR ( bintrie , _nextempty )
|
||||
#define JUDY_SLAVE_PREVEMPTY_STR JUDY_GLUE_STR ( bintrie , _prevempty )
|
||||
#endif
|
|
@ -1,69 +0,0 @@
|
|||
#include "CBinTrie.h"
|
||||
|
||||
#define KEY_TYPE cell
|
||||
#define DYNAMIC_UNIT_TYPE BinTrie
|
||||
#define STORAGE_TYPE cell
|
||||
#define MASTER_NAME MasterTrie
|
||||
#define EXPORT_NAME bintrie_exports
|
||||
|
||||
#define SEARCH_ERROR_OFFSET 0
|
||||
|
||||
#define GET_KEY(params, num) params[num]
|
||||
#define SET_KEY(stuff, parameter) stuff
|
||||
|
||||
#include "BinTrieNativeFunctions.h"
|
||||
#include "NativeIncludes.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL bintrie_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit;
|
||||
M_ITYPE Index = params[1];
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,BinTrie,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL bintrie_set(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool Value = (params[3] != NULL);
|
||||
|
||||
try { return Unit->Set(Indice, Value ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave Set Function ");
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL bintrie_get(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
|
||||
try { return Unit->Get(Indice ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave Get Function ");
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL bintrie_remove(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
|
||||
try { return Unit->Delete(Indice ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave Delete Function ");
|
||||
}
|
||||
|
||||
|
||||
AMX_NATIVE_INFO bintrie_usage_exports[] =
|
||||
{
|
||||
{ "bintrie_create", bintrie_create },
|
||||
{ "bintrie_set", bintrie_set },
|
||||
{ "bintrie_get", bintrie_get },
|
||||
{ "bintrie_remove", bintrie_remove },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
|
@ -1,87 +0,0 @@
|
|||
#include "CArray.h"
|
||||
|
||||
void Array::ThrowSearchError(char* type)
|
||||
{
|
||||
char value[50];
|
||||
sprintf(value,"Function attempted to search %s: Judy returned NULL value", type);
|
||||
|
||||
throw JudyEx(value,false);
|
||||
}
|
||||
|
||||
void Array::ThrowIndexError( cell index, bool disable_check )
|
||||
{
|
||||
if(disable_check == true) return;
|
||||
|
||||
char error[50];
|
||||
sprintf(error,"Index %i is not set.",index);
|
||||
|
||||
throw JudyEx(error,true);
|
||||
}
|
||||
|
||||
cell Array::First( cell Start)
|
||||
{
|
||||
PPvoid_t success = JudyLFirst(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:First");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::FirstEmpty( cell Start)
|
||||
{
|
||||
cell success = JudyLFirstEmpty(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:FirstEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::Next( cell Start)
|
||||
{
|
||||
PPvoid_t success = JudyLNext(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Next");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::NextEmpty( cell Start)
|
||||
{
|
||||
cell success = JudyLNextEmpty(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:NextEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::Prev( cell Start)
|
||||
{
|
||||
PPvoid_t success = JudyLPrev(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Prev");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::PrevEmpty( cell Start)
|
||||
{
|
||||
cell success = JudyLPrevEmpty(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:PrevEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::Last( cell Start)
|
||||
{
|
||||
PPvoid_t success = JudyLLast(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Last");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::LastEmpty( cell Start)
|
||||
{
|
||||
cell success = JudyLLastEmpty(Table, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:LastEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell Array::ByCount(cell n, cell Start)
|
||||
{
|
||||
PPvoid_t success = JudyLByCount(Table, n, reinterpret_cast<Word_t *>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Nth");
|
||||
|
||||
return Start;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
#ifndef _ARRAYCLASS_H
|
||||
#define _ARRAYCLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
#include "CBaseList.h"
|
||||
#include "JudyExtra.h"
|
||||
//#include <JudyL.h>
|
||||
|
||||
class Array: public CBaseList
|
||||
{
|
||||
private:
|
||||
Pvoid_t Table;
|
||||
|
||||
void ThrowIndexError( cell index, bool disable_check = false );
|
||||
void ThrowSearchError(char* msg);
|
||||
|
||||
public:
|
||||
Array() { Table = NULL; }
|
||||
~Array() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { JudyClearList(this); return JudyLFreeArray(&Table, PJE0); }
|
||||
Word_t MemoryUsed() { return JudyLMemUsed(Table); }
|
||||
|
||||
int Delete(cell Key) { return JudyLDel(&Table, Key, PJE0 ); }
|
||||
|
||||
void Set(cell Index, Pvoid_t value, bool disable_check)
|
||||
{
|
||||
PPvoid_t PValue = JudyLIns(&Table, Index,PJE0);
|
||||
*PValue = value;
|
||||
}
|
||||
|
||||
Pvoid_t Get(cell Index, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudyLGet(Table, Index, PJE0);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return NULL; }
|
||||
|
||||
return *PValue;
|
||||
}
|
||||
|
||||
template<class Type>
|
||||
void Set(cell Index, Type value)
|
||||
{
|
||||
PPvoid_t PValue = JudyLIns(&Table, Index,PJE0);
|
||||
*PValue = reinterpret_cast<void*>(value);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type Get(cell Index, Type example, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudyLGet(Table, Index, PJE0);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return (Type)NULL; }
|
||||
|
||||
return (Type)(*PValue);
|
||||
}
|
||||
|
||||
cell First(cell Start = 0);
|
||||
cell Next(cell Start = 0);
|
||||
cell Prev(cell Start = -1);
|
||||
cell Last(cell Start = -1);
|
||||
|
||||
cell FirstEmpty(cell Start = 0);
|
||||
cell NextEmpty(cell Start = 0);
|
||||
cell PrevEmpty(cell Start = -1);
|
||||
cell LastEmpty(cell Start = -1);
|
||||
|
||||
cell ByCount(cell n, cell Start = 0);
|
||||
cell Count(cell Start = 0, cell Stop = -1) { return JudyLCount(Table, Start, Stop, PJE0); }
|
||||
|
||||
bool IsFilled(cell Index) { return ( (Get(Index, true ) != NULL) ? true : false); }
|
||||
bool IsEmpty(cell Index) { return ( (Get(Index, true ) == NULL) ? true : false); }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,36 +0,0 @@
|
|||
#ifndef _BASE_ARRAYCLASS_H
|
||||
#define _BASE_ARRAYCLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
class CBaseList
|
||||
{
|
||||
public:
|
||||
virtual Word_t Clear() =0;
|
||||
virtual Word_t MemoryUsed() =0;
|
||||
|
||||
virtual int Delete(cell Key) =0;
|
||||
virtual void Remove() =0;
|
||||
|
||||
virtual void Set(cell Index, Pvoid_t value, bool disable_check = false) =0;
|
||||
|
||||
virtual Pvoid_t Get(cell Index, bool disable_check = false) =0;
|
||||
|
||||
virtual cell First(cell Start = 0) =0;
|
||||
virtual cell Next(cell Start = 0) =0;
|
||||
virtual cell Prev(cell Start = -1) =0;
|
||||
virtual cell Last(cell Start = -1) =0;
|
||||
|
||||
virtual cell FirstEmpty(cell Start = 0) =0;
|
||||
virtual cell NextEmpty(cell Start = 0) =0;
|
||||
virtual cell PrevEmpty(cell Start = -1) =0;
|
||||
virtual cell LastEmpty(cell Start = -1) =0;
|
||||
|
||||
virtual cell ByCount(cell n, cell Start = 0) =0;
|
||||
virtual cell Count(cell Start = 0, cell Stop = -1) =0;
|
||||
|
||||
virtual bool IsFilled(cell Index) =0;
|
||||
virtual bool IsEmpty(cell Index) =0;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef _BASE_MAPCLASS_H
|
||||
#define _BASE_MAPCLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
class CBaseMap
|
||||
{
|
||||
public:
|
||||
virtual Word_t Clear() =0;
|
||||
virtual Word_t MemoryUsed() =0;
|
||||
|
||||
virtual int Delete(char* Key) =0;
|
||||
virtual void Remove() =0;
|
||||
|
||||
virtual void Set(char* Index, Pvoid_t value, bool disable_check = false) =0;
|
||||
|
||||
virtual Pvoid_t Get(char* Index, bool disable_check = false) =0;
|
||||
|
||||
virtual char* First(char* Start = "") =0;
|
||||
virtual char* Next(char* Start) =0;
|
||||
virtual char* Prev(char* Start) =0;
|
||||
virtual char* Last(char* Start) =0;
|
||||
|
||||
virtual bool IsFilled(char* Index) =0;
|
||||
virtual bool IsEmpty(char* Index) =0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
#include "CBinTrie.h"
|
||||
|
||||
void BinTrie::ThrowSearchError(char* type)
|
||||
{
|
||||
char value[50];
|
||||
sprintf(value,"Function attempted to search %s: Judy returned NULL value", type);
|
||||
|
||||
throw JudyEx (value,false);
|
||||
}
|
||||
|
||||
cell BinTrie::First( cell Start)
|
||||
{
|
||||
cell success = Judy1First(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:First");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::FirstEmpty( cell Start)
|
||||
{
|
||||
cell success = Judy1FirstEmpty(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:FirstEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::Next( cell Start)
|
||||
{
|
||||
cell success = Judy1Next(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Next");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::NextEmpty( cell Start)
|
||||
{
|
||||
cell success = Judy1NextEmpty(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:NextEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::Prev( cell Start)
|
||||
{
|
||||
cell success = Judy1Prev(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Prev");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::PrevEmpty( cell Start)
|
||||
{
|
||||
cell success = Judy1PrevEmpty(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:PrevEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::Last( cell Start)
|
||||
{
|
||||
cell success = Judy1Last(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Last");
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::LastEmpty( cell Start)
|
||||
{
|
||||
cell success = Judy1LastEmpty(Table, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:LastEmpty");
|
||||
return Start;
|
||||
}
|
||||
|
||||
cell BinTrie::ByCount(cell n, cell Start)
|
||||
{
|
||||
cell success = Judy1ByCount(Table, n, reinterpret_cast<unsigned int*>(&Start), PJE0);
|
||||
if (success == NULL) ThrowSearchError("Type:Nth");
|
||||
|
||||
return Start;
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
#ifndef _BINTRIECLASS_H
|
||||
#define _BINTRIECLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
#include "JudyExtra.h"
|
||||
//#include <Judy1.h>
|
||||
|
||||
class BinTrie
|
||||
{
|
||||
private:
|
||||
Pvoid_t Table;
|
||||
|
||||
void ThrowSearchError(char* msg);
|
||||
|
||||
public:
|
||||
BinTrie() { Table = NULL; }
|
||||
~BinTrie() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { JudyClearBinTrie(this); return Judy1FreeArray(&Table, PJE0); }
|
||||
Word_t MemoryUsed() { return Judy1MemUsed(Table); }
|
||||
|
||||
cell Delete(cell Key) { return Judy1Unset(&Table, Key, PJE0 ); }
|
||||
|
||||
cell Set(cell Index, bool val)
|
||||
{
|
||||
if(val == false) return Delete(Index);
|
||||
else return Judy1Set(&Table, Index,PJE0);
|
||||
}
|
||||
|
||||
cell Get(cell Index)
|
||||
{
|
||||
cell PValue = Judy1Test(Table, Index, PJE0);
|
||||
return PValue;
|
||||
}
|
||||
|
||||
cell First(cell Start = 0);
|
||||
cell Next(cell Start = 0);
|
||||
cell Prev(cell Start = -1);
|
||||
cell Last(cell Start = -1);
|
||||
|
||||
cell FirstEmpty(cell Start = 0);
|
||||
cell NextEmpty(cell Start = 0);
|
||||
cell PrevEmpty(cell Start = -1);
|
||||
cell LastEmpty(cell Start = -1);
|
||||
|
||||
cell ByCount(cell n, cell Start);
|
||||
cell Count(cell Start = 0, cell Stop = -1) { return Judy1Count(Table, Start, Stop, PJE0); }
|
||||
|
||||
bool IsFilled(cell Index) { return ( (Get(Index )) ? true : false); }
|
||||
bool IsEmpty(cell Index) { return ( (Get(Index )) ? true : false); }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,82 +0,0 @@
|
|||
#ifndef _HASHCLASS_INCLUDED
|
||||
#define _HASHCLASS_INCLUDED
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
#include "CBaseMap.h"
|
||||
//#include <JudyHS.h>
|
||||
|
||||
class Hashtable: public CBaseMap
|
||||
{
|
||||
private:
|
||||
Pvoid_t Table;
|
||||
|
||||
public:
|
||||
Hashtable() { Table = NULL; }
|
||||
~Hashtable() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { return JudyHSFreeArray(&Table, PJE0); }
|
||||
Word_t MemoryUsed() { return JudyLMemUsed(Table); }
|
||||
|
||||
int Delete(char* Key) { return JudyHSDel(&Table, Key, strlen(Key), PJE0 ); }
|
||||
|
||||
void Set(char* Index, Pvoid_t value, bool disable_check)
|
||||
{
|
||||
int Len = strlen(Index) + 1;
|
||||
PPvoid_t PValue = JudyHSIns(&Table, Index, Len, PJE0);
|
||||
*PValue = value;
|
||||
}
|
||||
|
||||
Pvoid_t Get(char* Index, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudyHSGet(Table, Index, strlen(Index)+1);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return NULL; }
|
||||
|
||||
return *PValue;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
void Set(char* Index, Type value)
|
||||
{
|
||||
int Len = strlen(Index) + 1;
|
||||
PPvoid_t PValue = JudyHSIns(&Table, Index, Len, PJE0);
|
||||
*PValue = reinterpret_cast<void*>(value);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type Get(char* Index, Type example, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudyHSGet(Table, Index, strlen(Index)+1);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return (Type)NULL; }
|
||||
|
||||
return (Type)(*PValue);
|
||||
}
|
||||
|
||||
char* First( char* Start = "") { ThrowSearchError(); return (char*)NULL; }
|
||||
char* Next( char* Start = "") { ThrowSearchError(); return (char*)NULL; }
|
||||
char* Prev( char* Start) { ThrowSearchError(); return (char*)NULL; }
|
||||
char* Last( char* Start) { ThrowSearchError(); return (char*)NULL; }
|
||||
|
||||
bool IsFilled(char* Index) { return ( (Get(Index,(PPvoid_t)(NULL), true ) != NULL) ? true : false);}
|
||||
bool IsEmpty(char* Index) { return ( (Get(Index,(PPvoid_t)(NULL), true ) == NULL) ? true : false);}
|
||||
|
||||
protected:
|
||||
void ThrowIndexError( char* index, bool disable_check = false )
|
||||
{
|
||||
if(disable_check == true) return;
|
||||
|
||||
char value[100];
|
||||
sprintf(value,"Function attempted to read non existant index %s", index );
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
void ThrowSearchError( void )
|
||||
{
|
||||
char value[50];
|
||||
sprintf(value,"Function attempted to search HashTable!: Invalid action!");
|
||||
|
||||
throw JudyEx(value,true);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,66 +0,0 @@
|
|||
#include "CKeytable.h"
|
||||
|
||||
void Keytable::ThrowIndexError( char* index, bool disable_check = false )
|
||||
{
|
||||
if(disable_check == true) return;
|
||||
|
||||
char error[50];
|
||||
sprintf(error,"Index %s is not set.",index);
|
||||
|
||||
throw JudyEx(error,true);
|
||||
}
|
||||
|
||||
void Keytable::ThrowSearchError(char* type)
|
||||
{
|
||||
char value[50];
|
||||
sprintf(value,"Function attempted to search %s: Judy returned NULL value", type);
|
||||
|
||||
throw JudyEx(value,false);
|
||||
}
|
||||
|
||||
char* Keytable::First( char* Start)
|
||||
{
|
||||
PPvoid_t index = JudySLFirst(Table, Start, PJE0);
|
||||
if (index == NULL)
|
||||
{
|
||||
sprintf(Start,"dne");
|
||||
ThrowSearchError("Type:First");
|
||||
}
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
char* Keytable::Next( char* Start)
|
||||
{
|
||||
PPvoid_t index = JudySLNext(Table, Start, PJE0);
|
||||
if (index == NULL)
|
||||
{
|
||||
sprintf(Start,"dne");
|
||||
ThrowSearchError("Type:Next");
|
||||
}
|
||||
return Start;
|
||||
}
|
||||
|
||||
char* Keytable::Prev( char* Start)
|
||||
{
|
||||
PPvoid_t index = JudySLPrev(Table, Start, PJE0);
|
||||
if (index == NULL)
|
||||
{
|
||||
sprintf(Start,"dne");
|
||||
ThrowSearchError("Type:Prev");
|
||||
}
|
||||
|
||||
return Start;
|
||||
}
|
||||
|
||||
char* Keytable::Last( char* Start)
|
||||
{
|
||||
PPvoid_t index = JudySLLast(Table, Start, PJE0);
|
||||
if (index == NULL)
|
||||
{
|
||||
sprintf(Start,"dne");
|
||||
ThrowSearchError("Type:Last");
|
||||
}
|
||||
|
||||
return Start;
|
||||
}
|
|
@ -1,66 +0,0 @@
|
|||
#ifndef _KEYCLASS_INCLUDED
|
||||
#define _KEYCLASS_INCLUDED
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
#include "CBaseMap.h"
|
||||
#include "JudyExtra.h"
|
||||
//#include <JudySL.h>
|
||||
|
||||
class Keytable: public CBaseMap
|
||||
{
|
||||
private:
|
||||
Pvoid_t Table;
|
||||
|
||||
void ThrowSearchError(char* type);
|
||||
void ThrowIndexError( char* index, bool disable_check);
|
||||
|
||||
public:
|
||||
Keytable() { Table = NULL; }
|
||||
~Keytable() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { JudyClearMap(this); return JudySLFreeArray(&Table, PJE0); }
|
||||
Word_t MemoryUsed() { return JudyLMemUsed(Table); }
|
||||
|
||||
int Delete(char* Key) { return JudySLDel(&Table, Key, PJE0 ); }
|
||||
|
||||
void Set(char* Index, Pvoid_t value, bool disable_check)
|
||||
{
|
||||
PPvoid_t PValue = JudySLIns(&Table, Index,PJE0);
|
||||
*PValue = value;
|
||||
}
|
||||
|
||||
Pvoid_t Get(char* Index, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudySLGet(Table, Index, PJE0);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return NULL; }
|
||||
|
||||
return *PValue;
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
void Set(char* Index, Type value)
|
||||
{
|
||||
PPvoid_t PValue = JudySLIns(&Table, Index,PJE0);
|
||||
*PValue = reinterpret_cast<void*>(value);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type Get(char* Index, Type example, bool disable_check = false)
|
||||
{
|
||||
PPvoid_t PValue = JudySLGet(Table, Index, PJE0);
|
||||
if(PValue == NULL) { ThrowIndexError(Index, disable_check); return (Type)NULL; }
|
||||
|
||||
return (Type)*PValue;
|
||||
}
|
||||
|
||||
char* First(char* Start = "");
|
||||
char* Next(char* Start = "");
|
||||
char* Prev(char* Start = "");
|
||||
char* Last(char* Start = "");
|
||||
|
||||
bool IsFilled(char* Index) { return ( (Get(Index,(PPvoid_t)(NULL), true ) != NULL) ? true : false); }
|
||||
bool IsEmpty(char* Index) { return ( (Get(Index,(PPvoid_t)(NULL), true ) == NULL) ? true : false); }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,261 +0,0 @@
|
|||
#include "Capsule.h"
|
||||
|
||||
const char* capsule_types[] =
|
||||
{
|
||||
"-NO VALUE-",
|
||||
"BOOLEAN",
|
||||
"INTEGER",
|
||||
"FLOAT",
|
||||
"VECTOR",
|
||||
"STRING"
|
||||
};
|
||||
|
||||
void Capsule::ThrowTypeError(cell get_type)
|
||||
{
|
||||
char ValStr[15];
|
||||
GetAsStr(ValStr);
|
||||
|
||||
char value[100];
|
||||
sprintf(value,"Function attempted to read NON-%s value, actual type is: %s, actual value is: %s", capsule_types[get_type], capsule_types[type], ValStr );
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
|
||||
bool Capsule::CheckEmpty(bool clear)
|
||||
{
|
||||
bool empty = ( data == NULL );
|
||||
|
||||
if(empty != true && clear == true) Clear();
|
||||
return empty;
|
||||
}
|
||||
|
||||
void Capsule::Clear()
|
||||
{
|
||||
//This function intelligently creates a pointer x,
|
||||
//which will be of correct type and then deletes it.
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case capsule_type_flo:
|
||||
{
|
||||
REAL *real_val = reinterpret_cast<REAL*>(data);
|
||||
delete real_val;
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
JudyVec *vector_val = reinterpret_cast<JudyVec*>(data);
|
||||
delete vector_val;
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_str:
|
||||
{
|
||||
char *char_val = reinterpret_cast<char*>(data);
|
||||
delete char_val;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
data = NULL; //Null the address as well. (Used for ints too.)
|
||||
}
|
||||
|
||||
bool Capsule::GetBool( void )
|
||||
{
|
||||
if (type != capsule_type_bool) ThrowTypeError(capsule_type_bool);
|
||||
|
||||
return (data != NULL);
|
||||
}
|
||||
|
||||
void Capsule::SetBool(bool Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_bool;
|
||||
if(Value == true) data = reinterpret_cast<Pvoid_t>(1);
|
||||
};
|
||||
|
||||
cell Capsule::GetInt( void )
|
||||
{
|
||||
if (type != capsule_type_int) ThrowTypeError(capsule_type_int);
|
||||
|
||||
return reinterpret_cast<cell>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetInt(cell Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_int;
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
};
|
||||
|
||||
REAL Capsule::GetFlo( void )
|
||||
{
|
||||
if (type != capsule_type_flo) ThrowTypeError(capsule_type_flo);
|
||||
|
||||
return *reinterpret_cast<REAL*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetFlo(REAL Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_flo;
|
||||
data = new REAL(Value);
|
||||
};
|
||||
|
||||
const JudyVec* Capsule::GetVec( void )
|
||||
{
|
||||
if (type != capsule_type_vec) ThrowTypeError(capsule_type_vec);
|
||||
|
||||
return reinterpret_cast<const JudyVec*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetVec(JudyVec* Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_vec;
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
}
|
||||
|
||||
const char* Capsule::GetStr( void )
|
||||
{
|
||||
if (type != capsule_type_str) ThrowTypeError(capsule_type_str);
|
||||
|
||||
return reinterpret_cast<const char*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetStr(char* Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_str;
|
||||
|
||||
char *string_val = new char[strlen(Value)+1];
|
||||
strcpy(string_val,Value);
|
||||
|
||||
data = reinterpret_cast<void*>(string_val);
|
||||
}
|
||||
|
||||
void Capsule::GetAsStr(char* value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case capsule_type_bool:
|
||||
sprintf(value, "%i",(cell)GetBool());
|
||||
break;
|
||||
case capsule_type_int:
|
||||
sprintf(value, "%d", GetInt() );
|
||||
break;
|
||||
case capsule_type_flo:
|
||||
sprintf(value, "%f", GetFlo() );
|
||||
break;
|
||||
case capsule_type_vec:
|
||||
sprintf(value, "{%f,%f,%f}", GetVec()->first, GetVec()->second, GetVec()->third);
|
||||
break;
|
||||
case capsule_type_str:
|
||||
sprintf(value, "\"%s\"", GetStr() );
|
||||
break;
|
||||
default:
|
||||
sprintf(value, "-NO VALUE-");
|
||||
}
|
||||
}
|
||||
|
||||
void Capsule::Save(FILE* capsuleDB)
|
||||
{
|
||||
fwrite(&type,sizeof(char),1,capsuleDB);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case capsule_type_none: { break; }
|
||||
case capsule_type_bool: { bool var = GetBool(); fwrite(&var, sizeof(bool), 1, capsuleDB); break; }
|
||||
case capsule_type_int: { cell var = GetInt(); fwrite(&var, sizeof(cell), 1, capsuleDB); break; }
|
||||
case capsule_type_flo: { fwrite(reinterpret_cast<REAL*>(GetData()), sizeof(REAL), 1, capsuleDB); break; }
|
||||
case capsule_type_str:
|
||||
{
|
||||
const char* str = GetStr();
|
||||
size_t len = strlen(str);
|
||||
fwrite(&len,sizeof(size_t), 1, capsuleDB);
|
||||
fwrite(&str, sizeof(char), len, capsuleDB);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
const JudyVec* buffer = GetVec();
|
||||
fwrite(buffer, sizeof(JudyVec), 1, capsuleDB);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
char value[20];
|
||||
sprintf(value,"Invalid type found!");
|
||||
|
||||
throw JudyEx(value, true);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void Capsule::Load(FILE* capsuleDB)
|
||||
{
|
||||
fread(&type, sizeof(char), 1, capsuleDB);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case capsule_type_none: { CheckEmpty(true); break; }
|
||||
case capsule_type_bool:
|
||||
{
|
||||
bool value = false;
|
||||
fread(&value, sizeof(bool), 1, capsuleDB);
|
||||
SetBool(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_int:
|
||||
{
|
||||
cell value = NULL;
|
||||
fread(&value, sizeof(cell), 1, capsuleDB);
|
||||
SetInt(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_flo:
|
||||
{
|
||||
REAL value = NULL;
|
||||
fread(&value, sizeof(REAL), 1, capsuleDB);
|
||||
SetFlo(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_str:
|
||||
{
|
||||
size_t length;
|
||||
fread(&length, sizeof(size_t), 1, capsuleDB);
|
||||
|
||||
char* value = new char[length+1];
|
||||
fgets(value, length+1, capsuleDB);
|
||||
|
||||
SetStr(value);
|
||||
delete(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
JudyVec* value = new JudyVec(NULL,NULL,NULL);
|
||||
fread(value, sizeof(JudyVec), 1, capsuleDB);
|
||||
|
||||
SetVec(value);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
char value[20];
|
||||
sprintf(value,"Invalid type found: %i",(int)type);
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,65 +0,0 @@
|
|||
#ifndef _JUDYCAP_INCLUDED
|
||||
#define _JUDYCAP_INCLUDED
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
enum
|
||||
{
|
||||
capsule_type_none,
|
||||
capsule_type_bool,
|
||||
capsule_type_int,
|
||||
capsule_type_flo,
|
||||
capsule_type_vec,
|
||||
capsule_type_str
|
||||
};
|
||||
|
||||
extern const char* capsule_types[];
|
||||
|
||||
class Capsule
|
||||
{
|
||||
private:
|
||||
Pvoid_t data;
|
||||
char type;
|
||||
|
||||
protected:
|
||||
void Clear( void );
|
||||
void ThrowTypeError(cell get_type);
|
||||
|
||||
public:
|
||||
Capsule() { data = NULL; type = capsule_type_none;}
|
||||
~Capsule() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Capsule(bool set) { SetBool(set); }
|
||||
Capsule(cell set) { SetInt(set); }
|
||||
Capsule(REAL set) { SetFlo(set); }
|
||||
Capsule(JudyVec* set) { SetVec(set); }
|
||||
Capsule(char* set) { SetStr(set); }
|
||||
|
||||
bool GetBool( void );
|
||||
void SetBool(bool set);
|
||||
|
||||
cell GetInt( void );
|
||||
void SetInt(cell set);
|
||||
|
||||
REAL GetFlo( void );
|
||||
void SetFlo(REAL set);
|
||||
|
||||
const JudyVec* GetVec( void );
|
||||
void SetVec(JudyVec* set);
|
||||
|
||||
const char* GetStr( void );
|
||||
void SetStr(char* set);
|
||||
|
||||
void GetAsStr(char* value);
|
||||
|
||||
void Load(FILE* db);
|
||||
void Save(FILE* db);
|
||||
|
||||
bool CheckEmpty(bool clear);
|
||||
|
||||
Pvoid_t GetData( void ) { return data; }
|
||||
char GetType( void ) { return type; }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,80 +0,0 @@
|
|||
#ifndef _COMBOARRAY_INCLUDED
|
||||
#define _COMBOARRAY_INCLUDED
|
||||
|
||||
#include "CBinTrie.h"
|
||||
#include "CArray.h"
|
||||
#include "CBaseList.h"
|
||||
|
||||
class ComboArray: public CBaseList
|
||||
{
|
||||
private:
|
||||
BinTrie MasterBin;
|
||||
Array MasterArray;
|
||||
|
||||
public:
|
||||
ComboArray() { }
|
||||
~ComboArray() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { return (MasterBin.Clear() + MasterArray.Clear() ); }
|
||||
Word_t MemoryUsed() { return (MasterBin.MemoryUsed() + MasterArray.MemoryUsed() ); }
|
||||
|
||||
int Delete(cell Key) { return (MasterBin.Delete(Key) + MasterArray.Delete(Key) ); }
|
||||
|
||||
void Set(cell Index, Pvoid_t value, bool disable_check)
|
||||
{
|
||||
MasterBin.Set(Index, true);
|
||||
MasterArray.Set(Index, value, disable_check);
|
||||
}
|
||||
|
||||
Pvoid_t Get(cell Index, bool disable_check = false)
|
||||
{
|
||||
if(MasterBin.Get(Index) == NULL) { ThrowIndexError(Index, disable_check); return NULL; }
|
||||
|
||||
return MasterArray.Get(Index);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
void Set(cell Index, Type value)
|
||||
{
|
||||
MasterBin.Set(Index, true);
|
||||
MasterArray.Set(Index, value);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type Get(cell Index, Type example, bool disable_check = false)
|
||||
{
|
||||
if(MasterBin.Get(Index) == NULL) { ThrowIndexError(Index, disable_check); return (Type)NULL; }
|
||||
|
||||
return MasterArray.Get(Index,example);
|
||||
}
|
||||
|
||||
cell First(cell Start = 0) { return MasterBin.First(Start); }
|
||||
cell Next(cell Start = 0) { return MasterBin.Next(Start); }
|
||||
cell Prev(cell Start = -1) { return MasterBin.Prev(Start); }
|
||||
cell Last(cell Start = -1) { return MasterBin.Last(Start); }
|
||||
|
||||
cell FirstEmpty(cell Start = 0) { return MasterBin.FirstEmpty(Start); }
|
||||
cell NextEmpty(cell Start = 0) { return MasterBin.NextEmpty(Start); }
|
||||
cell PrevEmpty(cell Start = -1) { return MasterBin.PrevEmpty(Start); }
|
||||
cell LastEmpty(cell Start = -1) { return MasterBin.LastEmpty(Start); }
|
||||
|
||||
cell ByCount(cell n, cell Start = 0) { return MasterBin.ByCount(n, Start); }
|
||||
cell Count(cell Start = 0, cell Stop = -1) { return MasterBin.Count(Start, Stop); }
|
||||
|
||||
bool IsFilled(cell Index) { return ( (MasterBin.Get(Index) != NULL) ? true : false); }
|
||||
bool IsEmpty(cell Index) { return ( (MasterBin.Get(Index) == NULL) ? true : false); }
|
||||
|
||||
protected:
|
||||
void ThrowIndexError(cell Index, bool disable_check = false)
|
||||
{
|
||||
if(disable_check == true) return;
|
||||
|
||||
char error[50];
|
||||
sprintf(error,"Index %i is not set.",Index);
|
||||
|
||||
throw JudyEx(error,true);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,68 +0,0 @@
|
|||
#ifndef _COMBOTABLE_INCLUDED
|
||||
#define _COMBOTABLE_INCLUDED
|
||||
|
||||
#include "CKeytable.h"
|
||||
#include "CHashtable.h"
|
||||
#include "CBaseMap.h"
|
||||
|
||||
class ComboTable: public CBaseMap
|
||||
{
|
||||
private:
|
||||
Keytable MasterKey;
|
||||
Hashtable MasterHash;
|
||||
|
||||
public:
|
||||
ComboTable() { }
|
||||
~ComboTable() { Clear(); }
|
||||
void Remove() { delete this; }
|
||||
|
||||
Word_t Clear() { return (MasterHash.Clear() + MasterKey.Clear() ); }
|
||||
Word_t MemoryUsed() { return (MasterKey.MemoryUsed() + MasterHash.MemoryUsed() ); }
|
||||
|
||||
int Delete(char* Key) { return (MasterKey.Delete(Key) + MasterHash.Delete(Key) ); }
|
||||
|
||||
bool IsFilled(char* Index) { return ( (MasterHash.Get(Index,(PPvoid_t)(NULL), true ) != NULL) ? true : false);}
|
||||
bool IsEmpty(char* Index) { return ( (MasterHash.Get(Index,(PPvoid_t)(NULL), true ) == NULL) ? true : false);}
|
||||
|
||||
void Set(char* Index, Pvoid_t value, bool disable_check)
|
||||
{
|
||||
MasterKey.Set(Index, value);
|
||||
MasterHash.Set(Index, value);
|
||||
}
|
||||
|
||||
Pvoid_t Get(char* Index, bool disable_check = false)
|
||||
{
|
||||
return MasterHash.Get(Index, disable_check);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
void Set(char* Index, Type value)
|
||||
{
|
||||
MasterKey.Set(Index, value);
|
||||
MasterHash.Set(Index, value);
|
||||
}
|
||||
|
||||
template <class Type>
|
||||
Type Get(char* Index, Type example, bool disable_check = false)
|
||||
{
|
||||
return MasterHash.Get(Index, example, disable_check);
|
||||
}
|
||||
|
||||
char* First( char* Start = "") { return MasterKey.First(Start);}
|
||||
char* Next( char* Start = "") { return MasterKey.Next(Start);}
|
||||
char* Prev( char* Start = "") { return MasterKey.Prev(Start); }
|
||||
char* Last( char* Start = "") { return MasterKey.Last(Start);}
|
||||
|
||||
protected:
|
||||
void ThrowIndexError( char* index, bool disable_check = false )
|
||||
{
|
||||
if(disable_check == true) return;
|
||||
|
||||
char value[100];
|
||||
sprintf(value,"Function attempted to read non existant index %s", index );
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,862 +0,0 @@
|
|||
#ifndef _GENERIC_INC_H
|
||||
#define _GENERIC_INC_H
|
||||
|
||||
// Master table
|
||||
ComboArray MNAME;
|
||||
|
||||
///* MASTER FUNCTIONS *///
|
||||
|
||||
///* Start Master Edit Funcs *///
|
||||
#ifdef JUDY_MASTER_EDIT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_DELETE_FUNC
|
||||
|
||||
// generic_delete(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_DELETE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1] );
|
||||
|
||||
Unit->Remove();
|
||||
|
||||
try { return MNAME.Delete( params[1] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Delete function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Delete func: JUDY_MASTER_DELETE_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_CLEAR_FUNC
|
||||
|
||||
// generic_clear(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_CLEAR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1] );
|
||||
|
||||
try { return Unit->Clear(); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Clear function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Clear func: JUDY_MASTER_CLEAR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master Edit Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Master IO Funcs *///
|
||||
#ifdef JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_SAVE_FUNC
|
||||
|
||||
// generic_save(id,file[])
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_SAVE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
return JUDY_SAVE_FUNC(Unit, JUDY_BUILD_PATH(amx,params[2]) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Save func: JUDY_MASTER_SAVE_FUNC not defined properly!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_LOAD_FUNC
|
||||
|
||||
// generic_load(file[],id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_LOAD_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[2]);
|
||||
|
||||
return JUDY_LOAD_FUNC(Unit, JUDY_BUILD_PATH(amx,params[1]) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Load func: JUDY_MASTER_LOAD_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master IO Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Master Amount Funcs *///
|
||||
#ifdef JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_COUNT_FUNC
|
||||
|
||||
// generic_count(start = 0, stop = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_COUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
try { return MNAME.Count(params[1],params[2] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Count Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Count func: JUDY_MASTER_COUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_BYCOUNT_FUNC
|
||||
|
||||
// generic_bycount(nth, start = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_BYCOUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
try { return MNAME.ByCount(params[1],params[2] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have ByCount func: JUDY_MASTER_BYCOUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master Amount Funcs *///
|
||||
#endif
|
||||
|
||||
///* SLAVE FUNCTIONS *///
|
||||
|
||||
///* Start Slave Amount Funcs *///
|
||||
#ifdef JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_COUNT_FUNC
|
||||
|
||||
// generic_size(id, start = 0, stop = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_COUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->Count(JUDY_GET_KEY(params,2),JUDY_GET_KEY(params, 3) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave Count Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Count func: JUDY_SLAVE_COUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_BYCOUNT_FUNC
|
||||
|
||||
// generic_get_nth(id, nth, start = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_BYCOUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->ByCount(JUDY_GET_KEY(params,2),JUDY_GET_KEY(params, 3) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have ByCount func: JUDY_SLAVE_BYCOUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Amount Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Edit Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_MEMORY_FUNC
|
||||
|
||||
// generic_memory(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_MEMORY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->MemoryUsed(); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Memory func: JUDY_SLAVE_MEMORY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_ISFILLED_FUNC
|
||||
|
||||
// generic_isfilled(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_ISFILLED_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->IsFilled(JUDY_GET_KEY(params,2) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave IsFilled Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have IsFilled func: JUDY_SLAVE_ISFILLED_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_ISEMPTY_FUNC
|
||||
|
||||
// generic_isempty(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_ISEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->IsEmpty(JUDY_GET_KEY(params,2) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave IsEmpty Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have IsEmpty func: JUDY_SLAVE_ISEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_REMOVE_FUNC
|
||||
|
||||
// generic_remove(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_REMOVE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
Storage->Remove();
|
||||
|
||||
try { return Unit->Delete(Indice); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No Error Possible) - Delete function ");
|
||||
}
|
||||
#else
|
||||
|
||||
#ifdef NO_JUDY_SLAVE_REMOVE_FUNC
|
||||
#else
|
||||
|
||||
#error Must Have Delete func: JUDY_SLAVE_REMOVE_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
///* End Required Slave Edit Funcs *///
|
||||
|
||||
///* Start Slave Bool Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_BOOL
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_BOOL_FUNC
|
||||
// generic_set_bool(id, index, Bool:val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_BOOL_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool Value = (params[3] != NULL);
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetBool(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_BOOL_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_BOOL_FUNC
|
||||
|
||||
// Bool:generic_get_bool(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_BOOL_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return Storage->GetBool();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_BOOL_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Bool Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Int Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_INT
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_INT_FUNC
|
||||
|
||||
// generic_set_bool(id, index, val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_INT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell Value = params[3];
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetInt(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_INT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_INT_FUNC
|
||||
|
||||
// generic_get_int(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_INT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return Storage->GetInt();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_INT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Int Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Float Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_FLO
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_FLO_FUNC
|
||||
|
||||
// generic_set_float(id, index, Float:val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_FLO_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
REAL Value = amx_ctof(params[3]);
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetFlo(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_FLO_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_FLO_FUNC
|
||||
|
||||
// Float:generic_get_float(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_FLO_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return amx_ftoc(Storage->GetFlo() );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_FLO_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Float Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave String Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_STR
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_STR_FUNC
|
||||
|
||||
// generic_set_string(id, index, val[])
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_STR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
char* Value = MF_GetAmxString(amx,params[3],3,NULL);
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetStr(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_STR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_STR_FUNC
|
||||
|
||||
// generic_get_string(id, index, val[], len, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_STR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[5] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return MF_SetAmxString(amx,params[3], Storage->GetStr(), params[4] );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_STR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave String Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Vector Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_VEC
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_VEC_FUNC
|
||||
|
||||
// generic_set_vec(id, index, Float:val[3])
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_VEC_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
|
||||
cell *input_vec = MF_GetAmxAddr(amx, params[3]);
|
||||
JudyVec *Value = new JudyVec(
|
||||
amx_ctof(input_vec[0]),
|
||||
amx_ctof(input_vec[1]),
|
||||
amx_ctof(input_vec[2])
|
||||
);
|
||||
|
||||
Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetVec(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_VEC_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_FLO_FUNC
|
||||
|
||||
// generic_get_vec(id,index,Float:vec[3], disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_VEC_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
||||
bool disable_check = (params[4] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<STYPE*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL)
|
||||
{
|
||||
vAmx[0] = amx_ftoc(0);
|
||||
vAmx[1] = amx_ftoc(0);
|
||||
vAmx[2] = amx_ftoc(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
JudyVec* Vec = const_cast<JudyVec*>( Storage->GetVec() );
|
||||
|
||||
REAL One, Two, Three;
|
||||
Vec->Get(One, Two, Three);
|
||||
|
||||
vAmx[0] = amx_ftoc(One);
|
||||
vAmx[1] = amx_ftoc(Two);
|
||||
vAmx[2] = amx_ftoc(Three);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_VEC_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave VEC Funcs *///
|
||||
#endif
|
||||
|
||||
///* End Slave Edit Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Search Funcs
|
||||
#ifdef JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_FIRST_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_FIRST_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->First(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_FIRST_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_NEXT_FUNC
|
||||
// generic_next(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_NEXT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Next(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_NEXT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_PREV_FUNC
|
||||
// generic_prev(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_PREV_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Prev(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_PREV_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_LAST_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_LAST_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Last(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_LAST_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Search Funcs *///
|
||||
#endif
|
||||
|
||||
|
||||
///* Start Slave Empty Search Funcs
|
||||
#ifdef JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_FIRSTEMPTY_FUNC
|
||||
// generic_firstempty(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_FIRSTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->FirstEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_FIRSTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_NEXTEMPTY_FUNC
|
||||
// generic_next(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_NEXTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->NextEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_NEXTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_PREVEMPTY_FUNC
|
||||
// generic_prev(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_PREVEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->PrevEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_PREVEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_LASTEMPTY_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_LASTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->LastEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function",*success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_LASTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Search Empty Funcs *///
|
||||
#endif
|
||||
|
||||
AMX_NATIVE_INFO EXPORT_NAME[] =
|
||||
{
|
||||
|
||||
#ifdef JUDY_MASTER_EDIT_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_CLEAR_STR , JUDY_MASTER_CLEAR_FUNC },
|
||||
{ JUDY_MASTER_DELETE_STR , JUDY_MASTER_DELETE_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_SAVE_STR , JUDY_MASTER_SAVE_FUNC },
|
||||
{ JUDY_MASTER_LOAD_STR , JUDY_MASTER_LOAD_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_COUNT_STR , JUDY_MASTER_COUNT_FUNC },
|
||||
{ JUDY_MASTER_BYCOUNT_STR , JUDY_MASTER_BYCOUNT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_COUNT_STR , JUDY_SLAVE_COUNT_FUNC },
|
||||
{ JUDY_SLAVE_BYCOUNT_STR , JUDY_SLAVE_BYCOUNT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_MEMORY_STR , JUDY_SLAVE_MEMORY_FUNC },
|
||||
{ JUDY_SLAVE_ISFILLED_STR , JUDY_SLAVE_ISFILLED_FUNC },
|
||||
{ JUDY_SLAVE_ISEMPTY_STR , JUDY_SLAVE_ISEMPTY_FUNC },
|
||||
|
||||
#ifndef NO_JUDY_SLAVE_REMOVE_FUNC
|
||||
{ JUDY_SLAVE_REMOVE_STR , JUDY_SLAVE_REMOVE_FUNC },
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_BOOL
|
||||
|
||||
{ JUDY_SLAVE_GET_BOOL_STR , JUDY_SLAVE_GET_BOOL_FUNC },
|
||||
{ JUDY_SLAVE_SET_BOOL_STR , JUDY_SLAVE_SET_BOOL_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_INT
|
||||
|
||||
{ JUDY_SLAVE_GET_INT_STR , JUDY_SLAVE_GET_INT_FUNC },
|
||||
{ JUDY_SLAVE_SET_INT_STR , JUDY_SLAVE_SET_INT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_FLO
|
||||
|
||||
{ JUDY_SLAVE_GET_FLO_STR , JUDY_SLAVE_GET_FLO_FUNC },
|
||||
{ JUDY_SLAVE_SET_FLO_STR , JUDY_SLAVE_SET_FLO_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_STR
|
||||
|
||||
{ JUDY_SLAVE_GET_STR_STR , JUDY_SLAVE_GET_STR_FUNC },
|
||||
{ JUDY_SLAVE_SET_STR_STR , JUDY_SLAVE_SET_STR_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_VEC
|
||||
|
||||
{ JUDY_SLAVE_GET_VEC_STR , JUDY_SLAVE_GET_VEC_FUNC },
|
||||
{ JUDY_SLAVE_SET_VEC_STR , JUDY_SLAVE_SET_VEC_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
// End all edit functions
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_FIRST_STR , JUDY_SLAVE_FIRST_FUNC },
|
||||
{ JUDY_SLAVE_LAST_STR , JUDY_SLAVE_LAST_FUNC },
|
||||
|
||||
{ JUDY_SLAVE_NEXT_STR , JUDY_SLAVE_NEXT_FUNC },
|
||||
{ JUDY_SLAVE_PREV_STR , JUDY_SLAVE_PREV_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_FIRSTEMPTY_STR , JUDY_SLAVE_FIRSTEMPTY_FUNC },
|
||||
{ JUDY_SLAVE_LASTEMPTY_STR , JUDY_SLAVE_LASTEMPTY_FUNC },
|
||||
|
||||
{ JUDY_SLAVE_NEXTEMPTY_STR , JUDY_SLAVE_NEXTEMPTY_FUNC },
|
||||
{ JUDY_SLAVE_PREVEMPTY_STR , JUDY_SLAVE_PREVEMPTY_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
#endif
|
Binary file not shown.
|
@ -1,742 +0,0 @@
|
|||
#ifndef _JUDY_INCLUDED
|
||||
#define _JUDY_INCLUDED
|
||||
// _________________
|
||||
//
|
||||
// Copyright (C) 2000 - 2002 Hewlett-Packard Company
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify it
|
||||
// under the term of the GNU Lesser 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 Lesser General Public License
|
||||
// for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser 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
|
||||
// _________________
|
||||
|
||||
// @(#) $Revision$ $Source$
|
||||
//
|
||||
// HEADER FILE FOR EXPORTED FEATURES IN JUDY LIBRARY, libJudy.*
|
||||
//
|
||||
// See the manual entries for details.
|
||||
//
|
||||
// Note: This header file uses old-style comments on #-directive lines and
|
||||
// avoids "()" on macro names in comments for compatibility with older cc -Aa
|
||||
// and some tools on some platforms.
|
||||
|
||||
|
||||
// PLATFORM-SPECIFIC
|
||||
|
||||
#ifdef JU_WIN /* =============================================== */
|
||||
|
||||
typedef __int8 int8_t;
|
||||
//typedef __int16 int16_t;
|
||||
//typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
|
||||
typedef char uint8_t;
|
||||
//typedef unsigned __int16 uint16_t;
|
||||
//typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
|
||||
#else /* ================ ! JU_WIN ============================= */
|
||||
|
||||
// ISO C99: 7.8 Format conversion of integer types <inttypes.h>
|
||||
#include <inttypes.h> /* if this FAILS, try #include <stdint.h> */
|
||||
|
||||
// ISO C99: 7.18 Integer types uint*_t
|
||||
#include <stdint.h>
|
||||
|
||||
#endif /* ================ ! JU_WIN ============================= */
|
||||
|
||||
// ISO C99 Standard: 7.20 General utilities
|
||||
#include <stdlib.h>
|
||||
|
||||
// ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef __cplusplus /* support use by C++ code */
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// ****************************************************************************
|
||||
// DECLARE SOME BASE TYPES IN CASE THEY ARE MISSING:
|
||||
//
|
||||
// These base types include "const" where appropriate, but only where of
|
||||
// interest to the caller. For example, a caller cares that a variable passed
|
||||
// by reference will not be modified, such as, "const void * Pindex", but not
|
||||
// that the called function internally does not modify the pointer itself, such
|
||||
// as, "void * const Pindex".
|
||||
//
|
||||
// Note that its OK to pass a Pvoid_t to a Pcvoid_t; the latter is the same,
|
||||
// only constant. Callers need to do this so they can also pass & Pvoid_t to
|
||||
// PPvoid_t (non-constant).
|
||||
|
||||
#ifndef _PCVOID_T
|
||||
#define _PCVOID_T
|
||||
typedef const void * Pcvoid_t;
|
||||
#endif
|
||||
|
||||
#ifndef _PVOID_T
|
||||
#define _PVOID_T
|
||||
typedef void * Pvoid_t;
|
||||
typedef void ** PPvoid_t;
|
||||
#endif
|
||||
|
||||
#ifndef _WORD_T
|
||||
#define _WORD_T
|
||||
typedef unsigned int Word_t, * PWord_t; // expect 32-bit or 64-bit words.
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
|
||||
// ****************************************************************************
|
||||
// SUPPORT FOR ERROR HANDLING:
|
||||
//
|
||||
// Judy error numbers:
|
||||
//
|
||||
// Note: These are an enum so theres a related typedef, but the numbers are
|
||||
// spelled out so you can map a number back to its name.
|
||||
|
||||
typedef enum // uint8_t -- but C does not support this type of enum.
|
||||
{
|
||||
|
||||
// Note: JU_ERRNO_NONE and JU_ERRNO_FULL are not real errors. They specify
|
||||
// conditions which are otherwise impossible return values from 32-bit
|
||||
// Judy1Count, which has 2^32 + 1 valid returns (0..2^32) plus one error
|
||||
// return. These pseudo-errors support the return values that cannot otherwise
|
||||
// be unambiguously represented in a 32-bit word, and will never occur on a
|
||||
// 64-bit system.
|
||||
|
||||
JU_ERRNO_NONE = 0,
|
||||
JU_ERRNO_FULL = 1,
|
||||
JU_ERRNO_NFMAX = JU_ERRNO_FULL,
|
||||
|
||||
// JU_ERRNO_NOMEM comes from malloc(3C) when Judy cannot obtain needed memory.
|
||||
// The system errno value is also set to ENOMEM. This error can be recoverable
|
||||
// if the calling application frees other memory.
|
||||
//
|
||||
// TBD: Currently there is no guarantee the Judy array has no memory leaks
|
||||
// upon JU_ERRNO_NOMEM.
|
||||
|
||||
JU_ERRNO_NOMEM = 2,
|
||||
|
||||
// Problems with parameters from the calling program:
|
||||
//
|
||||
// JU_ERRNO_NULLPPARRAY means PPArray was null; perhaps PArray was passed where
|
||||
// &PArray was intended. Similarly, JU_ERRNO_NULLPINDEX means PIndex was null;
|
||||
// perhaps &Index was intended. Also, JU_ERRNO_NONNULLPARRAY,
|
||||
// JU_ERRNO_NULLPVALUE, and JU_ERRNO_UNSORTED, all added later (hence with
|
||||
// higher numbers), mean: A non-null array was passed in where a null pointer
|
||||
// was required; PValue was null; and unsorted indexes were detected.
|
||||
|
||||
JU_ERRNO_NULLPPARRAY = 3, // see above.
|
||||
JU_ERRNO_NONNULLPARRAY = 10, // see above.
|
||||
JU_ERRNO_NULLPINDEX = 4, // see above.
|
||||
JU_ERRNO_NULLPVALUE = 11, // see above.
|
||||
JU_ERRNO_NOTJUDY1 = 5, // PArray is not to a Judy1 array.
|
||||
JU_ERRNO_NOTJUDYL = 6, // PArray is not to a JudyL array.
|
||||
JU_ERRNO_NOTJUDYSL = 7, // PArray is not to a JudySL array.
|
||||
JU_ERRNO_UNSORTED = 12, // see above.
|
||||
|
||||
// Errors below this point are not recoverable; further tries to access the
|
||||
// Judy array might result in EFAULT and a core dump:
|
||||
//
|
||||
// JU_ERRNO_OVERRUN occurs when Judy detects, upon reallocation, that a block
|
||||
// of memory in its own freelist was modified since being freed.
|
||||
|
||||
JU_ERRNO_OVERRUN = 8,
|
||||
|
||||
// JU_ERRNO_CORRUPT occurs when Judy detects an impossible value in a Judy data
|
||||
// structure:
|
||||
//
|
||||
// Note: The Judy data structure contains some redundant elements that support
|
||||
// this type of checking.
|
||||
|
||||
JU_ERRNO_CORRUPT = 9
|
||||
|
||||
// Warning: At least some C or C++ compilers do not tolerate a trailing comma
|
||||
// above here. At least we know of one case, in aCC; see JAGad58928.
|
||||
|
||||
} JU_Errno_t;
|
||||
|
||||
|
||||
// Judy errno structure:
|
||||
//
|
||||
// WARNING: For compatibility with possible future changes, the fields of this
|
||||
// struct should not be referenced directly. Instead use the macros supplied
|
||||
// below.
|
||||
|
||||
// This structure should be declared on the stack in a threaded process.
|
||||
|
||||
typedef struct J_UDY_ERROR_STRUCT
|
||||
{
|
||||
JU_Errno_t je_Errno; // one of the enums above.
|
||||
int je_ErrID; // often an internal source line number.
|
||||
Word_t je_reserved[4]; // for future backward compatibility.
|
||||
|
||||
} JError_t, * PJError_t;
|
||||
|
||||
|
||||
// Related macros:
|
||||
//
|
||||
// Fields from error struct:
|
||||
|
||||
#define JU_ERRNO(PJError) ((PJError)->je_Errno)
|
||||
#define JU_ERRID(PJError) ((PJError)->je_ErrID)
|
||||
|
||||
// For checking return values from various Judy functions:
|
||||
//
|
||||
// Note: Define JERR as -1, not as the seemingly more portable (Word_t)
|
||||
// (~0UL), to avoid a compiler "overflow in implicit constant conversion"
|
||||
// warning.
|
||||
|
||||
#define JERR (-1) /* functions returning int or Word_t */
|
||||
#define PJERR ((Pvoid_t) (~0UL)) /* mainly for use here, see below */
|
||||
#define PPJERR ((PPvoid_t) (~0UL)) /* functions that return PPvoid_t */
|
||||
|
||||
// Convenience macro for when detailed error information (PJError_t) is not
|
||||
// desired by the caller; a purposely short name:
|
||||
|
||||
#define PJE0 ((PJError_t) NULL)
|
||||
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDY FUNCTIONS:
|
||||
//
|
||||
// P_JE is a shorthand for use below:
|
||||
|
||||
#define P_JE PJError_t PJError
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDY1 FUNCTIONS:
|
||||
|
||||
extern int j__udy1Test( Pvoid_t Pjpm, Word_t Index);
|
||||
extern int Judy1Test( Pcvoid_t PArray, Word_t Index, P_JE);
|
||||
extern int Judy1Set( PPvoid_t PPArray, Word_t Index, P_JE);
|
||||
extern int Judy1SetArray( PPvoid_t PPArray, Word_t Count,
|
||||
const Word_t * const PIndex,
|
||||
P_JE);
|
||||
extern int Judy1Unset( PPvoid_t PPArray, Word_t Index, P_JE);
|
||||
extern Word_t Judy1Count( Pcvoid_t PArray, Word_t Index1,
|
||||
Word_t Index2, P_JE);
|
||||
extern int Judy1ByCount( Pcvoid_t PArray, Word_t Count,
|
||||
Word_t * PIndex, P_JE);
|
||||
extern Word_t Judy1FreeArray( PPvoid_t PPArray, P_JE);
|
||||
extern Word_t Judy1MemUsed( Pcvoid_t PArray);
|
||||
extern Word_t Judy1MemActive( Pcvoid_t PArray);
|
||||
extern int Judy1First( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1Next( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int j__udy1Next( Pvoid_t Pjpm, Word_t * PIndex);
|
||||
extern int Judy1Last( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1Prev( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1FirstEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1NextEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1LastEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int Judy1PrevEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
|
||||
extern PPvoid_t j__udyLGet( Pvoid_t Pjpm, Word_t Index);
|
||||
extern PPvoid_t JudyLGet( Pcvoid_t PArray, Word_t Index, P_JE);
|
||||
extern PPvoid_t JudyLIns( PPvoid_t PPArray, Word_t Index, P_JE);
|
||||
extern int JudyLInsArray( PPvoid_t PPArray, Word_t Count,
|
||||
const Word_t * const PIndex,
|
||||
const Word_t * const PValue,
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDYL FUNCTIONS:
|
||||
P_JE);
|
||||
extern int JudyLDel( PPvoid_t PPArray, Word_t Index, P_JE);
|
||||
extern Word_t JudyLCount( Pcvoid_t PArray, Word_t Index1,
|
||||
Word_t Index2, P_JE);
|
||||
extern PPvoid_t JudyLByCount( Pcvoid_t PArray, Word_t Count,
|
||||
Word_t * PIndex, P_JE);
|
||||
extern Word_t JudyLFreeArray( PPvoid_t PPArray, P_JE);
|
||||
extern Word_t JudyLMemUsed( Pcvoid_t PArray);
|
||||
extern Word_t JudyLMemActive( Pcvoid_t PArray);
|
||||
extern PPvoid_t JudyLFirst( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern PPvoid_t JudyLNext( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern PPvoid_t j__udyLNext( Pvoid_t Pjpm, Word_t * PIndex);
|
||||
extern PPvoid_t JudyLLast( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern PPvoid_t JudyLPrev( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int JudyLFirstEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int JudyLNextEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int JudyLLastEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
extern int JudyLPrevEmpty( Pcvoid_t PArray, Word_t * PIndex, P_JE);
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDYSL FUNCTIONS:
|
||||
|
||||
extern PPvoid_t JudySLGet( Pcvoid_t, const uint8_t * Index, P_JE);
|
||||
extern PPvoid_t JudySLIns( PPvoid_t, const uint8_t * Index, P_JE);
|
||||
extern int JudySLDel( PPvoid_t, const uint8_t * Index, P_JE);
|
||||
extern Word_t JudySLFreeArray( PPvoid_t, P_JE);
|
||||
extern PPvoid_t JudySLFirst( Pcvoid_t, uint8_t * Index, P_JE);
|
||||
extern PPvoid_t JudySLNext( Pcvoid_t, uint8_t * Index, P_JE);
|
||||
extern PPvoid_t JudySLLast( Pcvoid_t, uint8_t * Index, P_JE);
|
||||
extern PPvoid_t JudySLPrev( Pcvoid_t, uint8_t * Index, P_JE);
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDYHSL FUNCTIONS:
|
||||
|
||||
extern PPvoid_t JudyHSGet( Pcvoid_t, void *, Word_t);
|
||||
extern PPvoid_t JudyHSIns( PPvoid_t, void *, Word_t, P_JE);
|
||||
extern int JudyHSDel( PPvoid_t, void *, Word_t, P_JE);
|
||||
extern Word_t JudyHSFreeArray( PPvoid_t, P_JE);
|
||||
|
||||
extern const char *Judy1MallocSizes;
|
||||
extern const char *JudyLMallocSizes;
|
||||
|
||||
// ****************************************************************************
|
||||
// JUDY memory interface to malloc() FUNCTIONS:
|
||||
|
||||
extern Word_t JudyMalloc(Word_t); // words reqd => words allocd.
|
||||
extern Word_t JudyMallocVirtual(Word_t); // words reqd => words allocd.
|
||||
extern void JudyFree(Pvoid_t, Word_t); // free, size in words.
|
||||
extern void JudyFreeVirtual(Pvoid_t, Word_t); // free, size in words.
|
||||
|
||||
#define JLAP_INVALID 0x1 /* flag to mark pointer "not a Judy array" */
|
||||
|
||||
// ****************************************************************************
|
||||
// MACRO EQUIVALENTS FOR JUDY FUNCTIONS:
|
||||
//
|
||||
// The following macros, such as J1T, are shorthands for calling Judy functions
|
||||
// with parameter address-of and detailed error checking included. Since they
|
||||
// are macros, the error checking code is replicated each time the macro is
|
||||
// used, but it runs fast in the normal case of no error.
|
||||
//
|
||||
// If the caller does not like the way the default JUDYERROR macro handles
|
||||
// errors (such as an exit(1) call when out of memory), they may define their
|
||||
// own before the "#include <Judy.h>". A routine such as HandleJudyError
|
||||
// could do checking on specific error numbers and print a different message
|
||||
// dependent on the error. The following is one example:
|
||||
//
|
||||
// Note: the back-slashes are removed because some compilers will not accept
|
||||
// them in comments.
|
||||
//
|
||||
// void HandleJudyError(uint8_t *, int, uint8_t *, int, int);
|
||||
// #define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID)
|
||||
// {
|
||||
// HandleJudyError(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID);
|
||||
// }
|
||||
//
|
||||
// The routine HandleJudyError could do checking on specific error numbers and
|
||||
// print a different message dependent on the error.
|
||||
//
|
||||
// The macro receives five parameters that are:
|
||||
//
|
||||
// 1. CallerFile: Source filename where a Judy call returned a serious error.
|
||||
// 2. CallerLine: Line number in that source file.
|
||||
// 3. JudyFunc: Name of Judy function reporting the error.
|
||||
// 4. JudyErrno: One of the JU_ERRNO* values enumerated above.
|
||||
// 5. JudyErrID: The je_ErrID field described above.
|
||||
|
||||
#ifndef JUDYERROR_NOTEST
|
||||
#ifndef JUDYERROR /* supply a default error macro */
|
||||
#include <stdio.h>
|
||||
|
||||
#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \
|
||||
{ \
|
||||
(void) fprintf(stderr, "File '%s', line %d: %s(), " \
|
||||
"JU_ERRNO_* == %d, ID == %d\n", \
|
||||
CallerFile, CallerLine, \
|
||||
JudyFunc, JudyErrno, JudyErrID); \
|
||||
exit(1); \
|
||||
}
|
||||
|
||||
#endif /* JUDYERROR */
|
||||
#endif /* JUDYERROR_NOTEST */
|
||||
|
||||
// If the JUDYERROR macro is not desired at all, then the following eliminates
|
||||
// it. However, the return code from each Judy function (that is, the first
|
||||
// parameter of each macro) must be checked by the caller to assure that an
|
||||
// error did not occur.
|
||||
//
|
||||
// Example:
|
||||
//
|
||||
// #define JUDYERROR_NOTEST 1
|
||||
// #include <Judy.h>
|
||||
//
|
||||
// or use this cc option at compile time:
|
||||
//
|
||||
// cc -DJUDYERROR_NOTEST ...
|
||||
//
|
||||
// Example code:
|
||||
//
|
||||
// J1S(Rc, PArray, Index);
|
||||
// if (Rc == JERR) goto ...error
|
||||
//
|
||||
// or:
|
||||
//
|
||||
// JLI(PValue, PArray, Index);
|
||||
// if (PValue == PJERR) goto ...error
|
||||
|
||||
|
||||
// Internal shorthand macros for writing the J1S, etc. macros:
|
||||
|
||||
#ifdef JUDYERROR_NOTEST /* ============================================ */
|
||||
|
||||
// "Judy Set Error":
|
||||
|
||||
#define J_SE(FuncName,Errno) ((void) 0)
|
||||
|
||||
// Note: In each J_*() case below, the digit is the number of key parameters
|
||||
// to the Judy*() call. Just assign the Func result to the callers Rc value
|
||||
// without a cast because none is required, and this keeps the API simpler.
|
||||
// However, a family of different J_*() macros is needed to support the
|
||||
// different numbers of key parameters (0,1,2) and the Func return type.
|
||||
//
|
||||
// In the names below, "I" = integer result; "P" = pointer result. Note, the
|
||||
// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible,
|
||||
// error-free assignment, and then compare to PJERR.
|
||||
|
||||
#define J_0I(Rc,PArray,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, PJE0); }
|
||||
|
||||
#define J_1I(Rc,PArray,Index,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, Index, PJE0); }
|
||||
|
||||
#define J_1P(PV,PArray,Index,Func,FuncName) \
|
||||
{ (PV) = (Pvoid_t) Func(PArray, Index, PJE0); }
|
||||
|
||||
#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, Index, Arg2, PJE0); }
|
||||
|
||||
#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, Index1, Index2, PJE0); }
|
||||
|
||||
#define J_2P(PV,PArray,Index,Arg2,Func,FuncName) \
|
||||
{ (PV) = (Pvoid_t) Func(PArray, Index, Arg2, PJE0); }
|
||||
|
||||
// Variations for Judy*Set/InsArray functions:
|
||||
|
||||
#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, Count, PIndex, PJE0); }
|
||||
#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName) \
|
||||
{ (Rc) = Func(PArray, Count, PIndex, PValue, PJE0); }
|
||||
|
||||
#else /* ================ ! JUDYERROR_NOTEST ============================= */
|
||||
|
||||
#define J_E(FuncName,PJE) \
|
||||
JUDYERROR(__FILE__, __LINE__, FuncName, JU_ERRNO(PJE), JU_ERRID(PJE))
|
||||
|
||||
#define J_SE(FuncName,Errno) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
JU_ERRNO(&J_Error) = (Errno); \
|
||||
JU_ERRID(&J_Error) = __LINE__; \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
// Note: In each J_*() case below, the digit is the number of key parameters
|
||||
// to the Judy*() call. Just assign the Func result to the callers Rc value
|
||||
// without a cast because none is required, and this keeps the API simpler.
|
||||
// However, a family of different J_*() macros is needed to support the
|
||||
// different numbers of key parameters (0,1,2) and the Func return type.
|
||||
//
|
||||
// In the names below, "I" = integer result; "P" = pointer result. Note, the
|
||||
// Funcs for J_*P() return PPvoid_t, but cast this to a Pvoid_t for flexible,
|
||||
// error-free assignment, and then compare to PJERR.
|
||||
|
||||
#define J_0I(Rc,PArray,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = Func(PArray, &J_Error)) == JERR) \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
#define J_1I(Rc,PArray,Index,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = Func(PArray, Index, &J_Error)) == JERR) \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
#define J_1P(Rc,PArray,Index,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = (Pvoid_t) Func(PArray, Index, &J_Error)) == PJERR) \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
#define J_2I(Rc,PArray,Index,Arg2,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = Func(PArray, Index, Arg2, &J_Error)) == JERR) \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
// Variation for Judy*Count functions, which return 0, not JERR, for error (and
|
||||
// also for other non-error cases):
|
||||
//
|
||||
// Note: JU_ERRNO_NFMAX should only apply to 32-bit Judy1, but this header
|
||||
// file lacks the necessary ifdefs to make it go away otherwise, so always
|
||||
// check against it.
|
||||
|
||||
#define J_2C(Rc,PArray,Index1,Index2,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if ((((Rc) = Func(PArray, Index1, Index2, &J_Error)) == 0) \
|
||||
&& (JU_ERRNO(&J_Error) > JU_ERRNO_NFMAX)) \
|
||||
{ \
|
||||
J_E(FuncName, &J_Error); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define J_2P(PV,PArray,Index,Arg2,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((PV) = (Pvoid_t) Func(PArray, Index, Arg2, &J_Error)) \
|
||||
== PJERR) J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
// Variations for Judy*Set/InsArray functions:
|
||||
|
||||
#define J_2AI(Rc,PArray,Count,PIndex,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = Func(PArray, Count, PIndex, &J_Error)) == JERR) \
|
||||
J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
#define J_3AI(Rc,PArray,Count,PIndex,PValue,Func,FuncName) \
|
||||
{ \
|
||||
JError_t J_Error; \
|
||||
if (((Rc) = Func(PArray, Count, PIndex, PValue, &J_Error)) \
|
||||
== JERR) J_E(FuncName, &J_Error); \
|
||||
}
|
||||
|
||||
#endif /* ================ ! JUDYERROR_NOTEST ============================= */
|
||||
|
||||
// Some of the macros are special cases that use inlined shortcuts for speed
|
||||
// with root-level leaves:
|
||||
|
||||
// This is a slower version with current processors, but in the future...
|
||||
#ifdef notdef
|
||||
#define J1T(Rc,PArray,Index) \
|
||||
{ \
|
||||
PWord_t P_L = (PWord_t)(PArray); \
|
||||
(Rc) = 0; \
|
||||
if (P_L) /* cannot be a NULL pointer */ \
|
||||
{ \
|
||||
if (P_L[0] < 31) /* is a LeafL */ \
|
||||
{ \
|
||||
Word_t _pop1 = P_L[0] + 1; \
|
||||
PWord_t P_LE = P_L + _pop1; \
|
||||
Word_t _index = 0; \
|
||||
int ii = 0; \
|
||||
P_L++; \
|
||||
while (_pop1 > 4) \
|
||||
{ \
|
||||
_pop1 /=2; \
|
||||
_index = P_L[_pop1]; \
|
||||
if ((Index) > _index) P_L += _pop1 + 1; \
|
||||
} \
|
||||
while (P_L <= P_LE) \
|
||||
{ \
|
||||
ii++; \
|
||||
_index = P_L[0]; \
|
||||
if (_index >= (Index)) break; \
|
||||
P_L++; \
|
||||
} \
|
||||
if (_index == (Index)) (Rc) = 1; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Rc) = j__udy1Test((Pvoid_t)P_L, (Index)); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
#endif // notdef
|
||||
|
||||
#define J1T(Rc,PArray,Index) \
|
||||
{ \
|
||||
PWord_t P_L = (PWord_t)(PArray); \
|
||||
(Rc) = 0; \
|
||||
if (P_L) /* cannot be a NULL pointer */ \
|
||||
{ \
|
||||
if (P_L[0] < 31) /* is a LeafL */ \
|
||||
{ \
|
||||
Word_t _pop1 = P_L[0] + 1; \
|
||||
Word_t _EIndex = P_L[_pop1]; \
|
||||
if (_pop1 >= 16) \
|
||||
{ \
|
||||
if ((Index) > P_L[_pop1/2]) P_L += _pop1/2; \
|
||||
} \
|
||||
if ((Index) <= _EIndex) \
|
||||
{ \
|
||||
while((Index) > *(++P_L)); \
|
||||
if (*P_L == (Index)) (Rc) = 1; \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(Rc) = j__udy1Test((Pvoid_t)P_L, Index); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define J1S( Rc, PArray, Index) \
|
||||
J_1I(Rc, (&(PArray)), Index, Judy1Set, "Judy1Set")
|
||||
#define J1SA(Rc, PArray, Count, PIndex) \
|
||||
J_2AI(Rc,(&(PArray)), Count, PIndex, Judy1SetArray, "Judy1SetArray")
|
||||
#define J1U( Rc, PArray, Index) \
|
||||
J_1I(Rc, (&(PArray)), Index, Judy1Unset, "Judy1Unset")
|
||||
#define J1F( Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1First, "Judy1First")
|
||||
#define J1N( Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1Next, "Judy1Next")
|
||||
#define J1L( Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1Last, "Judy1Last")
|
||||
#define J1P( Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1Prev, "Judy1Prev")
|
||||
#define J1FE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1FirstEmpty, "Judy1FirstEmpty")
|
||||
#define J1NE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1NextEmpty, "Judy1NextEmpty")
|
||||
#define J1LE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1LastEmpty, "Judy1LastEmpty")
|
||||
#define J1PE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), Judy1PrevEmpty, "Judy1PrevEmpty")
|
||||
#define J1C( Rc, PArray, Index1, Index2) \
|
||||
J_2C(Rc, PArray, Index1, Index2, Judy1Count, "Judy1Count")
|
||||
#define J1BC(Rc, PArray, Count, Index) \
|
||||
J_2I(Rc, PArray, Count, &(Index), Judy1ByCount, "Judy1ByCount")
|
||||
#define J1FA(Rc, PArray) \
|
||||
J_0I(Rc, (&(PArray)), Judy1FreeArray, "Judy1FreeArray")
|
||||
#define J1MU(Rc, PArray) \
|
||||
(Rc) = Judy1MemUsed(PArray)
|
||||
|
||||
#define JLG(PV,PArray,Index) \
|
||||
{ \
|
||||
extern const uint8_t j__L_LeafWOffset[]; \
|
||||
PWord_t P_L = (PWord_t)(PArray); \
|
||||
(PV) = (Pvoid_t) NULL; \
|
||||
if (P_L) /* cannot be a NULL pointer */ \
|
||||
{ \
|
||||
if (P_L[0] < 31) /* is a LeafL */ \
|
||||
{ \
|
||||
Word_t _pop1 = P_L[0] + 1; \
|
||||
Word_t _EIndex = P_L[_pop1]; \
|
||||
Word_t _off = j__L_LeafWOffset[_pop1] - 1; \
|
||||
if (_pop1 >= 16) \
|
||||
{ \
|
||||
if ((Index) > P_L[_pop1/2]) P_L += _pop1/2; \
|
||||
} \
|
||||
if ((Index) <= _EIndex) \
|
||||
{ \
|
||||
while((Index) > *(++P_L)); \
|
||||
if (*P_L == (Index)) (PV) = (Pvoid_t)(P_L+_off);\
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(PV) = (Pvoid_t)j__udyLGet((Pvoid_t)P_L, Index); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define JLI( PV, PArray, Index) \
|
||||
J_1P(PV, (&(PArray)), Index, JudyLIns, "JudyLIns")
|
||||
|
||||
#define JLIA(Rc, PArray, Count, PIndex, PValue) \
|
||||
J_3AI(Rc,(&(PArray)), Count, PIndex, PValue, JudyLInsArray, \
|
||||
"JudyLInsArray")
|
||||
#define JLD( Rc, PArray, Index) \
|
||||
J_1I(Rc, (&(PArray)), Index, JudyLDel, "JudyLDel")
|
||||
|
||||
#define JLF( PV, PArray, Index) \
|
||||
J_1P(PV, PArray, &(Index), JudyLFirst, "JudyLFirst")
|
||||
|
||||
#define JLN(PV,PArray,Index) \
|
||||
{ \
|
||||
extern const uint8_t j__L_LeafWOffset[]; \
|
||||
PWord_t P_L = (PWord_t) (PArray); \
|
||||
\
|
||||
(PV) = (Pvoid_t) NULL; \
|
||||
\
|
||||
if (P_L) /* cannot be a NULL pointer */ \
|
||||
{ \
|
||||
if (P_L[0] < 31) /* is a LeafL */ \
|
||||
{ \
|
||||
Word_t _pop1 = P_L[0] + 1; \
|
||||
Word_t _off = j__L_LeafWOffset[_pop1] -1; \
|
||||
if ((Index) < P_L[_pop1]) \
|
||||
{ \
|
||||
while(1) \
|
||||
{ \
|
||||
if ((Index) < *(++P_L)) \
|
||||
{ \
|
||||
(Index) = *P_L; \
|
||||
(PV) = (Pvoid_t) (P_L + _off); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
(PV) = (Pvoid_t)JudyLNext((Pvoid_t) PArray, &(Index), PJE0); \
|
||||
} \
|
||||
} \
|
||||
}
|
||||
|
||||
#define JLL( PV, PArray, Index) \
|
||||
J_1P(PV, PArray, &(Index), JudyLLast, "JudyLLast")
|
||||
#define JLP( PV, PArray, Index) \
|
||||
J_1P(PV, PArray, &(Index), JudyLPrev, "JudyLPrev")
|
||||
#define JLFE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), JudyLFirstEmpty, "JudyLFirstEmpty")
|
||||
#define JLNE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), JudyLNextEmpty, "JudyLNextEmpty")
|
||||
#define JLLE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), JudyLLastEmpty, "JudyLLastEmpty")
|
||||
#define JLPE(Rc, PArray, Index) \
|
||||
J_1I(Rc, PArray, &(Index), JudyLPrevEmpty, "JudyLPrevEmpty")
|
||||
#define JLC( Rc, PArray, Index1, Index2) \
|
||||
J_2C(Rc, PArray, Index1, Index2, JudyLCount, "JudyLCount")
|
||||
#define JLBC(PV, PArray, Count, Index) \
|
||||
J_2P(PV, PArray, Count, &(Index), JudyLByCount, "JudyLByCount")
|
||||
#define JLFA(Rc, PArray) \
|
||||
J_0I(Rc, (&(PArray)), JudyLFreeArray, "JudyLFreeArray")
|
||||
#define JLMU(Rc, PArray) \
|
||||
(Rc) = JudyLMemUsed(PArray)
|
||||
|
||||
#define JHSI(PV, PArray, PIndex, Count) \
|
||||
J_2P(PV, (&(PArray)), PIndex, Count, JudyHSIns, "JudyHSIns")
|
||||
#define JHSG(PV, PArray, PIndex, Count) \
|
||||
(PV) = (Pvoid_t) JudyHSGet(PArray, PIndex, Count)
|
||||
#define JHSD(Rc, PArray, PIndex, Count) \
|
||||
J_2I(Rc, (&(PArray)), PIndex, Count, JudyHSDel, "JudyHSDel")
|
||||
#define JHSFA(Rc, PArray) \
|
||||
J_0I(Rc, (&(PArray)), JudyHSFreeArray, "JudyHSFreeArray")
|
||||
|
||||
#define JSLG( PV, PArray, Index) \
|
||||
J_1P( PV, PArray, Index, JudySLGet, "JudySLGet")
|
||||
#define JSLI( PV, PArray, Index) \
|
||||
J_1P( PV, (&(PArray)), Index, JudySLIns, "JudySLIns")
|
||||
#define JSLD( Rc, PArray, Index) \
|
||||
J_1I( Rc, (&(PArray)), Index, JudySLDel, "JudySLDel")
|
||||
#define JSLF( PV, PArray, Index) \
|
||||
J_1P( PV, PArray, Index, JudySLFirst, "JudySLFirst")
|
||||
#define JSLN( PV, PArray, Index) \
|
||||
J_1P( PV, PArray, Index, JudySLNext, "JudySLNext")
|
||||
#define JSLL( PV, PArray, Index) \
|
||||
J_1P( PV, PArray, Index, JudySLLast, "JudySLLast")
|
||||
#define JSLP( PV, PArray, Index) \
|
||||
J_1P( PV, PArray, Index, JudySLPrev, "JudySLPrev")
|
||||
#define JSLFA(Rc, PArray) \
|
||||
J_0I( Rc, (&(PArray)), JudySLFreeArray, "JudySLFreeArray")
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ! _JUDY_INCLUDED */
|
Binary file not shown.
|
@ -1,50 +0,0 @@
|
|||
#ifndef _JUDYEX_INCLUDED
|
||||
#define _JUDYEX_INCLUDED
|
||||
|
||||
#include <exception>
|
||||
|
||||
class JudyEx
|
||||
{
|
||||
private:
|
||||
char* ex_message;
|
||||
bool fatal;
|
||||
|
||||
public:
|
||||
|
||||
JudyEx() { ex_message = NULL; fatal = true; }
|
||||
JudyEx(char* set, bool isfatal)
|
||||
{
|
||||
ex_message = new char[strlen(set) + 1];
|
||||
strcpy(ex_message, set);
|
||||
|
||||
fatal = isfatal;
|
||||
}
|
||||
|
||||
JudyEx(const JudyEx ©)
|
||||
{
|
||||
ex_message = new char[strlen(copy.ex_message) + 1];
|
||||
strcpy(ex_message, copy.ex_message);
|
||||
|
||||
fatal = copy.fatal;
|
||||
}
|
||||
|
||||
~JudyEx() { delete ex_message; }
|
||||
|
||||
void Destroy() { delete ex_message; }
|
||||
|
||||
void SetIsFatal(bool isfatal) { fatal = isfatal; }
|
||||
bool IsFatal( void ) { return fatal; }
|
||||
|
||||
char* SetErrorMessage(char* set)
|
||||
{
|
||||
ex_message = new char[strlen(set) + 1];
|
||||
strcpy(ex_message, set);
|
||||
}
|
||||
|
||||
char* ErrorMessage( void )
|
||||
{
|
||||
return ex_message;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,313 +0,0 @@
|
|||
#include "JudyExtra.h"
|
||||
#include "CBinTrie.h"
|
||||
|
||||
bool JudyClearMasterTrie(CBaseList* master)
|
||||
{
|
||||
cell master_iten = NULL;
|
||||
BinTrie* Storage = NULL;
|
||||
|
||||
try { master_iten = master->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<BinTrie*>(master->Get(master_iten) ); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
Storage->Remove();
|
||||
|
||||
try { master->Delete(master_iten); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
try { master_iten = master->Next(master_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudyClearBinTrie(BinTrie* trie)
|
||||
{
|
||||
Word_t trie_iten = NULL;
|
||||
|
||||
try { trie_iten = trie->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
trie->Delete(trie_iten);
|
||||
|
||||
try { trie_iten = trie->Next(trie_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudySaveBinTrie(BinTrie* trie, char* file)
|
||||
{
|
||||
Word_t trie_iten = NULL;
|
||||
|
||||
try { trie_iten = trie->First(); }
|
||||
catch(JudyEx e) { return false; }
|
||||
|
||||
FILE *trieDB = fopen(file,"wb");
|
||||
if (!trieDB) return false;
|
||||
|
||||
bool value = false;
|
||||
|
||||
while( true )
|
||||
{
|
||||
fwrite(&trie_iten, sizeof(Word_t), 1, trieDB);
|
||||
|
||||
value = (trie->Get(trie_iten) != NULL);
|
||||
fwrite(&value, sizeof(bool), 1, trieDB);
|
||||
|
||||
try { trie_iten = trie->Next(trie_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
fclose(trieDB);
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudyLoadBinTrie(BinTrie* trie, char* file)
|
||||
{
|
||||
FILE *trieDB = fopen(file, "ab+");
|
||||
if (!trieDB) return false;
|
||||
|
||||
Word_t trie_iten = NULL;
|
||||
|
||||
bool value = false;
|
||||
|
||||
while(!feof(trieDB))
|
||||
{
|
||||
fread(&trie_iten, sizeof(Word_t), 1, trieDB);
|
||||
if (feof(trieDB) || ferror(trieDB)) break;
|
||||
|
||||
fread(&value, sizeof(bool), 1, trieDB);
|
||||
|
||||
trie->Set(trie_iten,value);
|
||||
}
|
||||
|
||||
fclose(trieDB);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JudyClearMasterList(CBaseList* master)
|
||||
{
|
||||
cell master_iten = NULL;
|
||||
CBaseList* Storage = NULL;
|
||||
|
||||
try { master_iten = master->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<CBaseList*>(master->Get(master_iten) ); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
Storage->Remove();
|
||||
|
||||
try { master->Delete(master_iten); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
try { master_iten = master->Next(master_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudyClearList(CBaseList* list)
|
||||
{
|
||||
Word_t list_iten = NULL;
|
||||
Capsule* Storage = NULL;
|
||||
|
||||
try { list_iten = list->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<Capsule*>(list->Get(list_iten) ); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
Storage->Remove();
|
||||
|
||||
try { list->Delete(list_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
try { list_iten = list->Next(list_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudySaveList(CBaseList* list, char* file)
|
||||
{
|
||||
Capsule* Storage = NULL;
|
||||
Word_t list_iten = NULL;
|
||||
bool no_error = true;
|
||||
|
||||
try { list_iten = list->First(); }
|
||||
catch(JudyEx e) { return false; }
|
||||
|
||||
FILE* listDB = fopen(file,"wb");
|
||||
if (!listDB) return false;
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<Capsule*>(list->Get(list_iten) ); }
|
||||
catch(JudyEx& e) { no_error = false; break; }
|
||||
|
||||
fwrite(&list_iten, sizeof(Word_t), 1, listDB);
|
||||
try { Storage->Save(listDB); }
|
||||
catch(JudyEx& e) { no_error = false; break; }
|
||||
|
||||
try { list_iten = list->Next(list_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
fclose(listDB);
|
||||
return no_error;
|
||||
};
|
||||
|
||||
bool JudyLoadList(CBaseList* list, char* file)
|
||||
{
|
||||
FILE *listDB = fopen(file, "ab+");
|
||||
if (!listDB) return false;
|
||||
|
||||
Capsule* Storage = NULL;
|
||||
Word_t list_iten = NULL;
|
||||
bool no_error = true;
|
||||
|
||||
while(!feof(listDB))
|
||||
{
|
||||
fread(&list_iten, sizeof(Word_t), 1, listDB);
|
||||
if (feof(listDB) || ferror(listDB)) break;
|
||||
|
||||
Storage = new Capsule;
|
||||
try { Storage->Load(listDB); }
|
||||
catch(JudyEx& e) { no_error = false; break; }
|
||||
|
||||
list->Set(list_iten,Storage);
|
||||
}
|
||||
|
||||
fclose(listDB);
|
||||
return no_error;
|
||||
}
|
||||
|
||||
bool JudyClearMasterMap(CBaseList* master)
|
||||
{
|
||||
cell master_iten = NULL;
|
||||
CBaseMap* Storage = NULL;
|
||||
|
||||
try { master_iten = master->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<CBaseMap*>(master->Get(master_iten) ); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
Storage->Remove();
|
||||
|
||||
try { master->Delete(master_iten); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
try { master_iten = master->Next(master_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
bool JudyClearMap(CBaseMap* map)
|
||||
{
|
||||
char* map_iten = NULL;
|
||||
Capsule* Storage = NULL;
|
||||
|
||||
try { map_iten = map->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<Capsule*>(map->Get(map_iten) ); }
|
||||
catch(JudyEx& e) { break; }
|
||||
|
||||
Storage->Remove();
|
||||
|
||||
try { map->Delete(map_iten); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
try { map_iten = map->Next(map_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
bool JudySaveMap(CBaseMap* map, char* file)
|
||||
{
|
||||
Capsule* Storage = NULL;
|
||||
char* map_iten = NULL;
|
||||
size_t key_len = NULL;
|
||||
bool no_error = true;
|
||||
|
||||
try { map_iten = map->First(); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
FILE *mapDB = fopen(file,"wb");
|
||||
if (!mapDB) return false;
|
||||
|
||||
while( true )
|
||||
{
|
||||
try { Storage = reinterpret_cast<Capsule*>(map->Get(map_iten) ); }
|
||||
catch(JudyEx& e) { return false; }
|
||||
|
||||
key_len = strlen(map_iten);
|
||||
|
||||
fwrite(&key_len, sizeof(size_t), 1, mapDB);
|
||||
fwrite(&map_iten, sizeof(char), strlen(map_iten), mapDB);
|
||||
|
||||
try { Storage->Save(mapDB); }
|
||||
catch(JudyEx& e) { no_error = false; break; }
|
||||
|
||||
try { map_iten = map->Next(map_iten); }
|
||||
catch(JudyEx& e) { break; }
|
||||
}
|
||||
|
||||
fclose(mapDB);
|
||||
return no_error;
|
||||
};
|
||||
|
||||
bool JudyLoadMap(CBaseMap* map, char* file)
|
||||
{
|
||||
FILE *mapDB = fopen(file, "ab+");
|
||||
if (!mapDB) return false;
|
||||
|
||||
Capsule* Storage = NULL;
|
||||
char* map_iten = NULL;
|
||||
size_t key_len = NULL;
|
||||
bool no_error = true;
|
||||
|
||||
while(!feof(mapDB))
|
||||
{
|
||||
fread(&key_len,sizeof(size_t),1,mapDB);
|
||||
|
||||
map_iten = new char[key_len+1];
|
||||
fgets(map_iten, key_len+1, mapDB);
|
||||
|
||||
if (feof(mapDB) || ferror(mapDB)) break;
|
||||
|
||||
Storage = new Capsule;
|
||||
try { Storage->Load(mapDB); }
|
||||
catch(JudyEx& e) { no_error = false; break; }
|
||||
|
||||
map->Set(map_iten,Storage);
|
||||
delete map_iten;
|
||||
}
|
||||
|
||||
fclose(mapDB);
|
||||
return no_error;
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef _JUDYARRAY_SHARED_INCLUDED
|
||||
#define _JUDYARRAY_SHARED_INCLUDED
|
||||
|
||||
#include "CBaseList.h"
|
||||
#include "CBaseMap.h"
|
||||
|
||||
class BinTrie;
|
||||
|
||||
extern bool JudyClearMasterTrie(CBaseList* master);
|
||||
extern bool JudyClearBinTrie(BinTrie* trie);
|
||||
extern bool JudySaveBinTrie(BinTrie* trie, char* file);
|
||||
extern bool JudyLoadBinTrie(BinTrie* trie, char* file);
|
||||
|
||||
extern bool JudyClearMasterList(CBaseList* master);
|
||||
extern bool JudyClearList(CBaseList* list);
|
||||
extern bool JudySaveList(CBaseList* list, char* file);
|
||||
extern bool JudyLoadList(CBaseList* list, char* file);
|
||||
|
||||
extern bool JudyClearMasterMap(CBaseList* master);
|
||||
extern bool JudyClearMap(CBaseMap* map);
|
||||
extern bool JudySaveMap(CBaseMap* array, char* file);
|
||||
extern bool JudyLoadMap(CBaseMap* array, char* file);
|
||||
|
||||
#endif
|
|
@ -1,43 +0,0 @@
|
|||
#ifndef _JUDYINC_INCLUDED
|
||||
#define _JUDYINC_INCLUDED
|
||||
|
||||
#include "osdefs.h"
|
||||
//#include <extdll.h>
|
||||
|
||||
#ifndef __linux__
|
||||
#define JU_WIN
|
||||
#endif
|
||||
|
||||
#ifdef __WIN32__
|
||||
#define JU_WIN
|
||||
#endif
|
||||
|
||||
#define JUDYERROR_NOTEST 1
|
||||
#include "Judy.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "amxxmodule.h"
|
||||
|
||||
#include "JudyVar.h"
|
||||
#include "JudyVec.h"
|
||||
#include "JudyEx.h"
|
||||
|
||||
#include "Capsule.h"
|
||||
|
||||
#endif
|
|
@ -1,70 +0,0 @@
|
|||
#ifndef _JUDYVAR_H
|
||||
#define _JUDYVAR_H
|
||||
|
||||
#if defined HAVE_STDINT_H
|
||||
//#include <stdint.h>
|
||||
#else
|
||||
#if defined __LCC__ || defined __DMC__ || defined LINUX
|
||||
#if defined HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||
* here, these types are probably undefined.
|
||||
*/
|
||||
#if defined __MACH__
|
||||
#include <ppc/types.h>
|
||||
typedef unsigned short int uint16_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#elif defined __FreeBSD__
|
||||
#include <inttypes.h>
|
||||
#else
|
||||
typedef short int int16_t;
|
||||
typedef unsigned short int uint16_t;
|
||||
#if defined SN_TARGET_PS2
|
||||
typedef int int32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
#else
|
||||
typedef long int int32_t;
|
||||
typedef unsigned long int uint32_t;
|
||||
#endif
|
||||
#if defined __WIN32__ || defined _WIN32 || defined WIN32
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#define HAVE_I64
|
||||
#elif defined __GNUC__
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#define HAVE_I64
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined _LP64 || defined WIN64 || defined _WIN64
|
||||
#if !defined __64BIT__
|
||||
#define __64BIT__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined PAWN_CELL_SIZE
|
||||
#define PAWN_CELL_SIZE 32 /* by default, use 32-bit cells */
|
||||
#endif
|
||||
#if PAWN_CELL_SIZE==16
|
||||
typedef uint16_t ucell;
|
||||
typedef int16_t cell;
|
||||
#elif PAWN_CELL_SIZE==32
|
||||
typedef uint32_t ucell;
|
||||
typedef int32_t cell;
|
||||
#define REAL float
|
||||
#elif PAWN_CELL_SIZE==64
|
||||
typedef uint64_t ucell;
|
||||
typedef int64_t cell;
|
||||
#define REAL double
|
||||
#else
|
||||
#error Unsupported cell size (PAWN_CELL_SIZE)
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -1,20 +0,0 @@
|
|||
#ifndef _JUDYVEC_INCLUDED
|
||||
#define _JUDYVEC_INCLUDED
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
class JudyVec
|
||||
{
|
||||
public:
|
||||
REAL first;
|
||||
REAL second;
|
||||
REAL third;
|
||||
|
||||
JudyVec(REAL one, REAL two, REAL three) { Set(one, two, three); }
|
||||
~JudyVec() {}
|
||||
|
||||
void Get(REAL& one, REAL& two, REAL& three) { one = first; two = second; three = third; }
|
||||
void Set(REAL one, REAL two, REAL three) { first = one; second = two; third = three; }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,114 +0,0 @@
|
|||
#ifndef _LIST_NATIVE_FUNC_INC_H
|
||||
#define _LIST_NATIVE_FUNC_INC_H
|
||||
|
||||
#define JUDY_GLUE_FUNC( x , y ) x ## y
|
||||
|
||||
#define JUDY_GLUE_STR( x, y ) #x#y
|
||||
|
||||
#define JUDY_MASTER_EDIT_FUNCTIONS
|
||||
#define JUDY_MASTER_CLEAR_FUNC JUDY_GLUE_FUNC( list , _clear )
|
||||
#define JUDY_MASTER_CLEAR_STR JUDY_GLUE_STR ( list , _clear )
|
||||
|
||||
#define JUDY_MASTER_DELETE_FUNC JUDY_GLUE_FUNC( list , _delete )
|
||||
#define JUDY_MASTER_DELETE_STR JUDY_GLUE_STR ( list , _delete )
|
||||
|
||||
#define JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
#define JUDY_MASTER_SAVE_FUNC JUDY_GLUE_FUNC( list , _save )
|
||||
#define JUDY_MASTER_SAVE_STR JUDY_GLUE_STR ( list , _save )
|
||||
#define JUDY_SAVE_FUNC(list, file) JudySaveList ( list , file )
|
||||
|
||||
#define JUDY_MASTER_LOAD_FUNC JUDY_GLUE_FUNC( list , _load )
|
||||
#define JUDY_MASTER_LOAD_STR JUDY_GLUE_STR ( list , _load )
|
||||
#define JUDY_LOAD_FUNC(list, file) JudyLoadList ( list , file )
|
||||
|
||||
#define JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
#define JUDY_MASTER_COUNT_FUNC JUDY_GLUE_FUNC( list , _count )
|
||||
#define JUDY_MASTER_COUNT_STR JUDY_GLUE_STR ( list , _count )
|
||||
|
||||
#define JUDY_MASTER_BYCOUNT_FUNC JUDY_GLUE_FUNC( list , _bycount )
|
||||
#define JUDY_MASTER_BYCOUNT_STR JUDY_GLUE_STR ( list , _bycount )
|
||||
|
||||
#define JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
#define JUDY_SLAVE_COUNT_FUNC JUDY_GLUE_FUNC( list , _size )
|
||||
#define JUDY_SLAVE_COUNT_STR JUDY_GLUE_STR ( list , _size )
|
||||
|
||||
#define JUDY_SLAVE_BYCOUNT_FUNC JUDY_GLUE_FUNC( list , _get_nth )
|
||||
#define JUDY_SLAVE_BYCOUNT_STR JUDY_GLUE_STR ( list , _get_nth )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
#define JUDY_SLAVE_MEMORY_FUNC JUDY_GLUE_FUNC( list , _memory )
|
||||
#define JUDY_SLAVE_MEMORY_STR JUDY_GLUE_STR ( list , _memory )
|
||||
|
||||
#define JUDY_SLAVE_ISFILLED_FUNC JUDY_GLUE_FUNC( list , _isfilled )
|
||||
#define JUDY_SLAVE_ISFILLED_STR JUDY_GLUE_STR ( list , _isfilled )
|
||||
|
||||
#define JUDY_SLAVE_ISEMPTY_FUNC JUDY_GLUE_FUNC( list , _isempty )
|
||||
#define JUDY_SLAVE_ISEMPTY_STR JUDY_GLUE_STR ( list , _isempty )
|
||||
|
||||
#define JUDY_SLAVE_REMOVE_FUNC JUDY_GLUE_FUNC( list , _remove )
|
||||
#define JUDY_SLAVE_REMOVE_STR JUDY_GLUE_STR ( list , _remove )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_BOOL
|
||||
#define JUDY_SLAVE_GET_BOOL_FUNC JUDY_GLUE_FUNC( list , _get_bool )
|
||||
#define JUDY_SLAVE_SET_BOOL_FUNC JUDY_GLUE_FUNC( list , _set_bool )
|
||||
|
||||
#define JUDY_SLAVE_GET_BOOL_STR JUDY_GLUE_STR ( list , _get_bool )
|
||||
#define JUDY_SLAVE_SET_BOOL_STR JUDY_GLUE_STR ( list , _set_bool )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_INT
|
||||
#define JUDY_SLAVE_GET_INT_FUNC JUDY_GLUE_FUNC( list , _get_int )
|
||||
#define JUDY_SLAVE_SET_INT_FUNC JUDY_GLUE_FUNC( list , _set_int )
|
||||
|
||||
#define JUDY_SLAVE_GET_INT_STR JUDY_GLUE_STR ( list , _get_int )
|
||||
#define JUDY_SLAVE_SET_INT_STR JUDY_GLUE_STR ( list , _set_int )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FLO
|
||||
#define JUDY_SLAVE_GET_FLO_FUNC JUDY_GLUE_FUNC( list , _get_float )
|
||||
#define JUDY_SLAVE_SET_FLO_FUNC JUDY_GLUE_FUNC( list , _set_float )
|
||||
|
||||
#define JUDY_SLAVE_GET_FLO_STR JUDY_GLUE_STR ( list , _get_float )
|
||||
#define JUDY_SLAVE_SET_FLO_STR JUDY_GLUE_STR ( list , _set_float )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_STR
|
||||
#define JUDY_SLAVE_GET_STR_FUNC JUDY_GLUE_FUNC( list , _get_string )
|
||||
#define JUDY_SLAVE_SET_STR_FUNC JUDY_GLUE_FUNC( list , _set_string )
|
||||
|
||||
#define JUDY_SLAVE_GET_STR_STR JUDY_GLUE_STR ( list , _get_string )
|
||||
#define JUDY_SLAVE_SET_STR_STR JUDY_GLUE_STR ( list , _set_string )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_VEC
|
||||
#define JUDY_SLAVE_GET_VEC_FUNC JUDY_GLUE_FUNC( list , _get_vector )
|
||||
#define JUDY_SLAVE_SET_VEC_FUNC JUDY_GLUE_FUNC( list , _set_vector )
|
||||
|
||||
#define JUDY_SLAVE_GET_VEC_STR JUDY_GLUE_STR ( list , _get_vector )
|
||||
#define JUDY_SLAVE_SET_VEC_STR JUDY_GLUE_STR ( list , _set_vector )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
#define JUDY_SLAVE_FIRST_FUNC JUDY_GLUE_FUNC( list , _first )
|
||||
#define JUDY_SLAVE_LAST_FUNC JUDY_GLUE_FUNC( list , _last )
|
||||
|
||||
#define JUDY_SLAVE_FIRST_STR JUDY_GLUE_STR ( list , _first )
|
||||
#define JUDY_SLAVE_LAST_STR JUDY_GLUE_STR ( list , _last )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_FUNC JUDY_GLUE_FUNC( list , _next )
|
||||
#define JUDY_SLAVE_PREV_FUNC JUDY_GLUE_FUNC( list , _prev )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_STR JUDY_GLUE_STR ( list , _next )
|
||||
#define JUDY_SLAVE_PREV_STR JUDY_GLUE_STR ( list , _prev )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
#define JUDY_SLAVE_FIRSTEMPTY_FUNC JUDY_GLUE_FUNC( list , _firstempty )
|
||||
#define JUDY_SLAVE_LASTEMPTY_FUNC JUDY_GLUE_FUNC( list , _lastempty )
|
||||
|
||||
#define JUDY_SLAVE_FIRSTEMPTY_STR JUDY_GLUE_STR ( list , _firstempty )
|
||||
#define JUDY_SLAVE_LASTEMPTY_STR JUDY_GLUE_STR ( list , _lastempty )
|
||||
|
||||
#define JUDY_SLAVE_NEXTEMPTY_FUNC JUDY_GLUE_FUNC( list , _nextempty )
|
||||
#define JUDY_SLAVE_PREVEMPTY_FUNC JUDY_GLUE_FUNC( list , _prevempty )
|
||||
|
||||
#define JUDY_SLAVE_NEXTEMPTY_STR JUDY_GLUE_STR ( list , _nextempty )
|
||||
#define JUDY_SLAVE_PREVEMPTY_STR JUDY_GLUE_STR ( list , _prevempty )
|
||||
#endif
|
|
@ -1,43 +0,0 @@
|
|||
#include "CBaseList.h"
|
||||
#include "CArray.h"
|
||||
#include "ComboArray.h"
|
||||
|
||||
#define KEY_TYPE cell
|
||||
#define DYNAMIC_UNIT_TYPE CBaseList
|
||||
#define STORAGE_TYPE Capsule
|
||||
#define MASTER_NAME MasterList
|
||||
#define EXPORT_NAME list_exports
|
||||
|
||||
#define SEARCH_ERROR_OFFSET 0
|
||||
|
||||
#define GET_KEY(params, num) params[num]
|
||||
#define SET_KEY(stuff, parameter) stuff
|
||||
|
||||
#include "ListNativeFunctions.h"
|
||||
#include "NativeIncludes.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL array_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit;
|
||||
M_ITYPE Index = params[1];
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,Array,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL comboarray_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit;
|
||||
M_ITYPE Index = params[1];
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,ComboArray,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO list_creation_exports[] =
|
||||
{
|
||||
{ "array_create", array_create },
|
||||
{ "comboarray_create", comboarray_create },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
|
@ -1,94 +0,0 @@
|
|||
#ifndef _MAP_NATIVE_FUNC_INC_H
|
||||
#define _MAP_NATIVE_FUNC_INC_H
|
||||
|
||||
#define JUDY_GLUE_FUNC( x , y ) x ## y
|
||||
|
||||
#define JUDY_GLUE_STR( x, y ) #x#y
|
||||
|
||||
#define JUDY_MASTER_EDIT_FUNCTIONS
|
||||
#define JUDY_MASTER_CLEAR_FUNC JUDY_GLUE_FUNC( map , _clear )
|
||||
#define JUDY_MASTER_CLEAR_STR JUDY_GLUE_STR ( map , _clear )
|
||||
|
||||
#define JUDY_MASTER_DELETE_FUNC JUDY_GLUE_FUNC( map , _delete )
|
||||
#define JUDY_MASTER_DELETE_STR JUDY_GLUE_STR ( map , _delete )
|
||||
|
||||
#define JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
#define JUDY_MASTER_SAVE_FUNC JUDY_GLUE_FUNC( map , _save )
|
||||
#define JUDY_MASTER_SAVE_STR JUDY_GLUE_STR ( map , _save )
|
||||
#define JUDY_SAVE_FUNC(map, file) JudySaveMap ( map , file )
|
||||
|
||||
#define JUDY_MASTER_LOAD_FUNC JUDY_GLUE_FUNC( map , _load )
|
||||
#define JUDY_MASTER_LOAD_STR JUDY_GLUE_STR ( map , _load )
|
||||
#define JUDY_LOAD_FUNC(map, file) JudyLoadMap ( map , file )
|
||||
|
||||
#define JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
#define JUDY_MASTER_COUNT_FUNC JUDY_GLUE_FUNC( map , _count )
|
||||
#define JUDY_MASTER_COUNT_STR JUDY_GLUE_STR ( map , _count )
|
||||
|
||||
#define JUDY_MASTER_BYCOUNT_FUNC JUDY_GLUE_FUNC( map , _bycount )
|
||||
#define JUDY_MASTER_BYCOUNT_STR JUDY_GLUE_STR ( map , _bycount )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
#define JUDY_SLAVE_MEMORY_FUNC JUDY_GLUE_FUNC( map , _memory )
|
||||
#define JUDY_SLAVE_MEMORY_STR JUDY_GLUE_STR ( map , _memory )
|
||||
|
||||
#define JUDY_SLAVE_ISFILLED_FUNC JUDY_GLUE_FUNC( map , _isfilled )
|
||||
#define JUDY_SLAVE_ISFILLED_STR JUDY_GLUE_STR ( map , _isfilled )
|
||||
|
||||
#define JUDY_SLAVE_ISEMPTY_FUNC JUDY_GLUE_FUNC( map , _isempty )
|
||||
#define JUDY_SLAVE_ISEMPTY_STR JUDY_GLUE_STR ( map , _isempty )
|
||||
|
||||
#define JUDY_SLAVE_REMOVE_FUNC JUDY_GLUE_FUNC( map , _remove )
|
||||
#define JUDY_SLAVE_REMOVE_STR JUDY_GLUE_STR ( map , _remove )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_BOOL
|
||||
#define JUDY_SLAVE_GET_BOOL_FUNC JUDY_GLUE_FUNC( map , _get_bool )
|
||||
#define JUDY_SLAVE_SET_BOOL_FUNC JUDY_GLUE_FUNC( map , _set_bool )
|
||||
|
||||
#define JUDY_SLAVE_GET_BOOL_STR JUDY_GLUE_STR ( map , _get_bool )
|
||||
#define JUDY_SLAVE_SET_BOOL_STR JUDY_GLUE_STR ( map , _set_bool )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_INT
|
||||
#define JUDY_SLAVE_GET_INT_FUNC JUDY_GLUE_FUNC( map , _get_int )
|
||||
#define JUDY_SLAVE_SET_INT_FUNC JUDY_GLUE_FUNC( map , _set_int )
|
||||
|
||||
#define JUDY_SLAVE_GET_INT_STR JUDY_GLUE_STR ( map , _get_int )
|
||||
#define JUDY_SLAVE_SET_INT_STR JUDY_GLUE_STR ( map , _set_int )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FLO
|
||||
#define JUDY_SLAVE_GET_FLO_FUNC JUDY_GLUE_FUNC( map , _get_float )
|
||||
#define JUDY_SLAVE_SET_FLO_FUNC JUDY_GLUE_FUNC( map , _set_float )
|
||||
|
||||
#define JUDY_SLAVE_GET_FLO_STR JUDY_GLUE_STR ( map , _get_float )
|
||||
#define JUDY_SLAVE_SET_FLO_STR JUDY_GLUE_STR ( map , _set_float )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_STR
|
||||
#define JUDY_SLAVE_GET_STR_FUNC JUDY_GLUE_FUNC( map , _get_string )
|
||||
#define JUDY_SLAVE_SET_STR_FUNC JUDY_GLUE_FUNC( map , _set_string )
|
||||
|
||||
#define JUDY_SLAVE_GET_STR_STR JUDY_GLUE_STR ( map , _get_string )
|
||||
#define JUDY_SLAVE_SET_STR_STR JUDY_GLUE_STR ( map , _set_string )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_VEC
|
||||
#define JUDY_SLAVE_GET_VEC_FUNC JUDY_GLUE_FUNC( map , _get_vector )
|
||||
#define JUDY_SLAVE_SET_VEC_FUNC JUDY_GLUE_FUNC( map , _set_vector )
|
||||
|
||||
#define JUDY_SLAVE_GET_VEC_STR JUDY_GLUE_STR ( map , _get_vector )
|
||||
#define JUDY_SLAVE_SET_VEC_STR JUDY_GLUE_STR ( map , _set_vector )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
#define JUDY_SLAVE_FIRST_FUNC JUDY_GLUE_FUNC( map , _first )
|
||||
#define JUDY_SLAVE_LAST_FUNC JUDY_GLUE_FUNC( map , _last )
|
||||
|
||||
#define JUDY_SLAVE_FIRST_STR JUDY_GLUE_STR ( map , _first )
|
||||
#define JUDY_SLAVE_LAST_STR JUDY_GLUE_STR ( map , _last )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_FUNC JUDY_GLUE_FUNC( map , _next )
|
||||
#define JUDY_SLAVE_PREV_FUNC JUDY_GLUE_FUNC( map , _prev )
|
||||
|
||||
#define JUDY_SLAVE_NEXT_STR JUDY_GLUE_STR ( map , _next )
|
||||
#define JUDY_SLAVE_PREV_STR JUDY_GLUE_STR ( map , _prev )
|
||||
|
||||
#endif
|
|
@ -1,54 +0,0 @@
|
|||
#include "CBaseMap.h"
|
||||
#include "CKeytable.h"
|
||||
#include "ComboTable.h"
|
||||
#include "CHashtable.h"
|
||||
|
||||
#define KEY_TYPE char*
|
||||
#define DYNAMIC_UNIT_TYPE CBaseMap
|
||||
#define STORAGE_TYPE Capsule
|
||||
#define MASTER_NAME MasterMap
|
||||
#define EXPORT_NAME map_exports
|
||||
|
||||
#define SEARCH_ERROR_OFFSET 2
|
||||
|
||||
#define GET_KEY(params, num) MF_GetAmxString(amx,params[num],num,NULL)
|
||||
#define SET_KEY(str, num) MF_SetAmxString(amx,params[num],str,params[num + 1])
|
||||
|
||||
#include "MapNativeFunctions.h"
|
||||
#include "NativeIncludes.h"
|
||||
|
||||
static cell AMX_NATIVE_CALL keytable_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
M_ITYPE Index = NULL;
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,Keytable,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL combotable_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
M_ITYPE Index = NULL;
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,ComboTable,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL hashtable_create(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit;
|
||||
M_ITYPE Index = params[1];
|
||||
|
||||
JUDY_CREATE_INDEX(MNAME,Unit,Hashtable,Index);
|
||||
return Index;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO map_creation_exports[] =
|
||||
{
|
||||
{ "keytable_create", keytable_create },
|
||||
{ "combotable_create", combotable_create },
|
||||
{ "hashtable_create", hashtable_create },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
|
@ -1,130 +0,0 @@
|
|||
#ifndef _NATIVE_INC_H
|
||||
#define _NATIVE_INC_H
|
||||
|
||||
#include "ComboArray.h"
|
||||
|
||||
#ifndef SEARCH_ERROR_OFFSET
|
||||
#define SEARCH_ERROR_OFFSET 0
|
||||
#endif
|
||||
|
||||
#define SE_OFFSET SEARCH_ERROR_OFFSET
|
||||
|
||||
#ifndef STORAGE_TYPE
|
||||
#error No storage type declared
|
||||
#endif
|
||||
|
||||
#define STYPE STORAGE_TYPE
|
||||
|
||||
#ifndef KEY_TYPE
|
||||
#error No key type declared
|
||||
#endif
|
||||
|
||||
#define ITYPE KEY_TYPE
|
||||
|
||||
#ifndef DYNAMIC_UNIT_TYPE
|
||||
#error No Dynamic type declared
|
||||
#endif
|
||||
|
||||
#define DTYPE DYNAMIC_UNIT_TYPE
|
||||
|
||||
#ifndef MASTER_NAME
|
||||
#error No master name declared
|
||||
#endif
|
||||
|
||||
#define MNAME MASTER_NAME
|
||||
#define M_ITYPE cell
|
||||
|
||||
#ifndef GET_KEY
|
||||
#error No method of getting keys has been declared
|
||||
#endif
|
||||
|
||||
#ifndef EXPORT_NAME
|
||||
#define EXPORT_NAME MNAME_exports
|
||||
#endif
|
||||
|
||||
#define SE_OFFSET SEARCH_ERROR_OFFSET
|
||||
|
||||
#define JUDY_GET_KEY GET_KEY
|
||||
|
||||
#ifndef SET_KEY
|
||||
#error No method of setting keys has been declared
|
||||
#endif
|
||||
|
||||
#define JUDY_SET_KEY SET_KEY
|
||||
|
||||
#ifndef JUDY_ERROR_CATCH
|
||||
#define JUDY_ERROR_CATCH(x_str) \
|
||||
catch(JudyEx& e) \
|
||||
{ \
|
||||
if(e.IsFatal() )\
|
||||
{\
|
||||
MF_LogError(amx,AMX_ERR_NATIVE, "%s || Judy Error: %s", x_str, e.ErrorMessage());\
|
||||
return NULL;\
|
||||
};\
|
||||
return NULL;\
|
||||
}\
|
||||
catch(...) { MF_LogError(amx,AMX_ERR_NATIVE,"Unknown error occured, please post a bug report at www.amxmodx.org/forums"); return NULL; }
|
||||
#endif
|
||||
|
||||
#ifndef JUDY_SEARCH_ERROR_CATCH
|
||||
#define JUDY_SEARCH_ERROR_CATCH(x_str, success) \
|
||||
catch(JudyEx& e) \
|
||||
{ \
|
||||
if(e.IsFatal() )\
|
||||
{\
|
||||
MF_LogError(amx,AMX_ERR_NATIVE, "%s || Judy Error: %s", x_str, e.ErrorMessage());\
|
||||
return NULL;\
|
||||
};\
|
||||
return (success = 0);\
|
||||
}\
|
||||
catch(...) { MF_LogError(amx,AMX_ERR_NATIVE,"Unknown error occured, please post a bug report at www.amxmodx.org/forums"); return NULL; }
|
||||
#endif
|
||||
|
||||
#ifndef JUDY_CREATE_INDEX
|
||||
#define JUDY_CREATE_INDEX(master, slave, slave_type, index)\
|
||||
\
|
||||
if( index == NULL )\
|
||||
{\
|
||||
try { index = master.FirstEmpty(); }\
|
||||
JUDY_ERROR_CATCH("Unable to create new unit (out of memory)");\
|
||||
\
|
||||
slave = new slave_type;\
|
||||
master.Set(index,slave);\
|
||||
} \
|
||||
else if(master.IsEmpty(index) )\
|
||||
{\
|
||||
slave = new slave_type;\
|
||||
master.Set(index,slave);\
|
||||
}\
|
||||
else slave = master.Get(index, slave );
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef JUDY_GET_INDEX
|
||||
#define JUDY_GET_INDEX(master,slave, where) \
|
||||
try { slave = master.Get(where,slave); } \
|
||||
JUDY_ERROR_CATCH("Unable to access old unit (invalid index)");
|
||||
#endif
|
||||
|
||||
#ifndef JUDY_SET_INDEX
|
||||
#define JUDY_SET_INDEX(master,slave, where) \
|
||||
try { master.Set(where,slave); } \
|
||||
JUDY_ERROR_CATCH("Unknown Error occured (No error possible) - Set Function");\
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
#ifndef JUDY_SET_INDEX_P
|
||||
#define JUDY_SET_INDEX_P(master,slave, where) \
|
||||
try { master->Set(where,slave); } \
|
||||
JUDY_ERROR_CATCH("Unknown Error occured (No error possible) - Set Function");\
|
||||
return 1;
|
||||
#endif
|
||||
|
||||
inline char* JUDY_BUILD_PATH(AMX *amx, cell param, int buffer = 0)
|
||||
{
|
||||
char *file = MF_GetAmxString(amx, param, 0, NULL);
|
||||
return MF_BuildPathname("%s", file);
|
||||
}
|
||||
|
||||
#include "GenericNatives.h"
|
||||
#endif
|
|
@ -1,35 +0,0 @@
|
|||
#ifndef _BASE_ARRAYCLASS_H
|
||||
#define _BASE_ARRAYCLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
class CBaseList
|
||||
{
|
||||
public:
|
||||
virtual Word_t Clear() =0;
|
||||
virtual Word_t MemoryUsed() =0;
|
||||
|
||||
virtual int Delete(cell Key) =0;
|
||||
|
||||
virtual void Set(cell Index, Pvoid_t value, bool disable_check = false) =0;
|
||||
|
||||
virtual Pvoid_t Get(cell Index, bool disable_check = false) =0;
|
||||
|
||||
virtual cell First(cell Start = 0) =0;
|
||||
virtual cell Next(cell Start = 0) =0;
|
||||
virtual cell Prev(cell Start = -1) =0;
|
||||
virtual cell Last(cell Start = -1) =0;
|
||||
|
||||
virtual cell FirstEmpty(cell Start = 0) =0;
|
||||
virtual cell NextEmpty(cell Start = 0) =0;
|
||||
virtual cell PrevEmpty(cell Start = -1) =0;
|
||||
virtual cell LastEmpty(cell Start = -1) =0;
|
||||
|
||||
virtual cell ByCount(cell n, cell Start = 0) =0;
|
||||
virtual cell Count(cell Start = 0, cell Stop = -1) =0;
|
||||
|
||||
virtual bool IsFilled(cell Index) =0;
|
||||
virtual bool IsEmpty(cell Index) =0;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef _BASE_MAPCLASS_H
|
||||
#define _BASE_MAPCLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
class CBaseMap
|
||||
{
|
||||
public:
|
||||
virtual Word_t Clear() =0;
|
||||
virtual Word_t MemoryUsed() =0;
|
||||
|
||||
virtual int Delete(char* Key) =0;
|
||||
|
||||
virtual void Set(char* Index, Pvoid_t value, bool disable_check = false) =0;
|
||||
|
||||
virtual Pvoid_t Get(char* Index, bool disable_check = false) =0;
|
||||
|
||||
virtual char* First(char* Start = "") =0;
|
||||
virtual char* Next(char* Start) =0;
|
||||
virtual char* Prev(char* Start) =0;
|
||||
virtual char* Last(char* Start) =0;
|
||||
|
||||
virtual bool IsFilled(char* Index) =0;
|
||||
virtual bool IsEmpty(char* Index) =0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
#ifndef _BINTRIECLASS_H
|
||||
#define _BINTRIECLASS_H
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
//#include <Judy1.h>
|
||||
|
||||
class BinTrie
|
||||
{
|
||||
private:
|
||||
Pvoid_t Table;
|
||||
|
||||
void ThrowSearchError(char* msg);
|
||||
|
||||
public:
|
||||
BinTrie() { Table = NULL; }
|
||||
~BinTrie() { Judy1FreeArray(&Table, PJE0); }
|
||||
|
||||
Word_t Clear() { return Judy1FreeArray(&Table, PJE0); }
|
||||
Word_t MemoryUsed() { return Judy1MemUsed(Table); }
|
||||
|
||||
cell Delete(cell Key) { return Judy1Unset(&Table, Key, PJE0 ); }
|
||||
|
||||
cell Set(cell Index, bool val)
|
||||
{
|
||||
if(val == false) return Delete(Index);
|
||||
else return Judy1Set(&Table, Index,PJE0);
|
||||
}
|
||||
|
||||
cell Get(cell Index)
|
||||
{
|
||||
cell PValue = Judy1Test(Table, Index, PJE0);
|
||||
return PValue;
|
||||
}
|
||||
|
||||
cell First(cell Start = 0);
|
||||
cell Next(cell Start = 0);
|
||||
cell Prev(cell Start = -1);
|
||||
cell Last(cell Start = -1);
|
||||
|
||||
cell FirstEmpty(cell Start = 0);
|
||||
cell NextEmpty(cell Start = 0);
|
||||
cell PrevEmpty(cell Start = -1);
|
||||
cell LastEmpty(cell Start = -1);
|
||||
|
||||
cell ByCount(cell n, cell Start);
|
||||
cell Count(cell Start = 0, cell Stop = -1) { return Judy1Count(Table, Start, Stop, PJE0); }
|
||||
|
||||
bool IsFilled(cell Index) { return ( (Get(Index )) ? true : false); }
|
||||
bool IsEmpty(cell Index) { return ( (Get(Index )) ? true : false); }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,261 +0,0 @@
|
|||
#include "Capsule.h"
|
||||
|
||||
const char* capsule_types[] =
|
||||
{
|
||||
"-NO VALUE-",
|
||||
"BOOLEAN",
|
||||
"INTEGER",
|
||||
"FLOAT",
|
||||
"VECTOR",
|
||||
"STRING"
|
||||
};
|
||||
|
||||
void Capsule::ThrowTypeError(cell get_type)
|
||||
{
|
||||
char ValStr[15];
|
||||
GetAsStr(ValStr);
|
||||
|
||||
char value[100];
|
||||
sprintf(value,"Function attempted to read NON-%s value, actual type is: %s, actual value is: %s", capsule_types[get_type], capsule_types[type], ValStr );
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
|
||||
bool Capsule::CheckEmpty(bool clear)
|
||||
{
|
||||
bool empty = ( data == NULL );
|
||||
|
||||
if(empty != true && clear == true) Clear();
|
||||
return empty;
|
||||
}
|
||||
|
||||
void Capsule::Clear()
|
||||
{
|
||||
//This function intelligently creates a pointer x,
|
||||
//which will be of correct type and then deletes it.
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case capsule_type_flo:
|
||||
{
|
||||
REAL *real_val = reinterpret_cast<REAL*>(data);
|
||||
delete real_val;
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
JudyVec *vector_val = reinterpret_cast<JudyVec*>(data);
|
||||
delete vector_val;
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_str:
|
||||
{
|
||||
char *char_val = reinterpret_cast<char*>(data);
|
||||
delete char_val;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
data = NULL; //Null the address as well. (Used for ints too.)
|
||||
}
|
||||
|
||||
bool Capsule::GetBool( void )
|
||||
{
|
||||
if (type != capsule_type_bool) ThrowTypeError(capsule_type_bool);
|
||||
|
||||
return reinterpret_cast<bool>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetBool(bool Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_bool;
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
};
|
||||
|
||||
cell Capsule::GetInt( void )
|
||||
{
|
||||
if (type != capsule_type_int) ThrowTypeError(capsule_type_int);
|
||||
|
||||
return reinterpret_cast<cell>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetInt(cell Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_int;
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
};
|
||||
|
||||
REAL Capsule::GetFlo( void )
|
||||
{
|
||||
if (type != capsule_type_flo) ThrowTypeError(capsule_type_flo);
|
||||
|
||||
return *reinterpret_cast<REAL*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetFlo(REAL Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_flo;
|
||||
data = new REAL(Value);
|
||||
};
|
||||
|
||||
const JudyVec* Capsule::GetVec( void )
|
||||
{
|
||||
if (type != capsule_type_vec) ThrowTypeError(capsule_type_vec);
|
||||
|
||||
return reinterpret_cast<const JudyVec*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetVec(JudyVec* Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_vec;
|
||||
data = reinterpret_cast<void*>(Value);
|
||||
}
|
||||
|
||||
const char* Capsule::GetStr( void )
|
||||
{
|
||||
if (type != capsule_type_str) ThrowTypeError(capsule_type_str);
|
||||
|
||||
return reinterpret_cast<const char*>(data);
|
||||
}
|
||||
|
||||
void Capsule::SetStr(char* Value)
|
||||
{
|
||||
CheckEmpty(true);
|
||||
type = capsule_type_str;
|
||||
|
||||
char *string_val = new char[strlen(Value)+1];
|
||||
strcpy(string_val,Value);
|
||||
|
||||
data = reinterpret_cast<void*>(string_val);
|
||||
}
|
||||
|
||||
void Capsule::GetAsStr(char* value)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case capsule_type_bool:
|
||||
sprintf(value, "%i",(cell)GetBool());
|
||||
break;
|
||||
case capsule_type_int:
|
||||
sprintf(value, "%d", GetInt() );
|
||||
break;
|
||||
case capsule_type_flo:
|
||||
sprintf(value, "%f", GetFlo() );
|
||||
break;
|
||||
case capsule_type_vec:
|
||||
sprintf(value, "{%f,%f,%f}", GetVec()->first, GetVec()->second, GetVec()->third);
|
||||
break;
|
||||
case capsule_type_str:
|
||||
sprintf(value, "\"%s\"", GetStr() );
|
||||
break;
|
||||
default:
|
||||
sprintf(value, "-NO VALUE-");
|
||||
}
|
||||
}
|
||||
|
||||
void Capsule::Save(FILE* capsuleDB)
|
||||
{
|
||||
fwrite(&type,sizeof(char),1,capsuleDB);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case capsule_type_none: { break; }
|
||||
case capsule_type_bool: { bool var = GetBool(); fwrite(&var, sizeof(bool), 1, capsuleDB); break; }
|
||||
case capsule_type_int: { cell var = GetInt(); fwrite(&var, sizeof(cell), 1, capsuleDB); break; }
|
||||
case capsule_type_flo: { fwrite(reinterpret_cast<REAL*>(GetData()), sizeof(REAL), 1, capsuleDB); break; }
|
||||
case capsule_type_str:
|
||||
{
|
||||
const char* str = GetStr();
|
||||
size_t len = strlen(str);
|
||||
fwrite(&len,sizeof(size_t), 1, capsuleDB);
|
||||
fwrite(&str, sizeof(char), len, capsuleDB);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
const JudyVec* buffer = GetVec();
|
||||
fwrite(buffer, sizeof(JudyVec), 1, capsuleDB);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
char value[20];
|
||||
sprintf(value,"Invalid type found!");
|
||||
|
||||
throw JudyEx(value, true);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
void Capsule::Load(FILE* capsuleDB)
|
||||
{
|
||||
fread(&type, sizeof(char), 1, capsuleDB);
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case capsule_type_none: { CheckEmpty(true); break; }
|
||||
case capsule_type_bool:
|
||||
{
|
||||
bool value = false;
|
||||
fread(&value, sizeof(bool), 1, capsuleDB);
|
||||
SetBool(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_int:
|
||||
{
|
||||
cell value = NULL;
|
||||
fread(&value, sizeof(cell), 1, capsuleDB);
|
||||
SetInt(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_flo:
|
||||
{
|
||||
REAL value = NULL;
|
||||
fread(&value, sizeof(REAL), 1, capsuleDB);
|
||||
SetFlo(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_str:
|
||||
{
|
||||
size_t length;
|
||||
fread(&length, sizeof(size_t), 1, capsuleDB);
|
||||
|
||||
char* value = new char[length+1];
|
||||
fgets(value, length+1, capsuleDB);
|
||||
|
||||
SetStr(value);
|
||||
delete(value);
|
||||
|
||||
break;
|
||||
}
|
||||
case capsule_type_vec:
|
||||
{
|
||||
JudyVec* value = new JudyVec(NULL,NULL,NULL);
|
||||
fread(value, sizeof(JudyVec), 1, capsuleDB);
|
||||
|
||||
SetVec(value);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
char value[20];
|
||||
sprintf(value,"Invalid type found: %i",(int)type);
|
||||
|
||||
throw JudyEx(value, true);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
#ifndef _JUDYCAP_INCLUDED
|
||||
#define _JUDYCAP_INCLUDED
|
||||
|
||||
#include "JudyIncludes.h"
|
||||
|
||||
enum
|
||||
{
|
||||
capsule_type_none,
|
||||
capsule_type_bool,
|
||||
capsule_type_int,
|
||||
capsule_type_flo,
|
||||
capsule_type_vec,
|
||||
capsule_type_str
|
||||
};
|
||||
|
||||
extern const char* capsule_types[];
|
||||
|
||||
class Capsule
|
||||
{
|
||||
private:
|
||||
Pvoid_t data;
|
||||
char type;
|
||||
|
||||
protected:
|
||||
void Clear( void );
|
||||
void ThrowTypeError(cell get_type);
|
||||
|
||||
public:
|
||||
Capsule() { data = NULL; type = capsule_type_none;}
|
||||
~Capsule() { Clear(); }
|
||||
|
||||
Capsule(bool set) { SetBool(set); }
|
||||
Capsule(cell set) { SetInt(set); }
|
||||
Capsule(REAL set) { SetFlo(set); }
|
||||
Capsule(JudyVec* set) { SetVec(set); }
|
||||
Capsule(char* set) { SetStr(set); }
|
||||
|
||||
bool GetBool( void );
|
||||
void SetBool(bool set);
|
||||
|
||||
cell GetInt( void );
|
||||
void SetInt(cell set);
|
||||
|
||||
REAL GetFlo( void );
|
||||
void SetFlo(REAL set);
|
||||
|
||||
const JudyVec* GetVec( void );
|
||||
void SetVec(JudyVec* set);
|
||||
|
||||
const char* GetStr( void );
|
||||
void SetStr(char* set);
|
||||
|
||||
void GetAsStr(char* value);
|
||||
|
||||
void Load(FILE* db);
|
||||
void Save(FILE* db);
|
||||
|
||||
bool CheckEmpty(bool clear);
|
||||
|
||||
Pvoid_t GetData( void ) { return data; }
|
||||
char GetType( void ) { return type; }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,845 +0,0 @@
|
|||
#ifndef _GENERIC_INC_H
|
||||
#define _GENERIC_INC_H
|
||||
|
||||
// Master table
|
||||
ComboArray MNAME;
|
||||
|
||||
///* MASTER FUNCTIONS *///
|
||||
|
||||
///* Start Master Edit Funcs *///
|
||||
#ifdef JUDY_MASTER_EDIT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_DELETE_FUNC
|
||||
|
||||
// generic_delete(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_DELETE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
try { return MNAME.Delete( params[1] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Delete function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Delete func: JUDY_MASTER_DELETE_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_CLEAR_FUNC
|
||||
|
||||
// generic_clear(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_CLEAR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1] );
|
||||
|
||||
try { return Unit->Clear(); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Clear function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Clear func: JUDY_MASTER_CLEAR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master Edit Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Master IO Funcs *///
|
||||
#ifdef JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_SAVE_FUNC
|
||||
|
||||
// generic_save(id,file[])
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_SAVE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
return JUDY_SAVE_FUNC(Unit, JUDY_BUILD_PATH(amx,params[2]) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Save func: JUDY_MASTER_SAVE_FUNC not defined properly!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_LOAD_FUNC
|
||||
|
||||
// generic_load(file[],id)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_LOAD_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[2]);
|
||||
|
||||
return JUDY_LOAD_FUNC(Unit, JUDY_BUILD_PATH(amx,params[1]) );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Load func: JUDY_MASTER_LOAD_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master IO Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Master Amount Funcs *///
|
||||
#ifdef JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_MASTER_COUNT_FUNC
|
||||
|
||||
// generic_count(start = 0, stop = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_COUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
try { return MNAME.Count(params[1],params[2] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Count Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Count func: JUDY_MASTER_COUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_BYCOUNT_FUNC
|
||||
|
||||
// generic_bycount(nth, start = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_MASTER_BYCOUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
try { return MNAME.ByCount(params[1],params[2] ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have ByCount func: JUDY_MASTER_BYCOUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Master Amount Funcs *///
|
||||
#endif
|
||||
|
||||
///* SLAVE FUNCTIONS *///
|
||||
|
||||
///* Start Slave Amount Funcs *///
|
||||
#ifdef JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_COUNT_FUNC
|
||||
|
||||
// generic_size(id, start = 0, stop = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_COUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->Count(JUDY_GET_KEY(params,2),JUDY_GET_KEY(params, 3) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave Count Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Count func: JUDY_SLAVE_COUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_BYCOUNT_FUNC
|
||||
|
||||
// generic_get_nth(id, nth, start = -1)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_BYCOUNT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->ByCount(JUDY_GET_KEY(params,2),JUDY_GET_KEY(params, 3) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have ByCount func: JUDY_SLAVE_BYCOUNT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Amount Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Edit Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_MEMORY_FUNC
|
||||
|
||||
// generic_memory(id)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_MEMORY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->MemoryUsed(); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Search error likely) - Slave ByCount Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Memory func: JUDY_SLAVE_MEMORY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_ISFILLED_FUNC
|
||||
|
||||
// generic_isfilled(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_ISFILLED_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->IsFilled(JUDY_GET_KEY(params,2) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave IsFilled Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have IsFilled func: JUDY_SLAVE_ISFILLED_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_ISEMPTY_FUNC
|
||||
|
||||
// generic_isempty(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_ISEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->IsEmpty(JUDY_GET_KEY(params,2) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave IsEmpty Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have IsEmpty func: JUDY_SLAVE_ISEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_REMOVE_FUNC
|
||||
|
||||
// generic_remove(id, index)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_REMOVE_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
|
||||
try { return Unit->Delete(JUDY_GET_KEY(params,2) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (No error possible) - Slave Delete Function ");
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Delete func: JUDY_SLAVE_DELETE_FUNC not defined!
|
||||
|
||||
#endif
|
||||
///* End Required Slave Edit Funcs *///
|
||||
|
||||
///* Start Slave Bool Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_BOOL
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_BOOL_FUNC
|
||||
// generic_set_bool(id, index, Bool:val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_BOOL_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool Value = (params[3] != NULL);
|
||||
|
||||
Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetBool(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_BOOL_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_BOOL_FUNC
|
||||
|
||||
// Bool:generic_get_bool(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_BOOL_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return Storage->GetBool();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_BOOL_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Bool Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Int Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_INT
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_INT_FUNC
|
||||
|
||||
// generic_set_bool(id, index, val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_INT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell Value = params[3];
|
||||
|
||||
Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetInt(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_INT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_INT_FUNC
|
||||
|
||||
// generic_get_int(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_INT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return Storage->GetInt();
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_INT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Int Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Float Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_FLO
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_FLO_FUNC
|
||||
|
||||
// generic_set_float(id, index, Float:val)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_FLO_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
REAL Value = amx_ctof(params[3]);
|
||||
|
||||
Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetFlo(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_FLO_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_FLO_FUNC
|
||||
|
||||
// Float:generic_get_float(id, index, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_FLO_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[3] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return amx_ftoc(Storage->GetFlo() );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_FLO_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Float Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave String Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_STR
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_STR_FUNC
|
||||
|
||||
// generic_set_string(id, index, val[])
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_STR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
char* Value = MF_GetAmxString(amx,params[3],3,NULL);
|
||||
|
||||
Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetStr(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_STR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_STR_FUNC
|
||||
|
||||
// generic_get_string(id, index, val[], len, disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_STR_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
bool disable_check = (params[5] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL) return 0;
|
||||
|
||||
return MF_SetAmxString(amx,params[3], Storage->GetStr(), params[4] );
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_STR_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave String Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Vector Funcs *///
|
||||
#ifdef JUDY_SLAVE_EDIT_VEC
|
||||
|
||||
#ifdef JUDY_SLAVE_SET_VEC_FUNC
|
||||
|
||||
// generic_set_vec(id, index, Float:val[3])
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_SET_VEC_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
|
||||
cell *input_vec = MF_GetAmxAddr(amx, params[3]);
|
||||
JudyVec *Value = new JudyVec(
|
||||
amx_ctof(input_vec[0]),
|
||||
amx_ctof(input_vec[1]),
|
||||
amx_ctof(input_vec[2])
|
||||
);
|
||||
|
||||
Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, true ) );
|
||||
|
||||
if(Storage == NULL) Storage = new STYPE(Value);
|
||||
else Storage->SetVec(Value);
|
||||
|
||||
JUDY_SET_INDEX_P(Unit,Storage,Indice);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Set func: JUDY_SLAVE_SET_VEC_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_GET_FLO_FUNC
|
||||
|
||||
// generic_get_vec(id,index,Float:vec[3], disable_check = 0)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_GET_VEC_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
STYPE* Storage;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell *vAmx = MF_GetAmxAddr(amx, params[3]);
|
||||
bool disable_check = (params[4] != NULL);
|
||||
|
||||
try { Storage = reinterpret_cast<Capsule*>( Unit->Get(Indice, disable_check ) ); }
|
||||
JUDY_ERROR_CATCH("Judy Error: (Retrieve unset value) - Slave Get Function ");
|
||||
|
||||
if(Storage == NULL)
|
||||
{
|
||||
vAmx[0] = amx_ftoc(0);
|
||||
vAmx[1] = amx_ftoc(0);
|
||||
vAmx[2] = amx_ftoc(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
JudyVec* Vec = const_cast<JudyVec*>( Storage->GetVec() );
|
||||
|
||||
REAL One, Two, Three;
|
||||
Vec->Get(One, Two, Three);
|
||||
|
||||
vAmx[0] = amx_ftoc(One);
|
||||
vAmx[1] = amx_ftoc(Two);
|
||||
vAmx[2] = amx_ftoc(Three);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Get func: JUDY_SLAVE_GET_VEC_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave VEC Funcs *///
|
||||
#endif
|
||||
|
||||
///* End Slave Edit Funcs *///
|
||||
#endif
|
||||
|
||||
///* Start Slave Search Funcs
|
||||
#ifdef JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_FIRST_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_FIRST_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->First(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_FIRST_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_NEXT_FUNC
|
||||
// generic_next(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_NEXT_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Next(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_NEXT_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_PREV_FUNC
|
||||
// generic_prev(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_PREV_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Prev(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_PREV_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_LAST_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_LAST_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->Last(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_LAST_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Search Funcs *///
|
||||
#endif
|
||||
|
||||
|
||||
///* Start Slave Empty Search Funcs
|
||||
#ifdef JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
|
||||
#ifdef JUDY_SLAVE_FIRSTEMPTY_FUNC
|
||||
// generic_firstempty(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_FIRSTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->FirstEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_FIRSTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_NEXTEMPTY_FUNC
|
||||
// generic_next(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_NEXTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->NextEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_NEXTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_PREVEMPTY_FUNC
|
||||
// generic_prev(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_PREVEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->PrevEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function", *success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_PREVEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_LASTEMPTY_FUNC
|
||||
// generic_first(id, index,...)
|
||||
static cell AMX_NATIVE_CALL JUDY_SLAVE_LASTEMPTY_FUNC(AMX *amx,cell *params)
|
||||
{
|
||||
DTYPE* Unit = NULL;
|
||||
|
||||
|
||||
JUDY_GET_INDEX(MNAME,Unit, params[1]);
|
||||
ITYPE Indice = JUDY_GET_KEY(params,2);
|
||||
cell* success = MF_GetAmxAddr(amx, params[3 + SE_OFFSET]);
|
||||
|
||||
*success = 1;
|
||||
try { return JUDY_SET_KEY(Unit->LastEmpty(Indice),3); }
|
||||
JUDY_SEARCH_ERROR_CATCH("Judy Error (Search failed) - Slave Search Function",*success);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#error Must Have Search func: JUDY_SLAVE_LASTEMPTY_FUNC not defined!
|
||||
|
||||
#endif
|
||||
|
||||
///* End Slave Search Empty Funcs *///
|
||||
#endif
|
||||
|
||||
AMX_NATIVE_INFO EXPORT_NAME[] =
|
||||
{
|
||||
|
||||
#ifdef JUDY_MASTER_EDIT_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_CLEAR_STR , JUDY_MASTER_CLEAR_FUNC },
|
||||
{ JUDY_MASTER_DELETE_STR , JUDY_MASTER_DELETE_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_IO_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_SAVE_STR , JUDY_MASTER_SAVE_FUNC },
|
||||
{ JUDY_MASTER_LOAD_STR , JUDY_MASTER_LOAD_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
|
||||
{ JUDY_MASTER_COUNT_STR , JUDY_MASTER_COUNT_FUNC },
|
||||
{ JUDY_MASTER_BYCOUNT_STR , JUDY_MASTER_BYCOUNT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_COUNT_STR , JUDY_SLAVE_COUNT_FUNC },
|
||||
{ JUDY_SLAVE_BYCOUNT_STR , JUDY_SLAVE_BYCOUNT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_MEMORY_STR , JUDY_SLAVE_MEMORY_FUNC },
|
||||
{ JUDY_SLAVE_ISFILLED_STR , JUDY_SLAVE_ISFILLED_FUNC },
|
||||
{ JUDY_SLAVE_ISEMPTY_STR , JUDY_SLAVE_ISEMPTY_FUNC },
|
||||
{ JUDY_SLAVE_REMOVE_STR , JUDY_SLAVE_REMOVE_FUNC },
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_BOOL
|
||||
|
||||
{ JUDY_SLAVE_GET_BOOL_STR , JUDY_SLAVE_GET_BOOL_FUNC },
|
||||
{ JUDY_SLAVE_SET_BOOL_STR , JUDY_SLAVE_SET_BOOL_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_INT
|
||||
|
||||
{ JUDY_SLAVE_GET_INT_STR , JUDY_SLAVE_GET_INT_FUNC },
|
||||
{ JUDY_SLAVE_SET_INT_STR , JUDY_SLAVE_SET_INT_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_FLO
|
||||
|
||||
{ JUDY_SLAVE_GET_FLO_STR , JUDY_SLAVE_GET_FLO_FUNC },
|
||||
{ JUDY_SLAVE_SET_FLO_STR , JUDY_SLAVE_SET_FLO_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_STR
|
||||
|
||||
{ JUDY_SLAVE_GET_STR_STR , JUDY_SLAVE_GET_STR_FUNC },
|
||||
{ JUDY_SLAVE_SET_STR_STR , JUDY_SLAVE_SET_STR_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_EDIT_VEC
|
||||
|
||||
{ JUDY_SLAVE_GET_VEC_STR , JUDY_SLAVE_GET_VEC_FUNC },
|
||||
{ JUDY_SLAVE_SET_VEC_STR , JUDY_SLAVE_SET_VEC_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
// End all edit functions
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_FIRST_STR , JUDY_SLAVE_FIRST_FUNC },
|
||||
{ JUDY_SLAVE_LAST_STR , JUDY_SLAVE_LAST_FUNC },
|
||||
|
||||
{ JUDY_SLAVE_NEXT_STR , JUDY_SLAVE_NEXT_FUNC },
|
||||
{ JUDY_SLAVE_PREV_STR , JUDY_SLAVE_PREV_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
|
||||
{ JUDY_SLAVE_FIRSTEMPTY_STR , JUDY_SLAVE_FIRSTEMPTY_FUNC },
|
||||
{ JUDY_SLAVE_LASTEMPTY_STR , JUDY_SLAVE_LASTEMPTY_FUNC },
|
||||
|
||||
{ JUDY_SLAVE_NEXTEMPTY_STR , JUDY_SLAVE_NEXTEMPTY_FUNC },
|
||||
{ JUDY_SLAVE_PREVEMPTY_STR , JUDY_SLAVE_PREVEMPTY_FUNC },
|
||||
|
||||
#endif
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,58 +0,0 @@
|
|||
#ifndef _NATIVE_FUNC_INC_H
|
||||
#define _NATIVE_FUNC_INC_H
|
||||
|
||||
#define JUDY_GLUE_FUNC( x , y ) x ## y
|
||||
|
||||
#define JUDY_MASTER_FUNCTIONS
|
||||
#define JUDY_MASTER_CREATE_FUNC JUDY_GLUE_FUNC( array , _create )
|
||||
#define JUDY_MASTER_CLEAR_FUNC JUDY_GLUE_FUNC( array , _clear )
|
||||
#define JUDY_MASTER_DELETE_FUNC JUDY_GLUE_FUNC( array , _delete )
|
||||
|
||||
#define JUDY_MASTER_IO_FUNCTIONS
|
||||
#define JUDY_MASTER_SAVE_FUNC JUDY_GLUE_FUNC( array , _save )
|
||||
#define JUDY_MASTER_LOAD_FUNC JUDY_GLUE_FUNC( array , _load )
|
||||
|
||||
#define JUDY_MASTER_AMOUNT_FUNCTIONS
|
||||
#define JUDY_MASTER_COUNT_FUNC JUDY_GLUE_FUNC( array , _count )
|
||||
#define JUDY_MASTER_BYCOUNT_FUNC JUDY_GLUE_FUNC( array , _bycount )
|
||||
#define JUDY_MASTER_MEMORY_FUNC JUDY_GLUE_FUNC( array , _memory )
|
||||
|
||||
#define JUDY_SLAVE_AMOUNT_FUNCTIONS
|
||||
#define JUDY_SLAVE_COUNT_FUNC JUDY_GLUE_FUNC( array , _size )
|
||||
#define JUDY_SLAVE_BYCOUNT_FUNC JUDY_GLUE_FUNC( array , _get_nth )
|
||||
|
||||
#define JUDY_SLAVE_EDIT_FUNCTIONS
|
||||
#define JUDY_SLAVE_GET_BOOL_FUNC JUDY_GLUE_FUNC( array , _get_bool )
|
||||
#define JUDY_SLAVE_SET_BOOL_FUNC JUDY_GLUE_FUNC( array , _set_bool )
|
||||
|
||||
#define JUDY_SLAVE_GET_INT_FUNC JUDY_GLUE_FUNC( array , _get_int )
|
||||
#define JUDY_SLAVE_SET_INT_FUNC JUDY_GLUE_FUNC( array , _set_int )
|
||||
|
||||
#define JUDY_SLAVE_GET_FLO_FUNC JUDY_GLUE_FUNC( array , _get_float )
|
||||
#define JUDY_SLAVE_SET_FLO_FUNC JUDY_GLUE_FUNC( array , _set_float )
|
||||
|
||||
#define JUDY_SLAVE_GET_STR_FUNC JUDY_GLUE_FUNC( array , _get_string )
|
||||
#define JUDY_SLAVE_SET_STR_FUNC JUDY_GLUE_FUNC( array , _set_string )
|
||||
|
||||
#define JUDY_SLAVE_GET_VEC_FUNC JUDY_GLUE_FUNC( array , _get_vector )
|
||||
#define JUDY_SLAVE_SET_VEC_FUNC JUDY_GLUE_FUNC( array , _set_vector )
|
||||
|
||||
#define JUDY_SLAVE_ISFILLED_FUNC JUDY_GLUE_FUNC( array , _isfilled )
|
||||
#define JUDY_SLAVE_ISEMPTY_FUNC JUDY_GLUE_FUNC( array , _isempty )
|
||||
|
||||
#define JUDY_SLAVE_REMOVE_FUNC JUDY_GLUE_FUNC( array , _remove )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_FUNCTIONS
|
||||
#define JUDY_SLAVE_GET_FIRST_FUNC JUDY_GLUE_FUNC( array , _first )
|
||||
#define JUDY_SLAVE_SET_LAST_FUNC JUDY_GLUE_FUNC( array , _last )
|
||||
|
||||
#define JUDY_SLAVE_GET_NEXT_FUNC JUDY_GLUE_FUNC( array , _next )
|
||||
#define JUDY_SLAVE_SET_PREV_FUNC JUDY_GLUE_FUNC( array , _prev )
|
||||
|
||||
#define JUDY_SLAVE_SEARCH_EMPTY_FUNCTIONS
|
||||
#define JUDY_SLAVE_GET_FIRSTEMPTY_FUNC JUDY_GLUE_FUNC( array , _firstempty )
|
||||
#define JUDY_SLAVE_SET_LASTEMPTY_FUNC JUDY_GLUE_FUNC( array , _lastempty )
|
||||
|
||||
#define JUDY_SLAVE_GET_NEXTEMPTY_FUNC JUDY_GLUE_FUNC( array , _nextempty )
|
||||
#define JUDY_SLAVE_SET_PREVEMPTY_FUNC JUDY_GLUE_FUNC( array , _prevempty )
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -1,58 +0,0 @@
|
|||
#(C)2004-2005 AMX Mod X Development Team
|
||||
# Makefile written by David "BAILOPAN" Anderson
|
||||
|
||||
### EDIT BELOW FOR OTHER PROJECTS ###
|
||||
|
||||
OPT_FLAGS = -funroll-loops -s -pipe -fomit-frame-pointer-fexceptions
|
||||
DEBUG_FLAGS = -g -ggdb3
|
||||
CPP = gcc
|
||||
NAME = array_amxx
|
||||
|
||||
OBJECTS = amxxmodule.cpp Array.cpp BinTrieNatives.cpp Capsule.cpp CArray.cpp CBinTrie.cpp CKeytable.cpp JudyExtra.cpp ListNatives.cpp MapNatives.cpp
|
||||
|
||||
LINK = Judy.a libstdc++.a
|
||||
|
||||
ifeq "$(DEBUG)" "true"
|
||||
BIN_DIR = Debug
|
||||
CFLAGS = $(DEBUG_FLAGS)
|
||||
else
|
||||
BIN_DIR = Release
|
||||
CFLAGS = $(OPT_FLAGS)
|
||||
endif
|
||||
|
||||
CFLAGS += -DNDEBUG -fPIC -Wno-deprecated -DHAVE_STDINT_H -fexceptions -fno-rtti
|
||||
|
||||
ifeq "$(AMD64)" "true"
|
||||
BINARY = $(NAME)_amd64.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=64 -DHAVE_I64 -m64
|
||||
else
|
||||
BINARY = $(NAME)_i386.so
|
||||
CFLAGS += -DPAWN_CELL_SIZE=32 -DJIT -DASM32
|
||||
OPT_FLAGS += -march=i586
|
||||
endif
|
||||
|
||||
OBJ_LINUX := $(OBJECTS:%.cpp=$(BIN_DIR)/%.o)
|
||||
|
||||
$(BIN_DIR)/%.o: %.cpp
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) -o $@ -c $<
|
||||
|
||||
all:
|
||||
mkdir -p $(BIN_DIR)
|
||||
$(MAKE) engine
|
||||
|
||||
amd64:
|
||||
$(MAKE) all AMD64=true
|
||||
|
||||
engine: $(OBJ_LINUX)
|
||||
$(CPP) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -shared -lm -o$(BIN_DIR)/$(BINARY)
|
||||
|
||||
debug:
|
||||
$(MAKE) all DEBUG=true
|
||||
|
||||
default: all
|
||||
|
||||
clean:
|
||||
rm -rf Release/*.o
|
||||
rm -rf Release/$(BINARY)
|
||||
rm -rf Debug/*.o
|
||||
rm -rf Debug/$(BINARY)
|
|
@ -1,463 +0,0 @@
|
|||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "Array"
|
||||
#define MODULE_VERSION "1.7"
|
||||
#define MODULE_AUTHOR "Twilight Suzuka"
|
||||
#define MODULE_URL "www.amxmodx.org"
|
||||
#define MODULE_LOGTAG "ARRAY"
|
||||
// If you want the module not to be reloaded on mapchange, remove / comment out the next line
|
||||
#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
//#define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX dettach
|
||||
#define FN_AMXX_DETTACH OnAmxxDettach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta dettach
|
||||
//#define FN_META_DETTACH OnMetaDettach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
/* __MSDOS__ set when compiling for DOS (not Windows)
|
||||
* _Windows set when compiling for any version of Microsoft Windows
|
||||
* __WIN32__ set when compiling for Windows95 or WindowsNT (32 bit mode)
|
||||
* __32BIT__ set when compiling in 32-bit "flat" mode (DOS or Windows)
|
||||
*
|
||||
* Copyright 1998-2002, ITB CompuPhase, The Netherlands.
|
||||
* info@compuphase.com.
|
||||
*/
|
||||
|
||||
#ifndef _OSDEFS_H
|
||||
#define _OSDEFS_H
|
||||
|
||||
/* Every compiler uses different "default" macros to indicate the mode
|
||||
* it is in. Throughout the source, we use the Borland C++ macros, so
|
||||
* the macros of Watcom C/C++ and Microsoft Visual C/C++ are mapped to
|
||||
* those of Borland C++.
|
||||
*/
|
||||
#if defined(__WATCOMC__)
|
||||
# if defined(__WINDOWS__) || defined(__NT__)
|
||||
# define _Windows 1
|
||||
# endif
|
||||
# ifdef __386__
|
||||
# define __32BIT__ 1
|
||||
# endif
|
||||
# if defined(_Windows) && defined(__32BIT__)
|
||||
# define __WIN32__ 1
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# if defined(_WINDOWS) || defined(_WIN32)
|
||||
# define _Windows 1
|
||||
# endif
|
||||
# ifdef _WIN32
|
||||
# define __WIN32__ 1
|
||||
# define __32BIT__ 1
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __linux__
|
||||
#include <endian.h>
|
||||
#endif
|
||||
|
||||
/* Linux NOW has these */
|
||||
#if !defined BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
#if !defined LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
|
||||
/* educated guess, BYTE_ORDER is undefined, i386 is common => little endian */
|
||||
#if !defined BYTE_ORDER
|
||||
#if defined UCLINUX
|
||||
#define BYTE_ORDER BIG_ENDIAN
|
||||
#else
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* _OSDEFS_H */
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
#ifndef INCLUDED_JBRANDOM
|
||||
#define INCLUDED_JBRANDOM
|
||||
|
||||
#include <ctime>
|
||||
#include <cstdlib>
|
||||
|
||||
class JBRandom
|
||||
{
|
||||
public:
|
||||
JBRandom();
|
||||
~JBRandom();
|
||||
|
||||
static int JBRandomize(int lowestNumber,int highestNumber)
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
init = true;
|
||||
srand(time(0));
|
||||
}
|
||||
|
||||
int answer = (rand() % ((highestNumber + 1) - lowestNumber)) + lowestNumber;
|
||||
|
||||
return answer;
|
||||
};
|
||||
|
||||
static bool JBProbabilityPercent(short probability) // probability should be 1(%) to 100 (ie, percent)
|
||||
{
|
||||
if (!init)
|
||||
{
|
||||
init = true;
|
||||
srand(time(0));
|
||||
}
|
||||
|
||||
if (rand() % 100 + 1 <= probability)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
};
|
||||
|
||||
private:
|
||||
static bool init;
|
||||
|
||||
};
|
||||
|
||||
bool JBRandom::init = false;
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,460 +0,0 @@
|
|||
#include "metamap.h"
|
||||
|
||||
|
||||
bool& VisitedAccess(unsigned int col, unsigned int lin, bool* visited)
|
||||
{
|
||||
return visited[lin * COLUMNS + col];
|
||||
}
|
||||
|
||||
cell* MatrixWrite(UINT col, UINT lin, cell* theMatrix)
|
||||
{
|
||||
return &(theMatrix[lin * COLUMNS + col]);
|
||||
//return &(crossword.at());
|
||||
}
|
||||
|
||||
const cell* MatrixRead(UINT col, UINT lin, cell* theMatrix)
|
||||
{
|
||||
return &(theMatrix[lin * COLUMNS + col]);
|
||||
//return &(crossword.at());
|
||||
}
|
||||
|
||||
void AddSpace(int column, int line, vector<CSpace>& spaces)
|
||||
{
|
||||
spaces.push_back(CSpace(column, line));
|
||||
}
|
||||
|
||||
void EmptyMatrix(cell* theMatrix) {
|
||||
for (UINT i = 0; i < COLUMNS; i++) {
|
||||
for (UINT j = 0; j < LINES; j++) {
|
||||
*(MatrixWrite(i, j, theMatrix)) = SPACE_EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool BoundaryAndWallCheck(const UINT column, const UINT line, bool* CRvisited, cell* theMatrix)
|
||||
{
|
||||
if (column >= 0 && column < COLUMNS && line >= 0 && line < LINES) {
|
||||
// That's boundaries, now walls, and visited!
|
||||
if (*MatrixRead(column, line, theMatrix) == SPACE_EMPTY) //if (theMatrix[column][line] == SPACE_EMPTY) {
|
||||
if (!(VisitedAccess(column, line, CRvisited)))//if (!CRvisited[column][line])
|
||||
return true;
|
||||
/*else {
|
||||
cout << "Visited" << column << ',' << line << '!';
|
||||
}*/
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int Difference(int i, int j) {
|
||||
if (i > j)
|
||||
return i - j;
|
||||
else
|
||||
return j - i;
|
||||
}
|
||||
|
||||
bool CheckReach(const UINT currentColumn, const UINT currentLine, const UINT targetColumn, const UINT targetLine, bool* CRvisited, cell* theMatrix)
|
||||
{
|
||||
//cout << '>' << currentColumn << ',' << currentLine;
|
||||
if (currentColumn < 0 || currentColumn >= COLUMNS || currentLine < 0 || currentLine >= LINES
|
||||
|| targetColumn < 0 || targetColumn >= COLUMNS || targetLine < 0 || targetLine >= LINES) {
|
||||
MF_Log("Metamap: Out of range in CheckReach! currentColumn %d currentLine %d targetColumn %d targetLine %d");
|
||||
throw;
|
||||
}
|
||||
// This should happen when the spaces are directly next to each other.
|
||||
if (currentColumn == targetColumn && Difference(currentLine, targetLine) == 1
|
||||
|| currentLine == targetLine && Difference(currentColumn, targetColumn) == 1) {
|
||||
//cout << "Returns yes here because " << currentColumn << "," << currentLine << " and " << targetColumn << "," << targetLine << " are next to each other.";
|
||||
//cout << "=nextTo";
|
||||
return true;
|
||||
}
|
||||
else if (*MatrixRead(currentColumn, currentLine, theMatrix) == SPACE_WALL) //else if (theMatrix[currentColumn][currentLine] == SPACE_WALL)
|
||||
return false;
|
||||
|
||||
(VisitedAccess(currentColumn, currentLine, CRvisited)) = true; //CRvisited[currentColumn][currentLine] = true;
|
||||
|
||||
// Spaces are now at least two manhattan units from each other.
|
||||
// Try to go in the general direction of target (should be one or two possibilites here, depending on if we are on the same line/column or not)
|
||||
bool goLeft = false, goUp = false, goRight = false, goDown = false;
|
||||
|
||||
if (targetColumn < currentColumn)
|
||||
goLeft = true;
|
||||
else if (targetColumn > currentColumn)
|
||||
goRight = true;
|
||||
if (targetLine < currentLine)
|
||||
goUp = true;
|
||||
else if (targetLine > currentLine)
|
||||
goDown = true;
|
||||
|
||||
// Left
|
||||
int leftColumn = currentColumn - 1;
|
||||
int leftLine = currentLine;
|
||||
|
||||
// Up
|
||||
int upColumn = currentColumn;
|
||||
int upLine = currentLine - 1;
|
||||
|
||||
// Right
|
||||
int rightColumn = currentColumn + 1;
|
||||
int rightLine = currentLine;
|
||||
|
||||
// Down
|
||||
int downColumn = currentColumn;
|
||||
int downLine = currentLine + 1;
|
||||
|
||||
int nextColumn[4], nextLine[4];
|
||||
bool nextCheck[4];
|
||||
|
||||
if (goLeft) {
|
||||
nextColumn[0] = leftColumn;
|
||||
nextLine[0] = leftLine;
|
||||
nextCheck[0] = BoundaryAndWallCheck(nextColumn[0], nextLine[0], CRvisited, theMatrix);
|
||||
if (goUp) {
|
||||
nextColumn[1] = upColumn;
|
||||
nextLine[1] = upLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = downColumn;
|
||||
nextLine[2] = downLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = rightColumn;
|
||||
nextLine[3] = rightLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
else {
|
||||
nextColumn[1] = downColumn;
|
||||
nextLine[1] = downLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = upColumn;
|
||||
nextLine[2] = upLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = rightColumn;
|
||||
nextLine[3] = rightLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
}
|
||||
else if (goRight) {
|
||||
nextColumn[0] = rightColumn;
|
||||
nextLine[0] = rightLine;
|
||||
nextCheck[0] = BoundaryAndWallCheck(nextColumn[0], nextLine[0], CRvisited, theMatrix);
|
||||
if (goUp) {
|
||||
nextColumn[1] = upColumn;
|
||||
nextLine[1] = upLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = downColumn;
|
||||
nextLine[2] = downLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = leftColumn;
|
||||
nextLine[3] = leftLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
else {
|
||||
nextColumn[1] = downColumn;
|
||||
nextLine[1] = downLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = upColumn;
|
||||
nextLine[2] = upLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = leftColumn;
|
||||
nextLine[3] = leftLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (goUp) {
|
||||
nextColumn[0] = upColumn;
|
||||
nextLine[0] = upLine;
|
||||
nextCheck[0] = BoundaryAndWallCheck(nextColumn[0], nextLine[0], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[1] = leftColumn;
|
||||
nextLine[1] = leftLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = rightColumn;
|
||||
nextLine[2] = rightLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = downColumn;
|
||||
nextLine[3] = downLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
else {
|
||||
nextColumn[0] = downColumn;
|
||||
nextLine[0] = downLine;
|
||||
nextCheck[0] = BoundaryAndWallCheck(nextColumn[0], nextLine[0], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[1] = leftColumn;
|
||||
nextLine[1] = leftLine;
|
||||
nextCheck[1] = BoundaryAndWallCheck(nextColumn[1], nextLine[1], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[2] = rightColumn;
|
||||
nextLine[2] = rightLine;
|
||||
nextCheck[2] = BoundaryAndWallCheck(nextColumn[2], nextLine[2], CRvisited, theMatrix);
|
||||
|
||||
nextColumn[3] = upColumn;
|
||||
nextLine[3] = upLine;
|
||||
nextCheck[3] = BoundaryAndWallCheck(nextColumn[3], nextLine[3], CRvisited, theMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (nextCheck[i] && CheckReach(nextColumn[i], nextLine[i], targetColumn, targetLine, CRvisited, theMatrix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CheckReaches(const UINT column, const UINT line, cell* theMatrix) {
|
||||
// can left, up, right and down still reach each other? if so, this move can be done.
|
||||
// Can left reach up, can up reach right, and can right reach down = good move.
|
||||
|
||||
bool checkSpaces[4];
|
||||
int columns[4]; // These CANNOT be UINT! Evaluted >0 with expected possibility of going below 0!
|
||||
int lines[4]; // These CANNOT be UINT! Evaluted >0 with expected possibility of going below 0!
|
||||
// Left
|
||||
columns[0] = column - 1;
|
||||
lines[0] = line;
|
||||
// Boundary + wall check //checkSpaces[0] = columns[0] >= 0 ? (theMatrix[columns[0]][lines[0]] == SPACE_EMPTY ? true : false) : false; // Boundary + wall check
|
||||
checkSpaces[0] = columns[0] >= 0 ? (*MatrixRead(columns[0], lines[0], theMatrix) == SPACE_EMPTY ? true : false) : false;
|
||||
// Up
|
||||
columns[1] = column;
|
||||
lines[1] = line - 1;
|
||||
//checkSpaces[1] = lines[1] >= 0 ? (theMatrix[columns[1]][lines[1]] == SPACE_EMPTY ? true : false) : false; // Boundary + wall check
|
||||
checkSpaces[1] = lines[1] >= 0 ? (*MatrixRead(columns[1], lines[1], theMatrix) == SPACE_EMPTY ? true : false) : false;
|
||||
// Right
|
||||
columns[2] = column + 1;
|
||||
lines[2] = line;
|
||||
//checkSpaces[2] = columns[2] < COLUMNS ? (theMatrix[columns[2]][lines[2]] == SPACE_EMPTY ? true : false) : false; // Boundary + wall check
|
||||
checkSpaces[2] = columns[2] < (int)COLUMNS ? (*MatrixRead(columns[2], lines[2], theMatrix) == SPACE_EMPTY ? true : false) : false;
|
||||
// Down
|
||||
columns[3] = column;
|
||||
lines[3] = line + 1;
|
||||
//checkSpaces[3] = lines[3] < LINES ? (theMatrix[columns[3]][lines[3]] == SPACE_EMPTY ? true : false) : false; // Boundary + wall check
|
||||
checkSpaces[3] = lines[3] < (int)LINES ? (*MatrixRead(columns[3], lines[3], theMatrix) == SPACE_EMPTY ? true : false) : false;
|
||||
|
||||
for (int j = 0, spacesToCheck = 0; j < 4; j++) {
|
||||
if (checkSpaces[j])
|
||||
spacesToCheck++;
|
||||
}
|
||||
|
||||
if (spacesToCheck == 1) {
|
||||
// If only one space to check, the other are already used by walls or out of bounds, so don't bother checking anything more, just return true!
|
||||
return true;
|
||||
}
|
||||
else if (spacesToCheck == 0) {
|
||||
// If this is ever 0, we probably made an error earlier?
|
||||
//PrintMatrix(column, line);
|
||||
//cout << "Should check around: " << column << ',' << line << " is " << ((theMatrix[column][line] == SPACE_EMPTY) ? "empty" : "a wall") << endl;
|
||||
MF_Log("Metamap: Error - unreachable area may have been created earlier, quitting...");
|
||||
throw;
|
||||
}
|
||||
|
||||
//cout << "Should find " << spacesToCheck << " connections." << endl;
|
||||
//int connectionsToFind
|
||||
bool reaches;
|
||||
int tested = 0;
|
||||
int connections = 0;
|
||||
//vector<bool> CRvisited; <-- burn in hell, STL! :-D
|
||||
//CRvisited.resize(COLUMNS * LINES);
|
||||
|
||||
bool* visited = new bool[COLUMNS * LINES];
|
||||
//EmptyMatrix(theMatrix, visited);
|
||||
|
||||
//bool CRvisited[COLUMNS][LINES];
|
||||
for (UINT i = 0; i < 4; i++) {
|
||||
if (!checkSpaces[i])
|
||||
continue;
|
||||
|
||||
// We should be able to return true here, because if A can reach B, B can also reach A. :-)
|
||||
//if (connections == 1 && spacesToCheck == 2)
|
||||
//return true;
|
||||
reaches = false;
|
||||
tested = 0;
|
||||
for (UINT j = i + 1; tested < 4; j++) {
|
||||
if (j == 4)
|
||||
j = 0;
|
||||
tested++; // we have tested this direction
|
||||
if (i == j || !checkSpaces[j])
|
||||
continue;
|
||||
|
||||
//cout << "Can " << columns[i] << ',' << lines[i] << " reach " << columns[j] << ',' << lines[j] << '?';
|
||||
for (UINT l = 0; l < LINES; l++) {
|
||||
for (UINT k = 0; k < COLUMNS; k++) {
|
||||
(VisitedAccess(k, l, visited)) = false;//CRvisited[l][k] = false;
|
||||
}
|
||||
}
|
||||
//MF_Log("i: %d, calls CheckReach(%d, %d, %d, %d, CRvisited, theMatrix)", i, columns[i], lines[i], columns[j], lines[j]);
|
||||
if (CheckReach(columns[i], lines[i], columns[j], lines[j], visited, theMatrix)) {
|
||||
//cout << " Yes, " << columns[i] << ',' << lines[i] << " reaches " << columns[j] << ',' << lines[j] << ", indexes " << i << " and " << j << '.' << endl;
|
||||
reaches = true;
|
||||
connections++;
|
||||
break; // break, don't check this space anymore, go on check with the rest.
|
||||
}
|
||||
else {
|
||||
// Really, if A cannot ever reach B, it does not matter if A can reach C! :-)
|
||||
delete [] visited;
|
||||
return false;
|
||||
}
|
||||
//cout << " No!" << endl;
|
||||
}
|
||||
|
||||
// If we can't reach any of the other spaces, return false here.
|
||||
if (!reaches) {
|
||||
//cout << columns[i] << ',' << lines[i] << " can't reach any other space! Returning false here..." << endl;
|
||||
delete [] visited;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
delete [] visited;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PlaceWalls2(const UINT WALLSTOPLACE, cell* theMatrix)
|
||||
{
|
||||
if (WALLSTOPLACE > COLUMNS * LINES) {
|
||||
MF_Log("Metamap: Too many walls!");
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT wallsPlaced = 0;
|
||||
// Find all empty spaces, add them to vector.
|
||||
vector<CSpace> emptySpaces;
|
||||
//int round = 0;
|
||||
while (wallsPlaced < WALLSTOPLACE) {
|
||||
//round++;
|
||||
//cout << "Starting new round, we should place " << wallsToPlace << " but have so far only placed " << wallsPlaced << " walls." << endl;
|
||||
//system("PAUSE");
|
||||
for (UINT i = 0, empties = 0; i < COLUMNS; i++) {
|
||||
for (UINT j = 0; j < LINES; j++) {
|
||||
if (*(MatrixRead(i, j, theMatrix)) == SPACE_EMPTY) { // if (theMatrix[i][j] == SPACE_EMPTY) {
|
||||
AddSpace(i, j, emptySpaces);
|
||||
empties++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined _debug
|
||||
MF_Log("Added %d empty spaces... %d elements in emptySpaces", empties, emptySpaces.size());
|
||||
#endif
|
||||
|
||||
for (UINT column, line, element; wallsPlaced < WALLSTOPLACE && !emptySpaces.empty(); wallsPlaced++) {
|
||||
element = JBRandom::JBRandomize(0, emptySpaces.size() - 1);
|
||||
column = emptySpaces[element].column;
|
||||
line = emptySpaces[element].line;
|
||||
//MF_Log("element %d in column %d, line %d", element, column, line);
|
||||
|
||||
*(MatrixWrite(column, line, theMatrix)) = SPACE_WALL;// theMatrix[column][line] = SPACE_WALL;
|
||||
//PrintMatrix(column, line);
|
||||
|
||||
// Is it possible to place a wall here without blocking anything?
|
||||
|
||||
if (!CheckReaches(column, line, theMatrix)) {
|
||||
//cout << "No!" << endl;
|
||||
*(MatrixWrite(column, line, theMatrix)) = SPACE_EMPTY; //theMatrix[column][line] = SPACE_EMPTY;
|
||||
wallsPlaced--;
|
||||
//system("PAUSE");
|
||||
}
|
||||
|
||||
emptySpaces.erase(&emptySpaces[element]);
|
||||
//cout << emptySpaces.size() << endl;
|
||||
//system("PAUSE");
|
||||
}
|
||||
//cout << "One round ready..." << endl;
|
||||
//PrintMatrix();
|
||||
//system("PAUSE");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CountWalls(cell* theMatrix) {
|
||||
int walls = 0, empties = 0, others = 0;
|
||||
for (UINT i = 0; i < LINES * COLUMNS; i++) {
|
||||
if (theMatrix[i] == SPACE_EMPTY)
|
||||
empties++;
|
||||
else if (theMatrix[i] == SPACE_WALL)
|
||||
walls++;
|
||||
else
|
||||
others++;
|
||||
|
||||
}
|
||||
MF_Log("Walls: %d empties: %d others: %d", walls, empties, others);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL metamap_getmap(AMX *amx, cell *params) // native metamap_getmap(matrix[], columns, lines, walls); = 4 params
|
||||
{
|
||||
#if defined _DEBUG
|
||||
MF_Log("metamap_getmap start");
|
||||
#endif
|
||||
g_amx = amx;
|
||||
// Get matrix
|
||||
cell* theMatrix = MF_GetAmxAddr(amx, params[1]);
|
||||
|
||||
// Get rest of the parameters
|
||||
COLUMNS = params[2];
|
||||
LINES = params[3];
|
||||
const int WALLS = params[4];
|
||||
|
||||
if (COLUMNS <= 0) {
|
||||
MF_Log("Too few columns! (%d)", COLUMNS);
|
||||
MF_RaiseAmxError(g_amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
else if (LINES <= 0) {
|
||||
MF_Log("Too few lines! (%d)", LINES);
|
||||
MF_RaiseAmxError(g_amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
else if (WALLS <= 0) {
|
||||
MF_Log("Too few walls! (%d)", WALLS);
|
||||
MF_RaiseAmxError(g_amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
try {
|
||||
EmptyMatrix(theMatrix);
|
||||
|
||||
#if defined _DEBUG
|
||||
CountWalls(theMatrix);
|
||||
#endif
|
||||
if (!PlaceWalls2(WALLS, theMatrix)) {
|
||||
MF_RaiseAmxError(g_amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
#if defined _DEBUG
|
||||
MF_Log("After placing walls:");
|
||||
CountWalls(theMatrix);
|
||||
#endif
|
||||
}
|
||||
catch (...) {
|
||||
MF_Log("Metamap, main: Unhandled exception.");
|
||||
MF_RaiseAmxError(g_amx, AMX_ERR_NATIVE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined _DEBUG
|
||||
MF_Log("metamap_getmap end");
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
/******************************************************************************************/
|
||||
AMX_NATIVE_INFO metamap_Exports[] = {
|
||||
{"metamap_getmap", metamap_getmap},
|
||||
/////////////////// <--- 19 chars max
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
MF_AddNatives(metamap_Exports);
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#include <vector>
|
||||
#include "JBRandom.h"
|
||||
#include "amxxmodule.h"
|
||||
using namespace std;
|
||||
|
||||
enum SpaceContent {SPACE_EMPTY = 0, SPACE_WALL = 1};
|
||||
typedef unsigned int UINT;
|
||||
|
||||
class CSpace
|
||||
{
|
||||
public:
|
||||
CSpace(UINT columnIn, UINT lineIn) {column = columnIn; line = lineIn;}
|
||||
UINT column, line;
|
||||
};
|
||||
|
||||
|
||||
// Globals
|
||||
UINT COLUMNS, LINES;
|
||||
AMX *g_amx;
|
|
@ -1,9 +0,0 @@
|
|||
// METAMAP module
|
||||
|
||||
#if !defined INCLUDED_METAMAP
|
||||
#define INCLUDED_METAMAP
|
||||
|
||||
// Matrix must be of size columns * lines!
|
||||
native metamap_getmap(matrix[], columns, lines, walls);
|
||||
|
||||
#endif // INCLUDED_METAMAP
|
|
@ -1,199 +0,0 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="metamap"
|
||||
ProjectGUID="{940FB7A7-5345-47C4-90BC-238AE6B75D1B}"
|
||||
SccProjectName=""
|
||||
SccLocalPath="">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;metamap_EXPORTS"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/metamap.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/metamap.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ModuleDefinitionFile=""
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/metamap.pdb"
|
||||
ImportLibrary=".\Debug/metamap.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/metamap.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="4105"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;metamap_EXPORTS"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/metamap.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/metamap_amxx.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ModuleDefinitionFile=""
|
||||
ProgramDatabaseFile=".\Release/metamap.pdb"
|
||||
ImportLibrary=".\Release/metamap.lib"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="TRUE"
|
||||
SuppressStartupBanner="TRUE"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/metamap.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="4105"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="metamap.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;metamap_EXPORTS;$(NoInherit)"
|
||||
BasicRuntimeChecks="3"
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;metamap_EXPORTS;$(NoInherit)"
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="metamap.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\moduleconfig.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
<File
|
||||
RelativePath=".\howto.txt">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="metamap.inc">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -1,462 +0,0 @@
|
|||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "Metamap X"
|
||||
#define MODULE_VERSION "0.1"
|
||||
#define MODULE_AUTHOR "JGHG"
|
||||
#define MODULE_URL "http://www.tcwonline.org/johnnygothisgun/"
|
||||
#define MODULE_LOGTAG "METAMAPX"
|
||||
// If you don't want the module to be reloaded on mapchange, comment out the next line
|
||||
//#define MODULE_RELOAD_ON_MAPCHANGE
|
||||
|
||||
#ifdef __DATE__
|
||||
#define MODULE_DATE __DATE__
|
||||
#else // __DATE__
|
||||
#define MODULE_DATE "Unknown"
|
||||
#endif // __DATE__
|
||||
|
||||
// metamod plugin?
|
||||
// #define USE_METAMOD
|
||||
|
||||
// - AMXX Init functions
|
||||
// Also consider using FN_META_*
|
||||
// AMXX query
|
||||
//#define FN_AMXX_QUERY OnAmxxQuery
|
||||
// AMXX attach
|
||||
// Do native functions init here (MF_AddNatives)
|
||||
#define FN_AMXX_ATTACH OnAmxxAttach
|
||||
// AMXX detach
|
||||
//#define FN_AMXX_DETACH OnAmxxDetach
|
||||
// All plugins loaded
|
||||
// Do forward functions init here (MF_RegisterForward)
|
||||
// #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded
|
||||
|
||||
/**** METAMOD ****/
|
||||
// If your module doesn't use metamod, you may close the file now :)
|
||||
#ifdef USE_METAMOD
|
||||
// ----
|
||||
// Hook Functions
|
||||
// Uncomment these to be called
|
||||
// You can also change the function name
|
||||
|
||||
// - Metamod init functions
|
||||
// Also consider using FN_AMXX_*
|
||||
// Meta query
|
||||
//#define FN_META_QUERY OnMetaQuery
|
||||
// Meta attach
|
||||
//#define FN_META_ATTACH OnMetaAttach
|
||||
// Meta detach
|
||||
//#define FN_META_DETACH OnMetaDetach
|
||||
|
||||
// (wd) are Will Day's notes
|
||||
// - GetEntityAPI2 functions
|
||||
// #define FN_GameDLLInit GameDLLInit /* pfnGameInit() */
|
||||
// #define FN_DispatchSpawn DispatchSpawn /* pfnSpawn() */
|
||||
// #define FN_DispatchThink DispatchThink /* pfnThink() */
|
||||
// #define FN_DispatchUse DispatchUse /* pfnUse() */
|
||||
// #define FN_DispatchTouch DispatchTouch /* pfnTouch() */
|
||||
// #define FN_DispatchBlocked DispatchBlocked /* pfnBlocked() */
|
||||
// #define FN_DispatchKeyValue DispatchKeyValue /* pfnKeyValue() */
|
||||
// #define FN_DispatchSave DispatchSave /* pfnSave() */
|
||||
// #define FN_DispatchRestore DispatchRestore /* pfnRestore() */
|
||||
// #define FN_DispatchObjectCollsionBox DispatchObjectCollsionBox /* pfnSetAbsBox() */
|
||||
// #define FN_SaveWriteFields SaveWriteFields /* pfnSaveWriteFields() */
|
||||
// #define FN_SaveReadFields SaveReadFields /* pfnSaveReadFields() */
|
||||
// #define FN_SaveGlobalState SaveGlobalState /* pfnSaveGlobalState() */
|
||||
// #define FN_RestoreGlobalState RestoreGlobalState /* pfnRestoreGlobalState() */
|
||||
// #define FN_ResetGlobalState ResetGlobalState /* pfnResetGlobalState() */
|
||||
// #define FN_ClientConnect ClientConnect /* pfnClientConnect() (wd) Client has connected */
|
||||
// #define FN_ClientDisconnect ClientDisconnect /* pfnClientDisconnect() (wd) Player has left the game */
|
||||
// #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */
|
||||
// #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */
|
||||
// #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */
|
||||
// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */
|
||||
// #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */
|
||||
// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */
|
||||
// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */
|
||||
// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */
|
||||
// #define FN_StartFrame StartFrame /* pfnStartFrame() */
|
||||
// #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */
|
||||
// #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */
|
||||
// #define FN_GetGameDescription GetGameDescription /* pfnGetGameDescription() Returns string describing current .dll. E.g. "TeamFotrress 2" "Half-Life" */
|
||||
// #define FN_PlayerCustomization PlayerCustomization /* pfnPlayerCustomization() Notifies .dll of new customization for player. */
|
||||
// #define FN_SpectatorConnect SpectatorConnect /* pfnSpectatorConnect() Called when spectator joins server */
|
||||
// #define FN_SpectatorDisconnect SpectatorDisconnect /* pfnSpectatorDisconnect() Called when spectator leaves the server */
|
||||
// #define FN_SpectatorThink SpectatorThink /* pfnSpectatorThink() Called when spectator sends a command packet (usercmd_t) */
|
||||
// #define FN_Sys_Error Sys_Error /* pfnSys_Error() Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. SDK2 */
|
||||
// #define FN_PM_Move PM_Move /* pfnPM_Move() (wd) SDK2 */
|
||||
// #define FN_PM_Init PM_Init /* pfnPM_Init() Server version of player movement initialization; (wd) SDK2 */
|
||||
// #define FN_PM_FindTextureType PM_FindTextureType /* pfnPM_FindTextureType() (wd) SDK2 */
|
||||
// #define FN_SetupVisibility SetupVisibility /* pfnSetupVisibility() Set up PVS and PAS for networking for this client; (wd) SDK2 */
|
||||
// #define FN_UpdateClientData UpdateClientData /* pfnUpdateClientData() Set up data sent only to specific client; (wd) SDK2 */
|
||||
// #define FN_AddToFullPack AddToFullPack /* pfnAddToFullPack() (wd) SDK2 */
|
||||
// #define FN_CreateBaseline CreateBaseline /* pfnCreateBaseline() Tweak entity baseline for network encoding allows setup of player baselines too.; (wd) SDK2 */
|
||||
// #define FN_RegisterEncoders RegisterEncoders /* pfnRegisterEncoders() Callbacks for network encoding; (wd) SDK2 */
|
||||
// #define FN_GetWeaponData GetWeaponData /* pfnGetWeaponData() (wd) SDK2 */
|
||||
// #define FN_CmdStart CmdStart /* pfnCmdStart() (wd) SDK2 */
|
||||
// #define FN_CmdEnd CmdEnd /* pfnCmdEnd() (wd) SDK2 */
|
||||
// #define FN_ConnectionlessPacket ConnectionlessPacket /* pfnConnectionlessPacket() (wd) SDK2 */
|
||||
// #define FN_GetHullBounds GetHullBounds /* pfnGetHullBounds() (wd) SDK2 */
|
||||
// #define FN_CreateInstancedBaselines CreateInstancedBaselines /* pfnCreateInstancedBaselines() (wd) SDK2 */
|
||||
// #define FN_InconsistentFile InconsistentFile /* pfnInconsistentFile() (wd) SDK2 */
|
||||
// #define FN_AllowLagCompensation AllowLagCompensation /* pfnAllowLagCompensation() (wd) SDK2 */
|
||||
|
||||
// - GetEntityAPI2_Post functions
|
||||
// #define FN_GameDLLInit_Post GameDLLInit_Post
|
||||
// #define FN_DispatchSpawn_Post DispatchSpawn_Post
|
||||
// #define FN_DispatchThink_Post DispatchThink_Post
|
||||
// #define FN_DispatchUse_Post DispatchUse_Post
|
||||
// #define FN_DispatchTouch_Post DispatchTouch_Post
|
||||
// #define FN_DispatchBlocked_Post DispatchBlocked_Post
|
||||
// #define FN_DispatchKeyValue_Post DispatchKeyValue_Post
|
||||
// #define FN_DispatchSave_Post DispatchSave_Post
|
||||
// #define FN_DispatchRestore_Post DispatchRestore_Post
|
||||
// #define FN_DispatchObjectCollsionBox_Post DispatchObjectCollsionBox_Post
|
||||
// #define FN_SaveWriteFields_Post SaveWriteFields_Post
|
||||
// #define FN_SaveReadFields_Post SaveReadFields_Post
|
||||
// #define FN_SaveGlobalState_Post SaveGlobalState_Post
|
||||
// #define FN_RestoreGlobalState_Post RestoreGlobalState_Post
|
||||
// #define FN_ResetGlobalState_Post ResetGlobalState_Post
|
||||
// #define FN_ClientConnect_Post ClientConnect_Post
|
||||
// #define FN_ClientDisconnect_Post ClientDisconnect_Post
|
||||
// #define FN_ClientKill_Post ClientKill_Post
|
||||
// #define FN_ClientPutInServer_Post ClientPutInServer_Post
|
||||
// #define FN_ClientCommand_Post ClientCommand_Post
|
||||
// #define FN_ClientUserInfoChanged_Post ClientUserInfoChanged_Post
|
||||
// #define FN_ServerActivate_Post ServerActivate_Post
|
||||
// #define FN_ServerDeactivate_Post ServerDeactivate_Post
|
||||
// #define FN_PlayerPreThink_Post PlayerPreThink_Post
|
||||
// #define FN_PlayerPostThink_Post PlayerPostThink_Post
|
||||
// #define FN_StartFrame_Post StartFrame_Post
|
||||
// #define FN_ParmsNewLevel_Post ParmsNewLevel_Post
|
||||
// #define FN_ParmsChangeLevel_Post ParmsChangeLevel_Post
|
||||
// #define FN_GetGameDescription_Post GetGameDescription_Post
|
||||
// #define FN_PlayerCustomization_Post PlayerCustomization_Post
|
||||
// #define FN_SpectatorConnect_Post SpectatorConnect_Post
|
||||
// #define FN_SpectatorDisconnect_Post SpectatorDisconnect_Post
|
||||
// #define FN_SpectatorThink_Post SpectatorThink_Post
|
||||
// #define FN_Sys_Error_Post Sys_Error_Post
|
||||
// #define FN_PM_Move_Post PM_Move_Post
|
||||
// #define FN_PM_Init_Post PM_Init_Post
|
||||
// #define FN_PM_FindTextureType_Post PM_FindTextureType_Post
|
||||
// #define FN_SetupVisibility_Post SetupVisibility_Post
|
||||
// #define FN_UpdateClientData_Post UpdateClientData_Post
|
||||
// #define FN_AddToFullPack_Post AddToFullPack_Post
|
||||
// #define FN_CreateBaseline_Post CreateBaseline_Post
|
||||
// #define FN_RegisterEncoders_Post RegisterEncoders_Post
|
||||
// #define FN_GetWeaponData_Post GetWeaponData_Post
|
||||
// #define FN_CmdStart_Post CmdStart_Post
|
||||
// #define FN_CmdEnd_Post CmdEnd_Post
|
||||
// #define FN_ConnectionlessPacket_Post ConnectionlessPacket_Post
|
||||
// #define FN_GetHullBounds_Post GetHullBounds_Post
|
||||
// #define FN_CreateInstancedBaselines_Post CreateInstancedBaselines_Post
|
||||
// #define FN_InconsistentFile_Post InconsistentFile_Post
|
||||
// #define FN_AllowLagCompensation_Post AllowLagCompensation_Post
|
||||
|
||||
// - GetEngineAPI functions
|
||||
// #define FN_PrecacheModel PrecacheModel
|
||||
// #define FN_PrecacheSound PrecacheSound
|
||||
// #define FN_SetModel SetModel
|
||||
// #define FN_ModelIndex ModelIndex
|
||||
// #define FN_ModelFrames ModelFrames
|
||||
// #define FN_SetSize SetSize
|
||||
// #define FN_ChangeLevel ChangeLevel
|
||||
// #define FN_GetSpawnParms GetSpawnParms
|
||||
// #define FN_SaveSpawnParms SaveSpawnParms
|
||||
// #define FN_VecToYaw VecToYaw
|
||||
// #define FN_VecToAngles VecToAngles
|
||||
// #define FN_MoveToOrigin MoveToOrigin
|
||||
// #define FN_ChangeYaw ChangeYaw
|
||||
// #define FN_ChangePitch ChangePitch
|
||||
// #define FN_FindEntityByString FindEntityByString
|
||||
// #define FN_GetEntityIllum GetEntityIllum
|
||||
// #define FN_FindEntityInSphere FindEntityInSphere
|
||||
// #define FN_FindClientInPVS FindClientInPVS
|
||||
// #define FN_EntitiesInPVS EntitiesInPVS
|
||||
// #define FN_MakeVectors MakeVectors
|
||||
// #define FN_AngleVectors AngleVectors
|
||||
// #define FN_CreateEntity CreateEntity
|
||||
// #define FN_RemoveEntity RemoveEntity
|
||||
// #define FN_CreateNamedEntity CreateNamedEntity
|
||||
// #define FN_MakeStatic MakeStatic
|
||||
// #define FN_EntIsOnFloor EntIsOnFloor
|
||||
// #define FN_DropToFloor DropToFloor
|
||||
// #define FN_WalkMove WalkMove
|
||||
// #define FN_SetOrigin SetOrigin
|
||||
// #define FN_EmitSound EmitSound
|
||||
// #define FN_EmitAmbientSound EmitAmbientSound
|
||||
// #define FN_TraceLine TraceLine
|
||||
// #define FN_TraceToss TraceToss
|
||||
// #define FN_TraceMonsterHull TraceMonsterHull
|
||||
// #define FN_TraceHull TraceHull
|
||||
// #define FN_TraceModel TraceModel
|
||||
// #define FN_TraceTexture TraceTexture
|
||||
// #define FN_TraceSphere TraceSphere
|
||||
// #define FN_GetAimVector GetAimVector
|
||||
// #define FN_ServerCommand ServerCommand
|
||||
// #define FN_ServerExecute ServerExecute
|
||||
// #define FN_engClientCommand engClientCommand
|
||||
// #define FN_ParticleEffect ParticleEffect
|
||||
// #define FN_LightStyle LightStyle
|
||||
// #define FN_DecalIndex DecalIndex
|
||||
// #define FN_PointContents PointContents
|
||||
// #define FN_MessageBegin MessageBegin
|
||||
// #define FN_MessageEnd MessageEnd
|
||||
// #define FN_WriteByte WriteByte
|
||||
// #define FN_WriteChar WriteChar
|
||||
// #define FN_WriteShort WriteShort
|
||||
// #define FN_WriteLong WriteLong
|
||||
// #define FN_WriteAngle WriteAngle
|
||||
// #define FN_WriteCoord WriteCoord
|
||||
// #define FN_WriteString WriteString
|
||||
// #define FN_WriteEntity WriteEntity
|
||||
// #define FN_CVarRegister CVarRegister
|
||||
// #define FN_CVarGetFloat CVarGetFloat
|
||||
// #define FN_CVarGetString CVarGetString
|
||||
// #define FN_CVarSetFloat CVarSetFloat
|
||||
// #define FN_CVarSetString CVarSetString
|
||||
// #define FN_AlertMessage AlertMessage
|
||||
// #define FN_EngineFprintf EngineFprintf
|
||||
// #define FN_PvAllocEntPrivateData PvAllocEntPrivateData
|
||||
// #define FN_PvEntPrivateData PvEntPrivateData
|
||||
// #define FN_FreeEntPrivateData FreeEntPrivateData
|
||||
// #define FN_SzFromIndex SzFromIndex
|
||||
// #define FN_AllocString AllocString
|
||||
// #define FN_GetVarsOfEnt GetVarsOfEnt
|
||||
// #define FN_PEntityOfEntOffset PEntityOfEntOffset
|
||||
// #define FN_EntOffsetOfPEntity EntOffsetOfPEntity
|
||||
// #define FN_IndexOfEdict IndexOfEdict
|
||||
// #define FN_PEntityOfEntIndex PEntityOfEntIndex
|
||||
// #define FN_FindEntityByVars FindEntityByVars
|
||||
// #define FN_GetModelPtr GetModelPtr
|
||||
// #define FN_RegUserMsg RegUserMsg
|
||||
// #define FN_AnimationAutomove AnimationAutomove
|
||||
// #define FN_GetBonePosition GetBonePosition
|
||||
// #define FN_FunctionFromName FunctionFromName
|
||||
// #define FN_NameForFunction NameForFunction
|
||||
// #define FN_ClientPrintf ClientPrintf
|
||||
// #define FN_ServerPrint ServerPrint
|
||||
// #define FN_Cmd_Args Cmd_Args
|
||||
// #define FN_Cmd_Argv Cmd_Argv
|
||||
// #define FN_Cmd_Argc Cmd_Argc
|
||||
// #define FN_GetAttachment GetAttachment
|
||||
// #define FN_CRC32_Init CRC32_Init
|
||||
// #define FN_CRC32_ProcessBuffer CRC32_ProcessBuffer
|
||||
// #define FN_CRC32_ProcessByte CRC32_ProcessByte
|
||||
// #define FN_CRC32_Final CRC32_Final
|
||||
// #define FN_RandomLong RandomLong
|
||||
// #define FN_RandomFloat RandomFloat
|
||||
// #define FN_SetView SetView
|
||||
// #define FN_Time Time
|
||||
// #define FN_CrosshairAngle CrosshairAngle
|
||||
// #define FN_LoadFileForMe LoadFileForMe
|
||||
// #define FN_FreeFile FreeFile
|
||||
// #define FN_EndSection EndSection
|
||||
// #define FN_CompareFileTime CompareFileTime
|
||||
// #define FN_GetGameDir GetGameDir
|
||||
// #define FN_Cvar_RegisterVariable Cvar_RegisterVariable
|
||||
// #define FN_FadeClientVolume FadeClientVolume
|
||||
// #define FN_SetClientMaxspeed SetClientMaxspeed
|
||||
// #define FN_CreateFakeClient CreateFakeClient
|
||||
// #define FN_RunPlayerMove RunPlayerMove
|
||||
// #define FN_NumberOfEntities NumberOfEntities
|
||||
// #define FN_GetInfoKeyBuffer GetInfoKeyBuffer
|
||||
// #define FN_InfoKeyValue InfoKeyValue
|
||||
// #define FN_SetKeyValue SetKeyValue
|
||||
// #define FN_SetClientKeyValue SetClientKeyValue
|
||||
// #define FN_IsMapValid IsMapValid
|
||||
// #define FN_StaticDecal StaticDecal
|
||||
// #define FN_PrecacheGeneric PrecacheGeneric
|
||||
// #define FN_GetPlayerUserId GetPlayerUserId
|
||||
// #define FN_BuildSoundMsg BuildSoundMsg
|
||||
// #define FN_IsDedicatedServer IsDedicatedServer
|
||||
// #define FN_CVarGetPointer CVarGetPointer
|
||||
// #define FN_GetPlayerWONId GetPlayerWONId
|
||||
// #define FN_Info_RemoveKey Info_RemoveKey
|
||||
// #define FN_GetPhysicsKeyValue GetPhysicsKeyValue
|
||||
// #define FN_SetPhysicsKeyValue SetPhysicsKeyValue
|
||||
// #define FN_GetPhysicsInfoString GetPhysicsInfoString
|
||||
// #define FN_PrecacheEvent PrecacheEvent
|
||||
// #define FN_PlaybackEvent PlaybackEvent
|
||||
// #define FN_SetFatPVS SetFatPVS
|
||||
// #define FN_SetFatPAS SetFatPAS
|
||||
// #define FN_CheckVisibility CheckVisibility
|
||||
// #define FN_DeltaSetField DeltaSetField
|
||||
// #define FN_DeltaUnsetField DeltaUnsetField
|
||||
// #define FN_DeltaAddEncoder DeltaAddEncoder
|
||||
// #define FN_GetCurrentPlayer GetCurrentPlayer
|
||||
// #define FN_CanSkipPlayer CanSkipPlayer
|
||||
// #define FN_DeltaFindField DeltaFindField
|
||||
// #define FN_DeltaSetFieldByIndex DeltaSetFieldByIndex
|
||||
// #define FN_DeltaUnsetFieldByIndex DeltaUnsetFieldByIndex
|
||||
// #define FN_SetGroupMask SetGroupMask
|
||||
// #define FN_engCreateInstancedBaseline engCreateInstancedBaseline
|
||||
// #define FN_Cvar_DirectSet Cvar_DirectSet
|
||||
// #define FN_ForceUnmodified ForceUnmodified
|
||||
// #define FN_GetPlayerStats GetPlayerStats
|
||||
// #define FN_AddServerCommand AddServerCommand
|
||||
// #define FN_Voice_GetClientListening Voice_GetClientListening
|
||||
// #define FN_Voice_SetClientListening Voice_SetClientListening
|
||||
// #define FN_GetPlayerAuthId GetPlayerAuthId
|
||||
|
||||
// - GetEngineAPI_Post functions
|
||||
// #define FN_PrecacheModel_Post PrecacheModel_Post
|
||||
// #define FN_PrecacheSound_Post PrecacheSound_Post
|
||||
// #define FN_SetModel_Post SetModel_Post
|
||||
// #define FN_ModelIndex_Post ModelIndex_Post
|
||||
// #define FN_ModelFrames_Post ModelFrames_Post
|
||||
// #define FN_SetSize_Post SetSize_Post
|
||||
// #define FN_ChangeLevel_Post ChangeLevel_Post
|
||||
// #define FN_GetSpawnParms_Post GetSpawnParms_Post
|
||||
// #define FN_SaveSpawnParms_Post SaveSpawnParms_Post
|
||||
// #define FN_VecToYaw_Post VecToYaw_Post
|
||||
// #define FN_VecToAngles_Post VecToAngles_Post
|
||||
// #define FN_MoveToOrigin_Post MoveToOrigin_Post
|
||||
// #define FN_ChangeYaw_Post ChangeYaw_Post
|
||||
// #define FN_ChangePitch_Post ChangePitch_Post
|
||||
// #define FN_FindEntityByString_Post FindEntityByString_Post
|
||||
// #define FN_GetEntityIllum_Post GetEntityIllum_Post
|
||||
// #define FN_FindEntityInSphere_Post FindEntityInSphere_Post
|
||||
// #define FN_FindClientInPVS_Post FindClientInPVS_Post
|
||||
// #define FN_EntitiesInPVS_Post EntitiesInPVS_Post
|
||||
// #define FN_MakeVectors_Post MakeVectors_Post
|
||||
// #define FN_AngleVectors_Post AngleVectors_Post
|
||||
// #define FN_CreateEntity_Post CreateEntity_Post
|
||||
// #define FN_RemoveEntity_Post RemoveEntity_Post
|
||||
// #define FN_CreateNamedEntity_Post CreateNamedEntity_Post
|
||||
// #define FN_MakeStatic_Post MakeStatic_Post
|
||||
// #define FN_EntIsOnFloor_Post EntIsOnFloor_Post
|
||||
// #define FN_DropToFloor_Post DropToFloor_Post
|
||||
// #define FN_WalkMove_Post WalkMove_Post
|
||||
// #define FN_SetOrigin_Post SetOrigin_Post
|
||||
// #define FN_EmitSound_Post EmitSound_Post
|
||||
// #define FN_EmitAmbientSound_Post EmitAmbientSound_Post
|
||||
// #define FN_TraceLine_Post TraceLine_Post
|
||||
// #define FN_TraceToss_Post TraceToss_Post
|
||||
// #define FN_TraceMonsterHull_Post TraceMonsterHull_Post
|
||||
// #define FN_TraceHull_Post TraceHull_Post
|
||||
// #define FN_TraceModel_Post TraceModel_Post
|
||||
// #define FN_TraceTexture_Post TraceTexture_Post
|
||||
// #define FN_TraceSphere_Post TraceSphere_Post
|
||||
// #define FN_GetAimVector_Post GetAimVector_Post
|
||||
// #define FN_ServerCommand_Post ServerCommand_Post
|
||||
// #define FN_ServerExecute_Post ServerExecute_Post
|
||||
// #define FN_engClientCommand_Post engClientCommand_Post
|
||||
// #define FN_ParticleEffect_Post ParticleEffect_Post
|
||||
// #define FN_LightStyle_Post LightStyle_Post
|
||||
// #define FN_DecalIndex_Post DecalIndex_Post
|
||||
// #define FN_PointContents_Post PointContents_Post
|
||||
// #define FN_MessageBegin_Post MessageBegin_Post
|
||||
// #define FN_MessageEnd_Post MessageEnd_Post
|
||||
// #define FN_WriteByte_Post WriteByte_Post
|
||||
// #define FN_WriteChar_Post WriteChar_Post
|
||||
// #define FN_WriteShort_Post WriteShort_Post
|
||||
// #define FN_WriteLong_Post WriteLong_Post
|
||||
// #define FN_WriteAngle_Post WriteAngle_Post
|
||||
// #define FN_WriteCoord_Post WriteCoord_Post
|
||||
// #define FN_WriteString_Post WriteString_Post
|
||||
// #define FN_WriteEntity_Post WriteEntity_Post
|
||||
// #define FN_CVarRegister_Post CVarRegister_Post
|
||||
// #define FN_CVarGetFloat_Post CVarGetFloat_Post
|
||||
// #define FN_CVarGetString_Post CVarGetString_Post
|
||||
// #define FN_CVarSetFloat_Post CVarSetFloat_Post
|
||||
// #define FN_CVarSetString_Post CVarSetString_Post
|
||||
// #define FN_AlertMessage_Post AlertMessage_Post
|
||||
// #define FN_EngineFprintf_Post EngineFprintf_Post
|
||||
// #define FN_PvAllocEntPrivateData_Post PvAllocEntPrivateData_Post
|
||||
// #define FN_PvEntPrivateData_Post PvEntPrivateData_Post
|
||||
// #define FN_FreeEntPrivateData_Post FreeEntPrivateData_Post
|
||||
// #define FN_SzFromIndex_Post SzFromIndex_Post
|
||||
// #define FN_AllocString_Post AllocString_Post
|
||||
// #define FN_GetVarsOfEnt_Post GetVarsOfEnt_Post
|
||||
// #define FN_PEntityOfEntOffset_Post PEntityOfEntOffset_Post
|
||||
// #define FN_EntOffsetOfPEntity_Post EntOffsetOfPEntity_Post
|
||||
// #define FN_IndexOfEdict_Post IndexOfEdict_Post
|
||||
// #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post
|
||||
// #define FN_FindEntityByVars_Post FindEntityByVars_Post
|
||||
// #define FN_GetModelPtr_Post GetModelPtr_Post
|
||||
// #define FN_RegUserMsg_Post RegUserMsg_Post
|
||||
// #define FN_AnimationAutomove_Post AnimationAutomove_Post
|
||||
// #define FN_GetBonePosition_Post GetBonePosition_Post
|
||||
// #define FN_FunctionFromName_Post FunctionFromName_Post
|
||||
// #define FN_NameForFunction_Post NameForFunction_Post
|
||||
// #define FN_ClientPrintf_Post ClientPrintf_Post
|
||||
// #define FN_ServerPrint_Post ServerPrint_Post
|
||||
// #define FN_Cmd_Args_Post Cmd_Args_Post
|
||||
// #define FN_Cmd_Argv_Post Cmd_Argv_Post
|
||||
// #define FN_Cmd_Argc_Post Cmd_Argc_Post
|
||||
// #define FN_GetAttachment_Post GetAttachment_Post
|
||||
// #define FN_CRC32_Init_Post CRC32_Init_Post
|
||||
// #define FN_CRC32_ProcessBuffer_Post CRC32_ProcessBuffer_Post
|
||||
// #define FN_CRC32_ProcessByte_Post CRC32_ProcessByte_Post
|
||||
// #define FN_CRC32_Final_Post CRC32_Final_Post
|
||||
// #define FN_RandomLong_Post RandomLong_Post
|
||||
// #define FN_RandomFloat_Post RandomFloat_Post
|
||||
// #define FN_SetView_Post SetView_Post
|
||||
// #define FN_Time_Post Time_Post
|
||||
// #define FN_CrosshairAngle_Post CrosshairAngle_Post
|
||||
// #define FN_LoadFileForMe_Post LoadFileForMe_Post
|
||||
// #define FN_FreeFile_Post FreeFile_Post
|
||||
// #define FN_EndSection_Post EndSection_Post
|
||||
// #define FN_CompareFileTime_Post CompareFileTime_Post
|
||||
// #define FN_GetGameDir_Post GetGameDir_Post
|
||||
// #define FN_Cvar_RegisterVariable_Post Cvar_RegisterVariable_Post
|
||||
// #define FN_FadeClientVolume_Post FadeClientVolume_Post
|
||||
// #define FN_SetClientMaxspeed_Post SetClientMaxspeed_Post
|
||||
// #define FN_CreateFakeClient_Post CreateFakeClient_Post
|
||||
// #define FN_RunPlayerMove_Post RunPlayerMove_Post
|
||||
// #define FN_NumberOfEntities_Post NumberOfEntities_Post
|
||||
// #define FN_GetInfoKeyBuffer_Post GetInfoKeyBuffer_Post
|
||||
// #define FN_InfoKeyValue_Post InfoKeyValue_Post
|
||||
// #define FN_SetKeyValue_Post SetKeyValue_Post
|
||||
// #define FN_SetClientKeyValue_Post SetClientKeyValue_Post
|
||||
// #define FN_IsMapValid_Post IsMapValid_Post
|
||||
// #define FN_StaticDecal_Post StaticDecal_Post
|
||||
// #define FN_PrecacheGeneric_Post PrecacheGeneric_Post
|
||||
// #define FN_GetPlayerUserId_Post GetPlayerUserId_Post
|
||||
// #define FN_BuildSoundMsg_Post BuildSoundMsg_Post
|
||||
// #define FN_IsDedicatedServer_Post IsDedicatedServer_Post
|
||||
// #define FN_CVarGetPointer_Post CVarGetPointer_Post
|
||||
// #define FN_GetPlayerWONId_Post GetPlayerWONId_Post
|
||||
// #define FN_Info_RemoveKey_Post Info_RemoveKey_Post
|
||||
// #define FN_GetPhysicsKeyValue_Post GetPhysicsKeyValue_Post
|
||||
// #define FN_SetPhysicsKeyValue_Post SetPhysicsKeyValue_Post
|
||||
// #define FN_GetPhysicsInfoString_Post GetPhysicsInfoString_Post
|
||||
// #define FN_PrecacheEvent_Post PrecacheEvent_Post
|
||||
// #define FN_PlaybackEvent_Post PlaybackEvent_Post
|
||||
// #define FN_SetFatPVS_Post SetFatPVS_Post
|
||||
// #define FN_SetFatPAS_Post SetFatPAS_Post
|
||||
// #define FN_CheckVisibility_Post CheckVisibility_Post
|
||||
// #define FN_DeltaSetField_Post DeltaSetField_Post
|
||||
// #define FN_DeltaUnsetField_Post DeltaUnsetField_Post
|
||||
// #define FN_DeltaAddEncoder_Post DeltaAddEncoder_Post
|
||||
// #define FN_GetCurrentPlayer_Post GetCurrentPlayer_Post
|
||||
// #define FN_CanSkipPlayer_Post CanSkipPlayer_Post
|
||||
// #define FN_DeltaFindField_Post DeltaFindField_Post
|
||||
// #define FN_DeltaSetFieldByIndex_Post DeltaSetFieldByIndex_Post
|
||||
// #define FN_DeltaUnsetFieldByIndex_Post DeltaUnsetFieldByIndex_Post
|
||||
// #define FN_SetGroupMask_Post SetGroupMask_Post
|
||||
// #define FN_engCreateInstancedBaseline_Post engCreateInstancedBaseline_Post
|
||||
// #define FN_Cvar_DirectSet_Post Cvar_DirectSet_Post
|
||||
// #define FN_ForceUnmodified_Post ForceUnmodified_Post
|
||||
// #define FN_GetPlayerStats_Post GetPlayerStats_Post
|
||||
// #define FN_AddServerCommand_Post AddServerCommand_Post
|
||||
// #define FN_Voice_GetClientListening_Post Voice_GetClientListening_Post
|
||||
// #define FN_Voice_SetClientListening_Post Voice_SetClientListening_Post
|
||||
// #define FN_GetPlayerAuthId_Post GetPlayerAuthId_Post
|
||||
|
||||
// #define FN_OnFreeEntPrivateData OnFreeEntPrivateData
|
||||
// #define FN_GameShutdown GameShutdown
|
||||
// #define FN_ShouldCollide ShouldCollide
|
||||
|
||||
// #define FN_OnFreeEntPrivateData_Post OnFreeEntPrivateData_Post
|
||||
// #define FN_GameShutdown_Post GameShutdown_Post
|
||||
// #define FN_ShouldCollide_Post ShouldCollide_Post
|
||||
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
Binary file not shown.
Before Width: | Height: | Size: 766 B |
|
@ -1,38 +0,0 @@
|
|||
-$A8
|
||||
-$B-
|
||||
-$C+
|
||||
-$D+
|
||||
-$E-
|
||||
-$F-
|
||||
-$G+
|
||||
-$H+
|
||||
-$I+
|
||||
-$J-
|
||||
-$K-
|
||||
-$L+
|
||||
-$M-
|
||||
-$N+
|
||||
-$O+
|
||||
-$P+
|
||||
-$Q-
|
||||
-$R-
|
||||
-$S-
|
||||
-$T-
|
||||
-$U-
|
||||
-$V+
|
||||
-$W-
|
||||
-$X+
|
||||
-$YD
|
||||
-$Z1
|
||||
-cg
|
||||
-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
-H+
|
||||
-W+
|
||||
-M
|
||||
-$M16384,1048576
|
||||
-K$00400000
|
||||
-LE"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-LN"c:\programme\borland\delphi7\Projects\Bpl"
|
||||
-w-UNSAFE_TYPE
|
||||
-w-UNSAFE_CODE
|
||||
-w-UNSAFE_CAST
|
|
@ -1,136 +0,0 @@
|
|||
[FileVersion]
|
||||
Version=7.0
|
||||
[Compiler]
|
||||
A=8
|
||||
B=0
|
||||
C=1
|
||||
D=1
|
||||
E=0
|
||||
F=0
|
||||
G=1
|
||||
H=1
|
||||
I=1
|
||||
J=0
|
||||
K=0
|
||||
L=1
|
||||
M=0
|
||||
N=1
|
||||
O=1
|
||||
P=1
|
||||
Q=0
|
||||
R=0
|
||||
S=0
|
||||
T=0
|
||||
U=0
|
||||
V=1
|
||||
W=0
|
||||
X=1
|
||||
Y=1
|
||||
Z=1
|
||||
ShowHints=1
|
||||
ShowWarnings=1
|
||||
UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||
NamespacePrefix=
|
||||
SymbolDeprecated=1
|
||||
SymbolLibrary=1
|
||||
SymbolPlatform=1
|
||||
UnitLibrary=1
|
||||
UnitPlatform=1
|
||||
UnitDeprecated=1
|
||||
HResultCompat=1
|
||||
HidingMember=1
|
||||
HiddenVirtual=1
|
||||
Garbage=1
|
||||
BoundsError=1
|
||||
ZeroNilCompat=1
|
||||
StringConstTruncated=1
|
||||
ForLoopVarVarPar=1
|
||||
TypedConstVarPar=1
|
||||
AsgToTypedConst=1
|
||||
CaseLabelRange=1
|
||||
ForVariable=1
|
||||
ConstructingAbstract=1
|
||||
ComparisonFalse=1
|
||||
ComparisonTrue=1
|
||||
ComparingSignedUnsigned=1
|
||||
CombiningSignedUnsigned=1
|
||||
UnsupportedConstruct=1
|
||||
FileOpen=1
|
||||
FileOpenUnitSrc=1
|
||||
BadGlobalSymbol=1
|
||||
DuplicateConstructorDestructor=1
|
||||
InvalidDirective=1
|
||||
PackageNoLink=1
|
||||
PackageThreadVar=1
|
||||
ImplicitImport=1
|
||||
HPPEMITIgnored=1
|
||||
NoRetVal=1
|
||||
UseBeforeDef=1
|
||||
ForLoopVarUndef=1
|
||||
UnitNameMismatch=1
|
||||
NoCFGFileFound=1
|
||||
MessageDirective=1
|
||||
ImplicitVariants=1
|
||||
UnicodeToLocale=1
|
||||
LocaleToUnicode=1
|
||||
ImagebaseMultiple=1
|
||||
SuspiciousTypecast=1
|
||||
PrivatePropAccessor=1
|
||||
UnsafeType=0
|
||||
UnsafeCode=0
|
||||
UnsafeCast=0
|
||||
[Linker]
|
||||
MapFile=0
|
||||
OutputObjs=0
|
||||
ConsoleApp=1
|
||||
DebugInfo=0
|
||||
RemoteSymbols=0
|
||||
MinStackSize=16384
|
||||
MaxStackSize=1048576
|
||||
ImageBase=4194304
|
||||
ExeDescription=
|
||||
[Directories]
|
||||
OutputDir=
|
||||
UnitOutputDir=
|
||||
PackageDLLOutputDir=
|
||||
PackageDCPOutputDir=
|
||||
SearchPath=
|
||||
Packages=vcl;rtl;vclx;vclie;xmlrtl;inetdbbde;inet;inetdbxpress;VclSmp;dbrtl;dbexpress;vcldb;dsnap;dbxcds;inetdb;bdertl;vcldbx;adortl;teeui;teedb;tee;ibxpress;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOffice2k;JvStdCtrlsD7R;JvAppFrmD7R;JvCoreD7R;JvBandsD7R;JvBDED7R;JvDBD7R;JvDlgsD7R;JvCmpD7R;JvCryptD7R;JvCtrlsD7R;JvCustomD7R;JvDockingD7R;JvDotNetCtrlsD7R;JvEDID7R;qrpt;JvGlobusD7R;JvHMID7R;JvInspectorD7R;JvInterpreterD7R;JvJansD7R;JvManagedThreadsD7R;JvMMD7R;JvNetD7R;JvPageCompsD7R;JvPluginD7R;JvPrintPreviewD7R;JvSystemD7R;JvTimeFrameworkD7R;JvUIBD7R;JvValidatorsD7R;JvWizardD7R;JvXPCtrlsD7R;Indy70;FlatStyle_D5;CrossKylix;DJcl;DelphiX_for7
|
||||
Conditionals=
|
||||
DebugSourceDirs=
|
||||
UsePackages=0
|
||||
[Parameters]
|
||||
RunParams=
|
||||
HostApplication=
|
||||
Launcher=
|
||||
UseLauncher=0
|
||||
DebugCWD=
|
||||
[Language]
|
||||
ActiveLang=
|
||||
ProjectLang=
|
||||
RootDir=
|
||||
[Version Info]
|
||||
IncludeVerInfo=1
|
||||
AutoIncBuild=1
|
||||
MajorVer=2
|
||||
MinorVer=1
|
||||
Release=0
|
||||
Build=6
|
||||
Debug=0
|
||||
PreRelease=0
|
||||
Special=0
|
||||
Private=0
|
||||
DLL=0
|
||||
Locale=1031
|
||||
CodePage=1252
|
||||
[Version Info Keys]
|
||||
CompanyName=AMX Mod X
|
||||
FileDescription=Final
|
||||
FileVersion=2.1.0.6
|
||||
InternalName=
|
||||
LegalCopyright=
|
||||
LegalTrademarks=
|
||||
OriginalFilename=
|
||||
ProductName=AMXX-Edit v2
|
||||
ProductVersion=2.1.0.0
|
||||
Comments=
|
|
@ -1,76 +0,0 @@
|
|||
program AMXX_Edit_v2;
|
||||
|
||||
{
|
||||
AMXX-Edit v2
|
||||
|
||||
Editor for AMX Mod X scripts, coded by Basic-Master
|
||||
© by AMX Mod X Development Team
|
||||
|
||||
This application uses the following components:
|
||||
|
||||
DelphiSci: delphisci.sourceforge.net (based on Scintilla library: scintilla.sourceforge.net)
|
||||
FlatStyle by Maik Porkert (found on www.torry.net)
|
||||
GlyFX Icons: www.glyfx.com (using GlyFX Icon Pack of Delphi 2005 PE)
|
||||
Modified CorelButton (see CorelButton.pas, original by ConquerWare)
|
||||
Indy 9 Socket Components: www.indyproject.org
|
||||
[JEDI component library, only necersarry for Exception Dialog (jvcl.sourceforge.net)]
|
||||
|
||||
AMXX-Edit v2 is published under GNU General Public License and comes
|
||||
with ABSOLUTELY NO WARRANTY (see GPL.txt for more information)
|
||||
}
|
||||
|
||||
|
||||
//{$DEFINE EXCEPTION_DEBUG} // Remove comments only when you want to trace exceptions
|
||||
|
||||
uses
|
||||
Forms,
|
||||
Windows,
|
||||
Classes,
|
||||
SysUtils,
|
||||
UnitfrmMain in 'UnitfrmMain.pas' {frmMain},
|
||||
UnitfrmOptions in 'UnitfrmOptions.pas' {frmSettings},
|
||||
UnitfrmDebug in 'UnitfrmDebug.pas' {frmDebug},
|
||||
UnitFunc in 'UnitFunc.pas',
|
||||
UnitfrmAbout in 'UnitfrmAbout.pas' {frmAbout},
|
||||
UnitfrmGoToLine in 'UnitfrmGoToLine.pas' {frmGoToLine},
|
||||
UnitfrmSaveDialog in 'UnitfrmSaveDialog.pas' {frmSaveDialog},
|
||||
UnitTextAnalyze in 'UnitTextAnalyze.pas',
|
||||
UnitfrmMenuMaker in 'UnitfrmMenuMaker.pas' {frmMenuMaker},
|
||||
UnitAddMenu in 'UnitAddMenu.pas',
|
||||
UnitfrmSelectMenu in 'UnitfrmSelectMenu.pas' {frmSelectMenu},
|
||||
UnitHowToMakePlayerMenu in 'UnitHowToMakePlayerMenu.pas' {frmHowToMakePlayerMenu},
|
||||
UnitfrmSockets in 'UnitfrmSockets.pas' {frmSocketTerminal},
|
||||
UnitReadThread in 'UnitReadThread.pas',
|
||||
UnitfrmLoopGenerator in 'UnitfrmLoopGenerator.pas' {frmLoopGenerator},
|
||||
UnitfrmExceptionHandler in 'UnitfrmExceptionHandler.pas' {ExceptionDialog};
|
||||
|
||||
{$R *.res}
|
||||
|
||||
var i: integer;
|
||||
begin
|
||||
if (FindWindow('TfrmMain', 'AMXX-Edit v2') <> 0) then begin // Don't allow 2 starts...
|
||||
for i := 1 to ParamCount do begin
|
||||
if FileExists(ParamStr(i)) then
|
||||
SendOpen(ParamStr(i)); // ... and send open message to the other app
|
||||
end;
|
||||
ShowWindow(FindWindow('TfrmMain', 'AMXX-Edit v2'), SW_SHOW);
|
||||
SetForegroundWindow(FindWindow('TfrmMain', 'AMXX-Edit v2'));
|
||||
exit;
|
||||
end;
|
||||
Application.Initialize;
|
||||
Application.Title := 'AMXX-Edit v2';
|
||||
Application.CreateForm(TfrmMain, frmMain);
|
||||
Application.CreateForm(TfrmSettings, frmSettings);
|
||||
Application.CreateForm(TfrmDebug, frmDebug);
|
||||
Application.CreateForm(TfrmAbout, frmAbout);
|
||||
Application.CreateForm(TfrmGoToLine, frmGoToLine);
|
||||
Application.CreateForm(TfrmSaveDialog, frmSaveDialog);
|
||||
Application.CreateForm(TfrmMenuMaker, frmMenuMaker);
|
||||
Application.CreateForm(TfrmSelectMenu, frmSelectMenu);
|
||||
Application.CreateForm(TfrmHowToMakePlayerMenu, frmHowToMakePlayerMenu);
|
||||
Application.CreateForm(TfrmSocketTerminal, frmSocketTerminal);
|
||||
Application.CreateForm(TfrmLoopGenerator, frmLoopGenerator);
|
||||
Load;
|
||||
Apply;
|
||||
Application.Run;
|
||||
end.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,300 +0,0 @@
|
|||
(**
|
||||
* TCorelButton v1.0
|
||||
* ---------------------------------------------------------------------------
|
||||
* A standard TButton which mimic the buttons used in the new Corel products
|
||||
* (e.g. WordPerfect Suite and Corel Photopaint).
|
||||
*
|
||||
* Copyright 1998, Peter Theill. All Rights Reserved.
|
||||
*
|
||||
* This component can be freely used and distributed in commercial and private
|
||||
* environments, provied this notice is not modified in any way and there is
|
||||
* no charge for it other than nomial handling fees. Contact me directly for
|
||||
* modifications to this agreement.
|
||||
* ----------------------------------------------------------------------------
|
||||
* Feel free to contact me if you have any questions, comments or suggestions
|
||||
* at peter@conquerware.dk
|
||||
*
|
||||
* The latest version will always be available on the web at:
|
||||
* http://www.conquerware.dk/delphi/
|
||||
*
|
||||
* See CorelButton.txt for notes, known issues and revision history.
|
||||
* ----------------------------------------------------------------------------
|
||||
* Last modified: September 6, 1998
|
||||
* ----------------------------------------------------------------------------
|
||||
*)
|
||||
unit CorelButton;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||
StdCtrls;
|
||||
|
||||
type
|
||||
TCorelButton = class(TButton)
|
||||
private
|
||||
FCanvas: TCanvas;
|
||||
IsFocused: Boolean;
|
||||
|
||||
FIsMouseOver: Boolean;
|
||||
FCanSelect: Boolean;
|
||||
|
||||
procedure CNMeasureItem(var Msg: TWMMeasureItem); message CN_MEASUREITEM;
|
||||
procedure CNDrawItem(var Msg: TWMDrawItem); message CN_DRAWITEM;
|
||||
procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
|
||||
procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
|
||||
procedure WMLButtonDblClk(var Message: TWMLButtonDblClk); message WM_LBUTTONDBLCLK;
|
||||
|
||||
procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
|
||||
procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
|
||||
|
||||
procedure DrawItem(const DrawItemStruct: TDrawItemStruct);
|
||||
procedure SetCanSelect(const Value: Boolean);
|
||||
|
||||
protected
|
||||
procedure CreateParams(var Params: TCreateParams); override;
|
||||
|
||||
procedure SetButtonStyle(ADefault: Boolean); override;
|
||||
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
destructor Destroy; override;
|
||||
|
||||
published
|
||||
property CanSelect: Boolean read FCanSelect write SetCanSelect default True;
|
||||
|
||||
end;
|
||||
|
||||
procedure Register;
|
||||
|
||||
implementation
|
||||
|
||||
constructor TCorelButton.Create(AOwner: TComponent);
|
||||
begin
|
||||
|
||||
{ Do standard stuff }
|
||||
inherited Create(AOwner);
|
||||
|
||||
FCanvas := TCanvas.Create;
|
||||
|
||||
FIsMouseOver := False;
|
||||
|
||||
{ Set width and height of button }
|
||||
Width := 75;
|
||||
Height := 23;
|
||||
|
||||
end;
|
||||
|
||||
destructor TCorelButton.Destroy;
|
||||
begin
|
||||
FCanvas.Free;
|
||||
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CMMouseEnter(var Message: TMessage);
|
||||
begin
|
||||
|
||||
if (not FIsMouseOver) then
|
||||
Invalidate;
|
||||
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CMMouseLeave(var Message: TMessage);
|
||||
begin
|
||||
|
||||
if (FIsMouseOver) then
|
||||
Invalidate;
|
||||
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CNMeasureItem(var Msg: TWMMeasureItem);
|
||||
begin
|
||||
with Msg.MeasureItemStruct^ do begin
|
||||
itemWidth := Width;
|
||||
itemHeight := Height;
|
||||
end;
|
||||
Msg.Result := 1;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CNDrawItem(var Msg: TWMDrawItem);
|
||||
begin
|
||||
DrawItem(Msg.DrawItemStruct^);
|
||||
Msg.Result := 1;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.DrawItem(const DrawItemStruct: TDrawItemStruct);
|
||||
var
|
||||
IsDown, IsDefault: Boolean;
|
||||
R: TRect;
|
||||
// Flags: Longint;
|
||||
CursorPos: TPoint;
|
||||
BtnRect: TRect;
|
||||
|
||||
begin
|
||||
|
||||
FCanvas.Handle := DrawItemStruct.hDC;
|
||||
try
|
||||
R := ClientRect;
|
||||
|
||||
with DrawItemStruct do begin
|
||||
IsDown := (itemState and ODS_SELECTED) <> 0;
|
||||
IsDefault := (itemState and ODS_FOCUS) <> 0;
|
||||
end;
|
||||
|
||||
GetCursorPos(CursorPos);
|
||||
BtnRect.TopLeft := Parent.ClientToScreen(Point(Left, Top));
|
||||
BtnRect.BottomRight := Parent.ClientToScreen(Point(Left + Width,
|
||||
Top + Height));
|
||||
FIsMouseOver := PtInRect(BtnRect, CursorPos);
|
||||
|
||||
// Flags := DFCS_BUTTONPUSH or DFCS_ADJUSTRECT;
|
||||
// if IsDown then Flags := Flags or DFCS_PUSHED;
|
||||
// if DrawItemStruct.itemState and ODS_DISABLED <> 0 then
|
||||
// Flags := Flags or DFCS_INACTIVE;
|
||||
|
||||
FCanvas.Brush.Color := clBtnFace;
|
||||
|
||||
if {(csDesigning in ComponentState) OR} (IsDefault) or (FCanSelect) and (IsFocused) then begin
|
||||
|
||||
FCanvas.Pen.Color := clWindowText;
|
||||
FCanvas.Pen.Width := 1;
|
||||
FCanvas.Brush.Style := bsSolid;
|
||||
FCanvas.Rectangle(R.Left, R.Top, R.Right, R.Bottom);
|
||||
|
||||
InflateRect(R, -1, -1);
|
||||
|
||||
end;
|
||||
|
||||
FCanvas.FillRect(R);
|
||||
|
||||
if (csDesigning in ComponentState) OR (FIsMouseOver) then begin
|
||||
|
||||
FCanvas.Pen.Color := clWindowText;
|
||||
FCanvas.MoveTo(R.Right-1, R.Top);
|
||||
FCanvas.LineTo(R.Right-1, R.Bottom-1);
|
||||
FCanvas.LineTo(R.Left-1, R.Bottom-1);
|
||||
|
||||
FCanvas.Pen.Color := clBtnHighlight;
|
||||
FCanvas.MoveTo(R.Left, R.Bottom-2);
|
||||
FCanvas.LineTo(R.Left, R.Top);
|
||||
FCanvas.LineTo(R.Right-1, R.Top);
|
||||
|
||||
FCanvas.Pen.Color := clBtnShadow;
|
||||
FCanvas.MoveTo(R.Right-2, R.Top+1);
|
||||
FCanvas.LineTo(R.Right-2, R.Bottom-2);
|
||||
FCanvas.LineTo(R.Left, R.Bottom-2);
|
||||
|
||||
end else begin
|
||||
|
||||
FCanvas.Pen.Color := clBtnHighlight;
|
||||
FCanvas.Pen.Width := 1;
|
||||
FCanvas.MoveTo(R.Left, R.Bottom-2);
|
||||
FCanvas.LineTo(R.Left, R.Top);
|
||||
FCanvas.LineTo(R.Right-1, R.Top);
|
||||
|
||||
FCanvas.Pen.Color := clBtnShadow;
|
||||
FCanvas.LineTo(R.Right-1, R.Bottom-1);
|
||||
FCanvas.LineTo(R.Left-1, R.Bottom-1);
|
||||
|
||||
end;
|
||||
|
||||
if {(csDesigning in ComponentState) OR} (IsDown) then begin
|
||||
|
||||
FCanvas.Brush.Color := clBtnFace;
|
||||
FCanvas.FillRect(R);
|
||||
|
||||
FCanvas.Pen.Color := clBtnShadow;
|
||||
FCanvas.Pen.Width := 1;
|
||||
FCanvas.MoveTo(R.Left, R.Bottom-2);
|
||||
FCanvas.LineTo(R.Left, R.Top);
|
||||
FCanvas.LineTo(R.Right-1, R.Top);
|
||||
|
||||
FCanvas.Pen.Color := clBtnHighlight;
|
||||
FCanvas.LineTo(R.Right-1, R.Bottom-1);
|
||||
FCanvas.LineTo(R.Left-1, R.Bottom-1);
|
||||
|
||||
end;
|
||||
|
||||
if {(csDesigning in ComponentState) OR} (IsFocused) and (IsDefault) and (FCanSelect) then begin
|
||||
|
||||
InflateRect(R, -3, -3);
|
||||
FCanvas.Pen.Color := clWindowFrame;
|
||||
FCanvas.Brush.Color := clBtnFace;
|
||||
DrawFocusRect(FCanvas.Handle, R);
|
||||
|
||||
end;
|
||||
|
||||
if (IsDown) then
|
||||
OffsetRect(R, 1, 1);
|
||||
|
||||
{ Draw caption of button }
|
||||
with FCanvas do begin
|
||||
FCanvas.Font := Self.Font;
|
||||
Brush.Style := bsClear;
|
||||
Font.Color := clBtnText;
|
||||
if Enabled or ((DrawItemStruct.itemState and ODS_DISABLED) = 0) then begin
|
||||
DrawText(Handle, PChar(Caption), Length(Caption), R, DT_CENTER or
|
||||
DT_VCENTER or DT_SINGLELINE);
|
||||
end else begin
|
||||
OffsetRect(R, 1, 1);
|
||||
Font.Color := clBtnHighlight;
|
||||
DrawText(Handle, PChar(Caption), Length(Caption), R, DT_CENTER or
|
||||
DT_VCENTER or DT_SINGLELINE);
|
||||
OffsetRect(R, -1, -1);
|
||||
Font.Color := clBtnShadow;
|
||||
DrawText(Handle, PChar(Caption), Length(Caption), R, DT_CENTER or
|
||||
DT_VCENTER or DT_SINGLELINE);
|
||||
end;
|
||||
end;
|
||||
|
||||
finally
|
||||
FCanvas.Handle := 0;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CMFontChanged(var Message: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CMEnabledChanged(var Message: TMessage);
|
||||
begin
|
||||
inherited;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.WMLButtonDblClk(var Message: TWMLButtonDblClk);
|
||||
begin
|
||||
Perform(WM_LBUTTONDOWN, Message.Keys, Longint(Message.Pos));
|
||||
end;
|
||||
|
||||
procedure TCorelButton.SetButtonStyle(ADefault: Boolean);
|
||||
begin
|
||||
|
||||
if ADefault <> IsFocused then begin
|
||||
IsFocused := ADefault;
|
||||
Refresh;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCorelButton.CreateParams(var Params: TCreateParams);
|
||||
begin
|
||||
inherited CreateParams(Params);
|
||||
Params.Style := Params.Style OR BS_OWNERDRAW;
|
||||
end;
|
||||
|
||||
|
||||
procedure Register;
|
||||
begin
|
||||
RegisterComponents('Standard', [TCorelButton]);
|
||||
end;
|
||||
|
||||
procedure TCorelButton.SetCanSelect(const Value: Boolean);
|
||||
begin
|
||||
FCanSelect := Value;
|
||||
Repaint;
|
||||
end;
|
||||
|
||||
end.
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 37 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user