Compare commits
83 Commits
amxmodx-1.
...
amxmodx-1.
Author | SHA1 | Date | |
---|---|---|---|
6c6f7f499c | |||
d3a49d1d41 | |||
8736214678 | |||
b2aa069cd4 | |||
01bacc3275 | |||
53b7516449 | |||
916325d3db | |||
054f046807 | |||
a4e57797f5 | |||
afef83ae66 | |||
730857a23b | |||
7fd9fff987 | |||
3074ca0756 | |||
7b8165fe6f | |||
3774575160 | |||
57eec2b88e | |||
b2eb9df894 | |||
00e9f2bbea | |||
adf12ab745 | |||
9d4e5b18ee | |||
8a40ed8cd6 | |||
c79909eb80 | |||
26e8b0dbb6 | |||
a2c2dc88fc | |||
99f47224ee | |||
a085cef0d6 | |||
2980fb1d82 | |||
3ed92695be | |||
9d797f8664 | |||
d7dbf60c8f | |||
06923d0f6d | |||
948be015a7 | |||
1a339b2f77 | |||
39479f2403 | |||
e4beb3828a | |||
84caa10733 | |||
a8ff2abab5 | |||
b4d2f83d6f | |||
be28d95b8d | |||
2401d1833e | |||
a189c0bda7 | |||
cc462c9ccb | |||
3d7987e8d8 | |||
1c544f55ca | |||
5c231919b6 | |||
4b48be3e93 | |||
ca07e53293 | |||
3f2a8ccfc5 | |||
e097932ac9 | |||
27e4174be6 | |||
7f47d2de56 | |||
6200ee6977 | |||
e98fb7d6e4 | |||
4e6233b898 | |||
544b74f839 | |||
4a823a0894 | |||
53188ab941 | |||
5f7dabf9b6 | |||
e343d224ce | |||
188023b5ac | |||
f18adbf9d6 | |||
9959ef52b3 | |||
8e58484fc5 | |||
a58ab24b0c | |||
a67085217f | |||
f08f16c20d | |||
ec9d4a52fe | |||
01b955d2d4 | |||
a384a78544 | |||
b4ad89e6ef | |||
2b4ed9cc27 | |||
e986848faf | |||
21ceae3c9e | |||
51b9fae4bc | |||
4e7d24f64b | |||
40640c92d4 | |||
c5b3919122 | |||
29a22bb5fd | |||
2baf9c4c20 | |||
c4727c1dc3 | |||
4901dee86d | |||
c1f2a499f8 | |||
7aa31c764d |
@ -46,14 +46,15 @@
|
||||
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__
|
||||
// evilspy's fix for mingw
|
||||
#if defined __GNUC__
|
||||
typedef long long int64_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
#define HAVE_I64
|
||||
#elif defined __WIN32__ || defined _WIN32 || defined WIN32
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#define HAVE_I64
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
@ -2478,7 +2478,7 @@ static cell AMX_NATIVE_CALL get_func_id(AMX *amx, cell *params)
|
||||
const char *funcName = get_amxstring(amx, params[1], 0, len);
|
||||
|
||||
int index;
|
||||
if (amx_FindPublic(amx, funcName, &index) != AMX_ERR_NONE)
|
||||
if (amx_FindPublic(plugin->getAMX(), funcName, &index) != AMX_ERR_NONE)
|
||||
index = -1;
|
||||
|
||||
return index;
|
||||
@ -2771,6 +2771,18 @@ static cell AMX_NATIVE_CALL lang_phrase(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL amx_mkdir(AMX *amx, cell *params)
|
||||
{
|
||||
int len = 0;
|
||||
char *path = get_amxstring(amx, params[1], 0, len);
|
||||
|
||||
#ifdef __linux__
|
||||
return mkdir(path, 0700);
|
||||
#else
|
||||
return mkdir(path);
|
||||
#endif
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO amxmod_Natives[] = {
|
||||
{ "client_cmd", client_cmd },
|
||||
{ "client_print", client_print },
|
||||
@ -2934,5 +2946,6 @@ AMX_NATIVE_INFO amxmod_Natives[] = {
|
||||
{ "md5_file", amx_md5_file },
|
||||
{ "plugin_flags", plugin_flags},
|
||||
{ "lang_phrase", lang_phrase},
|
||||
{ "mkdir", amx_mkdir},
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
@ -37,9 +37,11 @@
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <ctype.h> //tolower, etc
|
||||
#include "string.h"
|
||||
#include <extdll.h>
|
||||
#include <meta_api.h>
|
||||
#include "mm_pextensions.h" // metamod-p extensions
|
||||
|
||||
#ifdef MEMORY_TEST
|
||||
#include "mmgr/mmgr.h"
|
||||
@ -66,7 +68,7 @@
|
||||
#include "amxxlog.h"
|
||||
|
||||
#define AMXXLOG_Log g_log.Log
|
||||
#define AMX_VERSION "1.00"
|
||||
#define AMX_VERSION "1.01"
|
||||
|
||||
extern AMX_NATIVE_INFO core_Natives[];
|
||||
extern AMX_NATIVE_INFO time_Natives[];
|
||||
@ -134,6 +136,7 @@ struct fakecmd_t {
|
||||
bool fake;
|
||||
};
|
||||
|
||||
extern pextension_funcs_t *gpMetaPExtFuncs;
|
||||
extern CLog g_log;
|
||||
extern CPluginMngr g_plugins;
|
||||
extern CTaskMngr g_tasksMngr;
|
||||
|
@ -2354,6 +2354,14 @@ void FakeMeta_New_CVarRegister(cvar_t *pCVar)
|
||||
|
||||
int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
||||
{
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs)
|
||||
{
|
||||
//load plugins in meta_attach
|
||||
m_Status = PL_OPENED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Load the library
|
||||
// We don't have to DLCLOSE here.
|
||||
m_Handle = DLOPEN(build_pathname("%s", m_Path.c_str()));
|
||||
@ -2419,6 +2427,18 @@ int CFakeMeta::CFakeMetaPlugin::Query(mutil_funcs_t *pMetaUtilFuncs)
|
||||
|
||||
int CFakeMeta::CFakeMetaPlugin::Attach(PLUG_LOADTIME now, meta_globals_t *pMGlobals, gamedll_funcs_t *pGameDllFuncs)
|
||||
{
|
||||
// evilspy's patch:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
if(PEXT_LOAD_PLUGIN_BY_NAME(PLID, m_Path.c_str(), now, (void**)&m_Handle) || !m_Handle) {
|
||||
m_Status = PL_FAILED;
|
||||
return 0;
|
||||
}
|
||||
|
||||
m_Status = PL_RUNNING;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!m_Handle)
|
||||
return 0;
|
||||
META_ATTACH_FN attachFn = (META_ATTACH_FN)DLSYM(m_Handle, "Meta_Attach");
|
||||
@ -2443,6 +2463,19 @@ int CFakeMeta::CFakeMetaPlugin::Detach(PLUG_LOADTIME now, PL_UNLOAD_REASON reaso
|
||||
{
|
||||
if (!m_Handle)
|
||||
return 0;
|
||||
|
||||
// evilspy's patch:
|
||||
//using metamod p-extensions?
|
||||
if (gpMetaPExtFuncs) {
|
||||
if(PEXT_UNLOAD_PLUGIN_BY_HANDLE(PLID, (void*)m_Handle, now, reason)) {
|
||||
m_Status = PL_FAILED;
|
||||
return 0;
|
||||
}
|
||||
m_Status = PL_OPENED;
|
||||
m_Handle = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
META_DETACH_FN detachFn = (META_DETACH_FN)DLSYM(m_Handle, "Meta_Detach");
|
||||
if (!detachFn)
|
||||
{
|
||||
@ -2533,6 +2566,11 @@ void CFakeMeta::ReleasePlugins()
|
||||
|
||||
bool CFakeMeta::AddCorePlugin()
|
||||
{
|
||||
// evilspy:
|
||||
// not needed when using metamod p-extensions
|
||||
if(gpMetaPExtFuncs)
|
||||
return true;
|
||||
|
||||
// Check whether there already is a core plugin
|
||||
if (m_Plugins.begin() && strcmp((*m_Plugins.begin()).GetPath(), "[AMXX Core]") == 0)
|
||||
return true;
|
||||
@ -2596,6 +2634,14 @@ int CFakeMeta::GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable /*from metamod*/, int
|
||||
*interfaceVersion = INTERFACE_VERSION;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// evilspy:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pFunctionTable, pAMXXFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pFunctionTable, &g_DllFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
@ -2625,6 +2671,14 @@ int CFakeMeta::GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable /*from metamod*/
|
||||
*interfaceVersion = INTERFACE_VERSION;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// evilspy
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pFunctionTable, pAMXXFunctionTable, sizeof( DLL_FUNCTIONS ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pFunctionTable, &g_DllFunctionTable_Post, sizeof( DLL_FUNCTIONS ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
@ -2654,6 +2708,14 @@ int CFakeMeta::GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inter
|
||||
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// evilspy:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pengfuncsFromEngine, pAMXXFunctionTable, sizeof( enginefuncs_t ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable, sizeof( enginefuncs_t ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
@ -2682,6 +2744,14 @@ int CFakeMeta::GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int *
|
||||
*interfaceVersion = ENGINE_INTERFACE_VERSION;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// evilspy:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pengfuncsFromEngine, pAMXXFunctionTable, sizeof( enginefuncs_t ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pengfuncsFromEngine, &g_EngineFunctionTable_Post, sizeof( enginefuncs_t ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
@ -2717,6 +2787,14 @@ int CFakeMeta::GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable, int *int
|
||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// evilspy:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pNewFunctionTable, pAMXXFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
@ -2752,6 +2830,14 @@ int CFakeMeta::GetNewDLLFunctions_Post(NEW_DLL_FUNCTIONS *pNewFunctionTable, int
|
||||
*interfaceVersion = NEW_DLL_FUNCTIONS_VERSION;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// evilspy:
|
||||
//using metamod p-extensions?
|
||||
if(gpMetaPExtFuncs) {
|
||||
memcpy( pNewFunctionTable, pAMXXFunctionTable, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
memcpy( pNewFunctionTable, &g_NewDllFunctionTable_Post, sizeof( NEW_DLL_FUNCTIONS ) );
|
||||
|
||||
// Make sure there is a core plugin
|
||||
|
@ -50,6 +50,7 @@ gamedll_funcs_t *gpGamedllFuncs;
|
||||
mutil_funcs_t *gpMetaUtilFuncs;
|
||||
enginefuncs_t g_engfuncs;
|
||||
globalvars_t *gpGlobals;
|
||||
pextension_funcs_t *gpMetaPExtFuncs;
|
||||
|
||||
funEventCall modMsgsEnd[MAX_REG_MSGS];
|
||||
funEventCall modMsgs[MAX_REG_MSGS];
|
||||
@ -422,9 +423,10 @@ void C_ServerDeactivate() {
|
||||
|
||||
for(int i = 1; i <= gpGlobals->maxClients; ++i){
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER_I(i);
|
||||
if (pPlayer->ingame){
|
||||
if (pPlayer->initialized)
|
||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||
|
||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||
if (pPlayer->ingame){
|
||||
|
||||
pPlayer->Disconnect();
|
||||
--g_players_num;
|
||||
@ -546,8 +548,10 @@ BOOL C_ClientConnect_Post( edict_t *pEntity, const char *pszName, const char *ps
|
||||
|
||||
void C_ClientDisconnect( edict_t *pEntity ) {
|
||||
CPlayer *pPlayer = GET_PLAYER_POINTER(pEntity);
|
||||
if (pPlayer->initialized)
|
||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||
|
||||
if (pPlayer->ingame) {
|
||||
executeForwards(FF_ClientDisconnect, pPlayer->index);
|
||||
--g_players_num;
|
||||
}
|
||||
pPlayer->Disconnect();
|
||||
@ -1039,10 +1043,24 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
||||
else
|
||||
LOG_ERROR(PLID, "unexpected version comparison; metavers=%s, mmajor=%d, mminor=%d; plugvers=%s, pmajor=%d, pminor=%d", ifvers, mmajor, mminor, META_INTERFACE_VERSION, pmajor, pminor);
|
||||
}
|
||||
|
||||
// We can set this to null here because Meta_PExtGiveFnptrs is called after this
|
||||
gpMetaPExtFuncs = NULL;
|
||||
|
||||
// :NOTE: Don't call modules query here (g_FakeMeta.Meta_Query), because we don't know modules yet. Do it in Meta_Attach
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
// evilspy's patch for mm-p ext support
|
||||
// this is called right after Meta_Query
|
||||
C_DLLEXPORT int Meta_PExtGiveFnptrs(int interfaceVersion, pextension_funcs_t *pMetaPExtFuncs) {
|
||||
if(interfaceVersion<META_PEXT_VERSION) {
|
||||
return(META_PEXT_VERSION);
|
||||
}
|
||||
gpMetaPExtFuncs = pMetaPExtFuncs;
|
||||
return(META_PEXT_VERSION);
|
||||
}
|
||||
|
||||
static META_FUNCTIONS gMetaFunctionTable;
|
||||
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs) {
|
||||
if(now > Plugin_info.loadable) {
|
||||
@ -1075,7 +1093,7 @@ C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, m
|
||||
g_mod_name.assign(a);
|
||||
|
||||
// ###### Print short GPL
|
||||
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004 AMX Mod X Development Team \n"
|
||||
print_srvconsole( "\n AMX Mod X version %s Copyright (c) 2004-2005 AMX Mod X Development Team \n"
|
||||
" AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.\n", AMX_VERSION);
|
||||
print_srvconsole( " This is free software and you are welcome to redistribute it under \n"
|
||||
" certain conditions; type 'amxx gpl' for details.\n \n");
|
||||
|
116
amxmodx/mm_pextensions.h
Executable file
116
amxmodx/mm_pextensions.h
Executable file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright (c) 2004 Jussi Kivilinna
|
||||
*
|
||||
* This file is part of "Metamod All-Mod-Support"-patch for Metamod.
|
||||
*
|
||||
* Metamod is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Metamod is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Metamod; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MM_PEXTENSIONS_H
|
||||
#define MM_PEXTENSIONS_H
|
||||
|
||||
#include "plinfo.h" // plid_t
|
||||
#include "meta_api.h" // PLUG_LOADTIME
|
||||
/*
|
||||
|
||||
How to use:
|
||||
1. Add new export function 'Meta_PExtGiveFnptrs' to your plugin file.
|
||||
'Meta_PExtGiveFnptrs' will be called right after 'Meta_Query' call.
|
||||
2. Meta_PExtGiveFnptrs is called with interface version 'META_PEXT_VERSION'
|
||||
and pointer to extension function table.
|
||||
3. Meta_PExtGiveFnptrs should return plugin's interface version.
|
||||
4. !NOTE! Metamod will not stop loading plugin even if plugin returns
|
||||
interface version greater than current. Plugin should disable itself in
|
||||
this kind of situation.
|
||||
|
||||
Example:
|
||||
#include "mm_pextensions.h"
|
||||
|
||||
pextension_funcs_t *gpMetaPExtFuncs;
|
||||
|
||||
int Meta_PExtGiveFnptrs(int interfaceVersion, pextension_funcs_t *pMetaPExtFuncs) {
|
||||
if(interfaceVersion < META_PEXT_VERSION) {
|
||||
LOG_DEVELOPER(PLID, "Error! Metamod is too old, please update!");
|
||||
gpMetaPExtFuncs = NULL;
|
||||
|
||||
return(META_PEXT_VERSION);
|
||||
}
|
||||
|
||||
gpMetaPExtFuncs = pMetaPExtFuncs;
|
||||
|
||||
return(META_PEXT_VERSION);
|
||||
}
|
||||
|
||||
Callback functions:
|
||||
- int PEXT_LOAD_PLUGIN_BY_NAME(PLID, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle);
|
||||
Parses 'cmdline' as metamod would parse 'meta load <cmdline>' and loads found
|
||||
plugin. If 'plugin_handle' is set, metamod writes module handle of loaded
|
||||
plugin at it.
|
||||
Returns zero on success.
|
||||
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||
|
||||
- int PEXT_UNLOAD_PLUGIN_BY_NAME(PLID, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||
Parses 'cmdline' as metamod would parse 'meta unload <cmdline>' and
|
||||
unloads found plugin.
|
||||
Returns zero on success.
|
||||
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||
|
||||
- int PEXT_UNLOAD_PLUGIN_BY_HANDLE(PLID, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||
Unloads plugin with 'plugin_handle'.
|
||||
Returns zero on success.
|
||||
For error codes see 'META_ERRNO' in 'types_meta.h'.
|
||||
|
||||
!NOTE! Plugin cannot unload itself!
|
||||
*/
|
||||
|
||||
// Interface version
|
||||
// 1: first version. Used in p13
|
||||
// 2: Complete remake (p14):
|
||||
// pfnLoadMetaPluginByName
|
||||
// pfnUnloadMetaPluginByName
|
||||
// pfnUnloadMetaPluginByHandle
|
||||
// v2 is locked now. Don't modify old functions. If you add new functions, increase META_PEXT_VERSION.
|
||||
#define META_PEXT_VERSION 2
|
||||
|
||||
// Meta PExtension Function table type.
|
||||
typedef struct pextension_funcs_s {
|
||||
int (*pfnLoadMetaPluginByName)(plid_t plid, const char *cmdline, PLUG_LOADTIME now, void **plugin_handle);
|
||||
int (*pfnUnloadMetaPluginByName)(plid_t plid, const char *cmdline, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||
int (*pfnUnloadMetaPluginByHandle)(plid_t plid, void *plugin_handle, PLUG_LOADTIME now, PL_UNLOAD_REASON reason);
|
||||
} pextension_funcs_t;
|
||||
|
||||
// Convenience macros for MetaPExtension functions.
|
||||
#define PEXT_LOAD_PLUGIN_BY_NAME (*gpMetaPExtFuncs->pfnLoadMetaPluginByName)
|
||||
#define PEXT_UNLOAD_PLUGIN_BY_NAME (*gpMetaPExtFuncs->pfnUnloadMetaPluginByName)
|
||||
#define PEXT_UNLOAD_PLUGIN_BY_HANDLE (*gpMetaPExtFuncs->pfnUnloadMetaPluginByHandle)
|
||||
|
||||
// Give plugin extension function table.
|
||||
C_DLLEXPORT int Meta_PExtGiveFnptrs(int interfaceVersion,
|
||||
pextension_funcs_t *pMetaPExtFuncs);
|
||||
typedef int (*META_GIVE_PEXT_FUNCTIONS_FN) (int interfaceVersion,
|
||||
pextension_funcs_t *pMetaPExtFuncs);
|
||||
|
||||
#endif /* MM_PEXTENSIONS_H */
|
@ -2648,7 +2648,7 @@ void MF_Log(const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
@ -2660,7 +2660,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -527,7 +527,7 @@ static cell AMX_NATIVE_CALL strbreak(AMX *amx, cell *params) /* 5 param */
|
||||
} else if (string[i] == '"' && quote_flag) {
|
||||
quote_flag = false;
|
||||
}
|
||||
if ((string[i] == ' ') && !quote_flag && !done_flag) {
|
||||
if (isspace(string[i]) && !quote_flag && !done_flag) {
|
||||
done_flag = true;
|
||||
i++;
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,0
|
||||
PRODUCTVERSION 1,0,0,0
|
||||
FILEVERSION 1,0,1,0
|
||||
PRODUCTVERSION 1,0,1,0
|
||||
FILEFLAGSMASK 0x17L
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -45,12 +45,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "Comments", "AMX Mod X"
|
||||
VALUE "FileDescription", "AMX Mod X"
|
||||
VALUE "FileVersion", "1.00"
|
||||
VALUE "FileVersion", "1.01"
|
||||
VALUE "InternalName", "amxmodx"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004, AMX Mod X Dev Team"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2005, AMX Mod X Dev Team"
|
||||
VALUE "OriginalFilename", "amxmodx_mm.dll"
|
||||
VALUE "ProductName", "AMX Mod X"
|
||||
VALUE "ProductVersion", "1.00"
|
||||
VALUE "ProductVersion", "1.01"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/clcmds.ini
|
||||
; Default File location: $moddir/addons/amxmodx/configs/clcmds.ini
|
||||
; To use with Players Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/configs.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/configs.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; Cvars Menu:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
|
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,7 +1,12 @@
|
||||
// Here you can add menu items from any plugin to Menus Front-End plugin, aka "amxmodmenu".
|
||||
// You can also add menu items to the normal non-admin client menu "amx_menu".
|
||||
//
|
||||
// Adding to "amxmodmenu":
|
||||
// Usage: "amx_addmenuitem <menu text> <menu command> <access flags> <plugin name>"
|
||||
//
|
||||
// Adding to "amx_menu":
|
||||
// Usage: "amx_addclientmenuitem <menu text> <menu command> <access flags> <plugin name>"
|
||||
//
|
||||
// <menu text>: This is the text displayed in the menu itself for this item.
|
||||
// <menu command>: This is the client command used to access the menu.
|
||||
// <access flags>: Specify what access flags admins must have to use this menu item. (Check users.ini for access flags.)
|
||||
@ -10,4 +15,5 @@
|
||||
// Example: (be sure to use quotes around parameters with spaces!)
|
||||
//
|
||||
// amx_addmenuitem "Weapon Arena" "weaponarena_menu" "hu" "Weapon Arena"
|
||||
// amx_addclientmenuitem "Warcraft 3" "war3menu" "" "Warcraft 3 XP"
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; Cvars Menu:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; Cvars Menu:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
|
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
|
@ -21,7 +21,7 @@ fun_amxx_amd64.so
|
||||
; ----------------------------------------------------------
|
||||
;fakemeta_amxx_i386.so
|
||||
;fakemeta_amxx.dll
|
||||
;fakeneta_amxx_amd64.so
|
||||
;fakemeta_amxx_amd64.so
|
||||
|
||||
; -------------------------------------------
|
||||
; Database Access - only enable one of these
|
||||
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/clcmds.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/clcmds.ini
|
||||
; To use with Players Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cmds.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cmds.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; Cvars Menu:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
@ -11,8 +11,8 @@ co_angst
|
||||
ns_hera
|
||||
ns_lost
|
||||
ns_nothing
|
||||
co_niveus
|
||||
co_faceoff
|
||||
ns_mineshaft
|
||||
co_daimos
|
||||
ns_bast
|
||||
ns_origin
|
||||
@ -25,5 +25,5 @@ co_ulysses
|
||||
ns_eclipse
|
||||
co_pulse
|
||||
ns_ayumi
|
||||
ns_agora
|
||||
ns_altair
|
||||
ns_eon
|
||||
|
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/speech.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/speech.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Users configuration file
|
||||
; File location: $moddir/addons/amxx/configs/users.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/users.ini
|
||||
|
||||
; Line starting with ; is a comment
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/speech.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/speech.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; NOTE: By default in all settings the access level is set to "u".
|
||||
|
@ -1,5 +1,5 @@
|
||||
// SQL configuration file
|
||||
// File location: $moddir/addons/amxx/configs/sql.cfg
|
||||
// File location: $moddir/addons/amxmodx/configs/sql.cfg
|
||||
|
||||
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
|
||||
// We recommend using your server IP address instead of its name
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Menu configuration file
|
||||
; File location: $moddir/addons/amxx/configs/cvars.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/cvars.ini
|
||||
; To use with Commands Menu plugin
|
||||
|
||||
; Cvars Menu:
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
|
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Maps configuration file
|
||||
; File location: $moddir/addons/amxx/configs/maps.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/maps.ini
|
||||
; To use with Maps Menu plugin
|
||||
|
||||
; Add in your mod's maps here
|
||||
|
@ -35,6 +35,10 @@ fun_amxx_amd64.so
|
||||
;pgsql_amxx.dll
|
||||
; Microsoft SQL
|
||||
;mssql_amxx.dll
|
||||
; SQLite
|
||||
;sqlite_amxx.dll
|
||||
;sqlite_amxx_i386.so
|
||||
;sqlite_amxx_amd64.so
|
||||
|
||||
; ---------------------------------------------
|
||||
; GeoIP - determines the country of ip adresses
|
||||
|
@ -1,5 +1,5 @@
|
||||
; Users configuration file
|
||||
; File location: $moddir/addons/amxx/configs/users.ini
|
||||
; File location: $moddir/addons/amxmodx/configs/users.ini
|
||||
|
||||
; Line starting with ; is a comment
|
||||
|
||||
|
@ -45,6 +45,16 @@
|
||||
enginefuncs_t g_engfuncs;
|
||||
globalvars_t *gpGlobals;
|
||||
|
||||
|
||||
|
||||
DLL_FUNCTIONS *g_pFunctionTable;
|
||||
DLL_FUNCTIONS *g_pFunctionTable_Post;
|
||||
enginefuncs_t *g_pengfuncsTable;
|
||||
enginefuncs_t *g_pengfuncsTable_Post;
|
||||
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable;
|
||||
NEW_DLL_FUNCTIONS *g_pNewFunctionsTable_Post;
|
||||
|
||||
|
||||
// GetEntityAPI2 functions
|
||||
static DLL_FUNCTIONS g_EntityAPI_Table =
|
||||
{
|
||||
@ -2114,6 +2124,7 @@ C_DLLEXPORT int GetEntityAPI2(DLL_FUNCTIONS *pFunctionTable, int *interfaceVersi
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy(pFunctionTable, &g_EntityAPI_Table, sizeof(DLL_FUNCTIONS));
|
||||
g_pFunctionTable=pFunctionTable;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@ -2131,7 +2142,7 @@ C_DLLEXPORT int GetEntityAPI2_Post(DLL_FUNCTIONS *pFunctionTable, int *interface
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy( pFunctionTable, &g_EntityAPI_Post_Table, sizeof( DLL_FUNCTIONS ) );
|
||||
|
||||
g_pFunctionTable_Post=pFunctionTable;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
@ -2154,6 +2165,7 @@ C_DLLEXPORT int GetEngineFunctions(enginefuncs_t *pengfuncsFromEngine, int *inte
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Table, sizeof(enginefuncs_t));
|
||||
g_pengfuncsTable=pengfuncsFromEngine;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2171,6 +2183,7 @@ C_DLLEXPORT int GetEngineFunctions_Post(enginefuncs_t *pengfuncsFromEngine, int
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy(pengfuncsFromEngine, &g_EngineFuncs_Post_Table, sizeof(enginefuncs_t));
|
||||
g_pengfuncsTable_Post=pengfuncsFromEngine;
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
@ -2195,6 +2208,7 @@ C_DLLEXPORT int GetNewDLLFunctions(NEW_DLL_FUNCTIONS *pNewFunctionTable,
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy(pNewFunctionTable, &g_NewFuncs_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||
g_pNewFunctionsTable=pNewFunctionTable;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2212,6 +2226,7 @@ C_DLLEXPORT int GetNewDLLFunctions_Post( NEW_DLL_FUNCTIONS *pNewFunctionTable, i
|
||||
return(FALSE);
|
||||
}
|
||||
memcpy(pNewFunctionTable, &g_NewFuncs_Post_Table, sizeof(NEW_DLL_FUNCTIONS));
|
||||
g_pNewFunctionsTable_Post=pNewFunctionTable;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -2439,11 +2454,14 @@ PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
||||
PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||
PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||
PFN_LOG g_fn_Log;
|
||||
PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||
PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||
PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||
PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||
PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||
PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
||||
PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA;
|
||||
PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA;
|
||||
PFN_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||
PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||
PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||
@ -2453,6 +2471,7 @@ PFN_IS_PLAYER_AUTHORIZED g_fn_IsPlayerAuthorized;
|
||||
PFN_GET_PLAYER_TIME g_fn_GetPlayerTime;
|
||||
PFN_GET_PLAYER_PLAYTIME g_fn_GetPlayerPlayTime;
|
||||
PFN_GET_PLAYER_CURWEAPON g_fn_GetPlayerCurweapon;
|
||||
PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
PFN_GET_PLAYER_TEAMID g_fn_GetPlayerTeamID;
|
||||
PFN_GET_PLAYER_DEATHS g_fn_GetPlayerDeaths;
|
||||
PFN_GET_PLAYER_MENU g_fn_GetPlayerMenu;
|
||||
@ -2525,6 +2544,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("PrintSrvConsole", g_fn_PrintSrvConsole, PFN_PRINT_SRVCONSOLE);
|
||||
REQFUNC("GetModname", g_fn_GetModname, PFN_GET_MODNAME);
|
||||
REQFUNC("Log", g_fn_Log, PFN_LOG);
|
||||
REQFUNC("LogError", g_fn_LogErrorFunc, PFN_LOG_ERROR);
|
||||
REQFUNC("MergeDefinitionFile", g_fn_MergeDefinition_File, PFN_MERGEDEFINITION_FILE);
|
||||
REQFUNC("Format", g_fn_Format, PFN_FORMAT);
|
||||
|
||||
@ -2560,7 +2580,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("ExecuteForward", g_fn_ExecuteForward, PFN_EXECUTE_FORWARD);
|
||||
REQFUNC("PrepareCellArray", g_fn_PrepareCellArray, PFN_PREPARE_CELLARRAY);
|
||||
REQFUNC("PrepareCharArray", g_fn_PrepareCharArray, PFN_PREPARE_CHARARRAY);
|
||||
|
||||
REQFUNC("PrepareCellArrayA", g_fn_PrepareCellArrayA, PFN_PREPARE_CELLARRAY_A);
|
||||
REQFUNC("PrepareCharArrayA", g_fn_PrepareCharArrayA, PFN_PREPARE_CHARARRAY_A);
|
||||
// Player
|
||||
REQFUNC("IsPlayerValid", g_fn_IsPlayerValid, PFN_IS_PLAYER_VALID);
|
||||
REQFUNC("GetPlayerName", g_fn_GetPlayerName, PFN_GET_PLAYER_NAME);
|
||||
@ -2572,6 +2593,7 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc)
|
||||
REQFUNC("GetPlayerPlayTime", g_fn_GetPlayerPlayTime, PFN_GET_PLAYER_PLAYTIME);
|
||||
REQFUNC("GetPlayerCurweapon", g_fn_GetPlayerCurweapon, PFN_GET_PLAYER_CURWEAPON);
|
||||
REQFUNC("GetPlayerTeamID", g_fn_GetPlayerTeamID, PFN_GET_PLAYER_TEAMID);
|
||||
REQFUNC("GetPlayerTeam",g_fn_GetPlayerTeam, PFN_GET_PLAYER_TEAM);
|
||||
REQFUNC("GetPlayerDeaths", g_fn_GetPlayerDeaths, PFN_GET_PLAYER_DEATHS);
|
||||
REQFUNC("GetPlayerMenu", g_fn_GetPlayerMenu, PFN_GET_PLAYER_MENU);
|
||||
REQFUNC("GetPlayerKeys", g_fn_GetPlayerKeys, PFN_GET_PLAYER_KEYS);
|
||||
@ -2626,7 +2648,19 @@ void MF_Log(const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
{
|
||||
// :TODO: Overflow possible here
|
||||
char msg[3072];
|
||||
va_list arglst;
|
||||
va_start(arglst, fmt);
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
|
||||
@ -2649,11 +2683,14 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetAmxStringLen(NULL);
|
||||
MF_CopyAmxMemory(NULL, NULL, 0);
|
||||
MF_Log("str", "str", 0);
|
||||
MF_LogError(NULL, 0, NULL);
|
||||
MF_RaiseAmxError(NULL, 0);
|
||||
MF_RegisterForward("str", (ForwardExecType)0, 0, 0, 0);
|
||||
MF_ExecuteForward(0, 0, 0);
|
||||
MF_PrepareCellArray(NULL, 0);
|
||||
MF_PrepareCharArray(NULL, 0);
|
||||
MF_PrepareCellArrayA(NULL, 0, true);
|
||||
MF_PrepareCharArrayA(NULL, 0, true);
|
||||
MF_IsPlayerValid(0);
|
||||
MF_GetPlayerName(0);
|
||||
MF_GetPlayerIP(0);
|
||||
@ -2664,6 +2701,7 @@ void ValidateMacros_DontCallThis_Smiley()
|
||||
MF_GetPlayerPlayTime(0);
|
||||
MF_GetPlayerCurweapon(0);
|
||||
MF_GetPlayerTeamID(0);
|
||||
MF_GetPlayerTeam(0);
|
||||
MF_GetPlayerDeaths(0);
|
||||
MF_GetPlayerMenu(0);
|
||||
MF_GetPlayerKeys(0);
|
||||
|
@ -55,7 +55,7 @@ struct amxx_module_info_s
|
||||
// The next section is copied from the amx.h file
|
||||
// Copyright (c) ITB CompuPhase, 1997-2004
|
||||
|
||||
#if defined __LCC__ || defined __DMC__ || defined __linux__
|
||||
#if defined __LCC__ || defined __DMC__ || defined __linux__ || defined __GNUC__
|
||||
#include <stdint.h>
|
||||
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
|
||||
/* The ISO C99 defines the int16_t and int_32t types. If the compiler got
|
||||
@ -929,7 +929,7 @@ void FN_EngineFprintf(FILE *pfile, char *szFmt, ...);
|
||||
#endif // FN_EngineFprintf
|
||||
|
||||
#ifdef FN_PvAllocEntPrivateData
|
||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, long cb);
|
||||
void *FN_PvAllocEntPrivateData(edict_t *pEdict, int32 cb);
|
||||
#endif // FN_PvAllocEntPrivateData
|
||||
|
||||
#ifdef FN_PvEntPrivateData
|
||||
@ -1919,11 +1919,14 @@ typedef int (*PFN_GET_AMXSTRINGLEN) (const cell *ptr);
|
||||
typedef char * (*PFN_FORMAT_AMXSTRING) (AMX * /*amx*/, cell * /*params*/, int /*startParam*/, int * /*pLen*/);
|
||||
typedef void (*PFN_COPY_AMXMEMORY) (cell * /*dest*/, const cell * /*src*/, int /*len*/);
|
||||
typedef void (*PFN_LOG) (const char * /*fmt*/, ...);
|
||||
typedef void (*PFN_LOG_ERROR) (AMX * /*amx*/, int /*err*/, const char * /*fmt*/, ...);
|
||||
typedef int (*PFN_RAISE_AMXERROR) (AMX * /*amx*/, int /*error*/);
|
||||
typedef int (*PFN_REGISTER_FORWARD) (const char * /*funcname*/, ForwardExecType /*exectype*/, ... /*paramtypes terminated by PF_DONE*/);
|
||||
typedef int (*PFN_EXECUTE_FORWARD) (int /*id*/, ... /*params*/);
|
||||
typedef cell (*PFN_PREPARE_CELLARRAY) (cell * /*ptr*/, unsigned int /*size*/);
|
||||
typedef cell (*PFN_PREPARE_CHARARRAY) (char * /*ptr*/, unsigned int /*size*/);
|
||||
typedef cell (*PFN_PREPARE_CELLARRAY_A) (cell * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/);
|
||||
typedef cell (*PFN_PREPARE_CHARARRAY_A) (char * /*ptr*/, unsigned int /*size*/, bool /*copyBack*/);
|
||||
typedef int (*PFN_IS_PLAYER_VALID) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_NAME) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_IP) (int /*id*/);
|
||||
@ -1932,8 +1935,9 @@ typedef int (*PFN_IS_PLAYER_BOT) (int /*id*/);
|
||||
typedef int (*PFN_IS_PLAYER_AUTHORIZED) (int /*id*/);
|
||||
typedef float (*PFN_GET_PLAYER_TIME) (int /*id*/);
|
||||
typedef float (*PFN_GET_PLAYER_PLAYTIME) (int /*id*/);
|
||||
typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/);
|
||||
typedef int (*PFN_GETPLAYERFLAGS) (int /* id*/);
|
||||
typedef int (*PFN_GET_PLAYER_CURWEAPON) (int /*id*/);
|
||||
typedef const char * (*PFN_GET_PLAYER_TEAM) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_TEAMID) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_DEATHS) (int /*id*/);
|
||||
typedef int (*PFN_GET_PLAYER_MENU) (int /*id*/);
|
||||
@ -1986,11 +1990,14 @@ extern PFN_GET_AMXSTRINGLEN g_fn_GetAmxStringLen;
|
||||
extern PFN_FORMAT_AMXSTRING g_fn_FormatAmxString;
|
||||
extern PFN_COPY_AMXMEMORY g_fn_CopyAmxMemory;
|
||||
extern PFN_LOG g_fn_Log;
|
||||
extern PFN_LOG_ERROR g_fn_LogErrorFunc;
|
||||
extern PFN_RAISE_AMXERROR g_fn_RaiseAmxError;
|
||||
extern PFN_REGISTER_FORWARD g_fn_RegisterForward;
|
||||
extern PFN_EXECUTE_FORWARD g_fn_ExecuteForward;
|
||||
extern PFN_PREPARE_CELLARRAY g_fn_PrepareCellArray;
|
||||
extern PFN_PREPARE_CHARARRAY g_fn_PrepareCharArray;
|
||||
extern PFN_PREPARE_CELLARRAY_A g_fn_PrepareCellArrayA;
|
||||
extern PFN_PREPARE_CHARARRAY_A g_fn_PrepareCharArrayA;
|
||||
extern PFN_IS_PLAYER_VALID g_fn_IsPlayerValid;
|
||||
extern PFN_GET_PLAYER_NAME g_fn_GetPlayerName;
|
||||
extern PFN_GET_PLAYER_IP g_fn_GetPlayerIP;
|
||||
@ -2026,6 +2033,7 @@ extern PFN_AMX_FINDNATIVE g_fn_AmxFindNative;
|
||||
extern PFN_GETPLAYERFLAGS g_fn_GetPlayerFlags;
|
||||
extern PFN_GET_PLAYER_EDICT g_fn_GetPlayerEdict;
|
||||
extern PFN_FORMAT g_fn_Format;
|
||||
extern PFN_GET_PLAYER_TEAM g_fn_GetPlayerTeam;
|
||||
|
||||
#ifdef MAY_NEVER_BE_DEFINED
|
||||
// Function prototypes for intellisense and similar systems
|
||||
@ -2045,11 +2053,14 @@ int MF_GetAmxStringLen (const cell *ptr) { }
|
||||
char * MF_FormatAmxString (AMX * amx, cell * params, int startParam, int * pLen) { }
|
||||
void MF_CopyAmxMemory (cell * dest, const cell * src, int len) { }
|
||||
void MF_Log (const char * fmt, ...) { }
|
||||
void MF_LogError (AMX * amx, int err, const char *fmt, ...) { }
|
||||
int MF_RaiseAmxError (AMX * amx, int error) { }
|
||||
int MF_RegisterForward (const char * funcname, ForwardExecType exectype, ...) { }
|
||||
int MF_ExecuteForward (int id, ...) { }
|
||||
cell MF_PrepareCellArray (cell * ptr, unsigned int size) { }
|
||||
cell MF_PrepareCharArray (char * ptr, unsigned int size) { }
|
||||
cell MF_PrepareCellArrayA (cell * ptr, unsigned int size, bool copyBack) { }
|
||||
cell MF_PrepareCharArrayA (char * ptr, unsigned int size, bool copyBack) { }
|
||||
int MF_IsPlayerValid (int id) { }
|
||||
const char * MF_GetPlayerName (int id) { }
|
||||
const char * MF_GetPlayerIP (int id) { }
|
||||
@ -2059,6 +2070,7 @@ int MF_IsPlayerAuthorized (int id) { }
|
||||
float MF_GetPlayerTime (int id) { }
|
||||
float MF_GetPlayerPlayTime (int id) { }
|
||||
int MF_GetPlayerCurweapon (int id) { }
|
||||
const char * MF_GetPlayerTeam (int id) { }
|
||||
int MF_GetPlayerTeamID (int id) { }
|
||||
int MF_GetPlayerDeaths (int id) { }
|
||||
int MF_GetPlayerMenu (int id) { }
|
||||
@ -2094,11 +2106,14 @@ const char * MF_Format (const char *fmt, ...) { }
|
||||
#define MF_GetAmxStringLen g_fn_GetAmxStringLen
|
||||
#define MF_CopyAmxMemory g_fn_CopyAmxMemory
|
||||
void MF_Log(const char *fmt, ...);
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...);
|
||||
#define MF_RaiseAmxError g_fn_RaiseAmxError
|
||||
#define MF_RegisterForward g_fn_RegisterForward
|
||||
#define MF_ExecuteForward g_fn_ExecuteForward
|
||||
#define MF_PrepareCellArray g_fn_PrepareCellArray
|
||||
#define MF_PrepareCharArray g_fn_PrepareCharArray
|
||||
#define MF_PrepareCellArrayA g_fn_PrepareCellArrayA
|
||||
#define MF_PrepareCharArrayA g_fn_PrepareCharArrayA
|
||||
#define MF_IsPlayerValid g_fn_IsPlayerValid
|
||||
#define MF_GetPlayerName g_fn_GetPlayerName
|
||||
#define MF_GetPlayerIP g_fn_GetPlayerIP
|
||||
@ -2108,6 +2123,7 @@ void MF_Log(const char *fmt, ...);
|
||||
#define MF_GetPlayerTime g_fn_GetPlayerTime
|
||||
#define MF_GetPlayerPlayTime g_fn_GetPlayerPlayTime
|
||||
#define MF_GetPlayerCurweapon g_fn_GetPlayerCurweapon
|
||||
#define MF_GetPlayerTeam g_fn_GetPlayerTeam
|
||||
#define MF_GetPlayerTeamID g_fn_GetPlayerTeamID
|
||||
#define MF_GetPlayerDeaths g_fn_GetPlayerDeaths
|
||||
#define MF_GetPlayerMenu g_fn_GetPlayerMenu
|
||||
@ -2133,7 +2149,7 @@ void MF_Log(const char *fmt, ...);
|
||||
#define MF_UnregisterSPForward g_fn_UnregisterSPForward
|
||||
#define MF_GetPlayerFlags g_fn_GetPlayerFlags
|
||||
#define MF_GetPlayerEdict g_fn_GetPlayerEdict
|
||||
#define MF_Format g_fn_Format;
|
||||
#define MF_Format g_fn_Format
|
||||
|
||||
/*** Memory ***/
|
||||
void *operator new(size_t reportedSize);
|
||||
|
@ -2648,7 +2648,7 @@ void MF_Log(const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
@ -2660,7 +2660,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -346,6 +346,51 @@ static cell AMX_NATIVE_CALL cs_set_weapon_burstmode(AMX *amx, cell *params) // c
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_get_user_armor(AMX *amx, cell *params) // cs_get_user_armor(index, CsArmorType:&armortype); = 2 params
|
||||
{
|
||||
// Return how much armor and set reference of what type...
|
||||
// params[1] = user index
|
||||
// params[2] = byref, set armor type here (no armor/vest/vest+helmet)
|
||||
|
||||
CHECK_PLAYER(params[1]);
|
||||
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
cell *armorTypeByRef = MF_GetAmxAddr(amx, params[2]);
|
||||
*armorTypeByRef = *((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE);
|
||||
|
||||
return pPlayer->v.armorvalue;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_set_user_armor(AMX *amx, cell *params) // cs_set_user_armor(index, armorvalue, CsArmorType:armortype); = 3 params
|
||||
{
|
||||
// Set armor and set what type and send a message to client...
|
||||
// params[1] = user index
|
||||
// params[2] = armor value
|
||||
// params[3] = armor type (no armor/vest/vest+helmet)
|
||||
|
||||
CHECK_PLAYER(params[1]);
|
||||
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
// Set armor value
|
||||
pPlayer->v.armorvalue = params[2];
|
||||
|
||||
// Set armor type
|
||||
*((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE) = params[3];
|
||||
|
||||
if (params[3] == CS_ARMOR_KEVLAR || params[3] == CS_ARMOR_ASSAULTSUIT) {
|
||||
// And send appropriate message
|
||||
MESSAGE_BEGIN(params[1], GET_USER_MSG_ID(PLID, "ItemPickup", NULL), NULL, pPlayer);
|
||||
WRITE_STRING(params[3] == CS_ARMOR_KEVLAR ? "item_kevlar" : "item_assaultsuit");
|
||||
MESSAGE_END();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_user_vip(index); = 1 param
|
||||
{
|
||||
// Is user vip?
|
||||
@ -1193,6 +1238,8 @@ AMX_NATIVE_INFO cstrike_Exports[] = {
|
||||
{"cs_set_user_tked", cs_set_user_tked},
|
||||
{"cs_get_user_driving", cs_get_user_driving},
|
||||
{"cs_get_user_stationary", cs_get_user_stationary},
|
||||
{"cs_get_user_armor", cs_get_user_armor},
|
||||
{"cs_set_user_armor", cs_set_user_armor},
|
||||
//------------------- <-- max 19 characters!
|
||||
{NULL, NULL}
|
||||
};
|
||||
@ -1261,6 +1308,23 @@ void PlayerPostThink(edict_t* pPlayer) {
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL cs_user_has_shield(AMX *amx, cell *params)
|
||||
{
|
||||
//Return 1 if user has a shield.
|
||||
//params[1] = user id
|
||||
|
||||
//Check player
|
||||
CHECK_PLAYER(params[1]);
|
||||
|
||||
// Make into edict pointer
|
||||
edict_t *pPlayer = MF_GetPlayerEdict(params[1]);
|
||||
|
||||
if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void OnAmxxAttach()
|
||||
{
|
||||
MF_AddNatives(cstrike_Exports);
|
||||
|
@ -60,9 +60,12 @@
|
||||
|
||||
*/
|
||||
|
||||
#define HAS_SHIELD (1<<24) //16777216
|
||||
|
||||
// "player" entities
|
||||
#if !defined __amd64__
|
||||
// 32 bit offsets here
|
||||
#define OFFSET_ARMORTYPE 112 + EXTRAOFFSET
|
||||
#define OFFSET_TEAM 114 + EXTRAOFFSET
|
||||
#define OFFSET_CSMONEY 115 + EXTRAOFFSET
|
||||
#define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET
|
||||
@ -91,6 +94,7 @@
|
||||
#define OFFSET_C4_AMMO 390 + EXTRAOFFSET
|
||||
|
||||
#define OFFSET_CSDEATHS 444 + EXTRAOFFSET // 040926
|
||||
#define OFFSET_SHIELD 510 + EXTRAOFFSET
|
||||
// "weapon_*" entities
|
||||
#define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET_WEAPONS
|
||||
#define OFFSET_CLIPAMMO 51 + EXTRAOFFSET_WEAPONS
|
||||
@ -100,6 +104,7 @@
|
||||
#define OFFSET_HOSTAGEID 487 + EXTRAOFFSET
|
||||
#else
|
||||
// Amd64 offsets here
|
||||
#define OFFSET_ARMORTYPE 137 + EXTRAOFFSET
|
||||
#define OFFSET_TEAM 139 + EXTRAOFFSET // +25
|
||||
#define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25
|
||||
#define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25
|
||||
@ -128,6 +133,7 @@
|
||||
#define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44
|
||||
|
||||
#define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +49
|
||||
#define OFFSET_SHIELD 559 + EXTRAOFFSET
|
||||
// "weapon_*" entities
|
||||
#define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14
|
||||
#define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14
|
||||
@ -205,6 +211,10 @@
|
||||
#define AMD64_STATIONARY_NO 2
|
||||
#define AMD64_STATIONARY_YES 3
|
||||
|
||||
#define CS_ARMOR_NONE 0
|
||||
#define CS_ARMOR_KEVLAR 1
|
||||
#define CS_ARMOR_ASSAULTSUIT 2
|
||||
|
||||
enum CS_Internal_Models {
|
||||
CS_DONTCHANGE = 0,
|
||||
CS_CT_URBAN = 1,
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CStrike"
|
||||
#define MODULE_VERSION "1.00"
|
||||
#define MODULE_VERSION "1.01"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org"
|
||||
#define MODULE_LOGTAG "CSTRIKE"
|
||||
@ -459,4 +459,4 @@
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
@ -25,7 +25,7 @@ bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
||||
bool found = false;
|
||||
Obj* a = head;
|
||||
while ( a ){
|
||||
if ( a->time > gpGlobals->time ) {
|
||||
if ( a->time > gpGlobals->time && !found ) {
|
||||
if ( a->grenade == enemy ) {
|
||||
found = true;
|
||||
*p = a->player;
|
||||
@ -296,4 +296,5 @@ bool isModuleActive(){
|
||||
if ( !(int)CVAR_GET_FLOAT("csstats_pause") )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
345
dlls/csx/source/WinCSX/CRank.cpp
Executable file
345
dlls/csx/source/WinCSX/CRank.cpp
Executable file
@ -0,0 +1,345 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
//#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include <stdio.h>
|
||||
//#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
Stats::Stats(){
|
||||
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||
}
|
||||
void Stats::commit(Stats* a){
|
||||
hits += a->hits;
|
||||
shots += a->shots;
|
||||
damage += a->damage;
|
||||
hs += a->hs;
|
||||
tks += a->tks;
|
||||
kills += a->kills;
|
||||
deaths += a->deaths;
|
||||
|
||||
bDefusions += a->bDefusions;
|
||||
bDefused += a->bDefused;
|
||||
bPlants += a->bPlants;
|
||||
bExplosions += a->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
bodyHits[i] += a->bodyHits[i];
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
unique = 0;
|
||||
uniquelen = 0;
|
||||
score = 0;
|
||||
parent = pp;
|
||||
id = ++parent->rankNum;
|
||||
next = prev = 0;
|
||||
setName( nn );
|
||||
setUnique( uu );
|
||||
}
|
||||
|
||||
RankSystem::RankStats::~RankStats() {
|
||||
delete[] name;
|
||||
delete[] unique;
|
||||
--parent->rankNum;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
else
|
||||
namelen = 0;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
else
|
||||
uniquelen = 0;
|
||||
}
|
||||
|
||||
RankSystem::RankSystem() {
|
||||
head = 0;
|
||||
tail = 0;
|
||||
rankNum = 0;
|
||||
calc.code = 0;
|
||||
}
|
||||
|
||||
RankSystem::~RankSystem() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||
a->next = ptr;
|
||||
if ( ptr ){
|
||||
a->prev = ptr->prev;
|
||||
ptr->prev = a;
|
||||
}
|
||||
else{
|
||||
a->prev = head;
|
||||
head = a;
|
||||
}
|
||||
if ( a->prev ) a->prev->next = a;
|
||||
else tail = a;
|
||||
}
|
||||
|
||||
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||
a->prev = ptr;
|
||||
if ( ptr ){
|
||||
a->next = ptr->next;
|
||||
ptr->next = a;
|
||||
}
|
||||
else{
|
||||
a->next = tail;
|
||||
tail = a;
|
||||
}
|
||||
if ( a->next ) a->next->prev = a;
|
||||
else head = a;
|
||||
}
|
||||
|
||||
void RankSystem::unlink( RankStats* ptr ){
|
||||
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||
else tail = ptr->next;
|
||||
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||
else head = ptr->prev;
|
||||
}
|
||||
|
||||
void RankSystem::clear(){
|
||||
while( tail ){
|
||||
head = tail->next;
|
||||
delete tail;
|
||||
tail = head;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||
{
|
||||
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||
//LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::unloadCalc()
|
||||
{
|
||||
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||
}
|
||||
*/
|
||||
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique(), unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
a = new RankStats( unique ,name,this );
|
||||
if ( a == 0 ) return 0;
|
||||
put_after( a , 0 );
|
||||
return a;
|
||||
}
|
||||
|
||||
RankSystem::RankStats* RankSystem::findEntryInRankByUnique(const char* unique)
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique(), unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
return NULL; // none found
|
||||
}
|
||||
RankSystem::RankStats* RankSystem::findEntryInRankByPos(int position)
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if (a->getPosition() == position)
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||
{
|
||||
RankStats* rrFirst = rr;
|
||||
if (s != NULL)
|
||||
rr->addStats( s );
|
||||
if ( calc.code ) {
|
||||
calc.physAddr1[0] = rr->kills;
|
||||
calc.physAddr1[1] = rr->deaths;
|
||||
calc.physAddr1[2] = rr->hs;
|
||||
calc.physAddr1[3] = rr->tks;
|
||||
calc.physAddr1[4] = rr->shots;
|
||||
calc.physAddr1[5] = rr->hits;
|
||||
calc.physAddr1[6] = rr->damage;
|
||||
|
||||
calc.physAddr1[7] = rr->bDefusions;
|
||||
calc.physAddr1[8] = rr->bDefused;
|
||||
calc.physAddr1[9] = rr->bPlants;
|
||||
calc.physAddr1[10] = rr->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
calc.physAddr2[i] = rr->bodyHits[i];
|
||||
cell result = 0;
|
||||
//int err;
|
||||
//if ((err = MF_AmxExec(&calc.amx,&result, calc.func ,2,calc.amxAddr1,calc.amxAddr2 )) != AMX_ERR_NONE)
|
||||
//LOG_CONSOLE( PLID, "Run time error %d on line %ld (plugin \"%s\")", err,calc.amx.curline,LOCALINFO("csstats_score"));
|
||||
rr->score = result;
|
||||
}
|
||||
else rr->score = rr->kills - rr->deaths;
|
||||
|
||||
|
||||
RankStats* aa = rr->next;
|
||||
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||
rr->goUp();
|
||||
aa->goDown();
|
||||
aa = aa->next; // go to next rank
|
||||
}
|
||||
if ( aa != rr->next )
|
||||
{
|
||||
unlink( rr );
|
||||
put_before( rr, aa );
|
||||
}
|
||||
else
|
||||
{
|
||||
aa = rr->prev;
|
||||
while ( aa && (aa->score > rr->score) ) { // go down
|
||||
rr->goDown();
|
||||
aa->goUp();
|
||||
aa = aa->prev; // go to prev rank
|
||||
}
|
||||
if ( aa != rr->prev ){
|
||||
unlink( rr );
|
||||
put_after( rr, aa );
|
||||
}
|
||||
}
|
||||
return rrFirst->getPosition();
|
||||
}
|
||||
|
||||
bool RankSystem::loadRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen( filename , "rb" );
|
||||
|
||||
if ( !bfp ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
short int i = 0;
|
||||
fread(&i, 1 , sizeof(short int) , bfp);
|
||||
|
||||
if (i == RANK_VERSION)
|
||||
{
|
||||
Stats d;
|
||||
char unique[64], name[64];
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
while( i )
|
||||
{
|
||||
fread(name , i,sizeof(char) , bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
fread(unique , i,sizeof(char) , bfp);
|
||||
fread(&d.tks, 1,sizeof(int), bfp);
|
||||
fread(&d.damage, 1,sizeof(int), bfp);
|
||||
fread(&d.deaths, 1,sizeof(int), bfp);
|
||||
fread(&d.kills, 1,sizeof(int), bfp);
|
||||
fread(&d.shots, 1,sizeof(int), bfp);
|
||||
fread(&d.hits, 1,sizeof(int), bfp);
|
||||
fread(&d.hs, 1,sizeof(int), bfp);
|
||||
|
||||
fread(&d.bDefusions, 1,sizeof(int), bfp);
|
||||
fread(&d.bDefused, 1,sizeof(int), bfp);
|
||||
fread(&d.bPlants, 1,sizeof(int), bfp);
|
||||
fread(&d.bExplosions, 1,sizeof(int), bfp);
|
||||
|
||||
fread(d.bodyHits, 1,sizeof(d.bodyHits), bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||
|
||||
if ( a ) a->updatePosition( &d );
|
||||
}
|
||||
}
|
||||
fclose(bfp);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::saveRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen(filename, "wb");
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = RANK_VERSION;
|
||||
|
||||
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||
|
||||
fclose(bfp);
|
||||
}
|
128
dlls/csx/source/WinCSX/CRank.h
Executable file
128
dlls/csx/source/WinCSX/CRank.h
Executable file
@ -0,0 +1,128 @@
|
||||
|
||||
|
||||
#ifndef CRANK_H
|
||||
#define CRANK_H
|
||||
|
||||
#define RANK_VERSION 11
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
|
||||
struct Stats {
|
||||
int hits;
|
||||
int shots;
|
||||
int damage;
|
||||
int hs;
|
||||
int tks;
|
||||
int kills;
|
||||
int deaths;
|
||||
int bodyHits[9]; ////////////////////
|
||||
|
||||
// SiDLuke start
|
||||
int bPlants;
|
||||
int bExplosions;
|
||||
int bDefusions;
|
||||
int bDefused;
|
||||
// SiDLuke end :D
|
||||
|
||||
Stats();
|
||||
void commit(Stats* a);
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
|
||||
class RankSystem
|
||||
{
|
||||
public:
|
||||
class RankStats;
|
||||
friend class RankStats;
|
||||
class iterator;
|
||||
|
||||
class RankStats : public Stats {
|
||||
friend class RankSystem;
|
||||
friend class iterator;
|
||||
RankSystem* parent;
|
||||
RankStats* next;
|
||||
RankStats* prev;
|
||||
char* unique;
|
||||
short int uniquelen;
|
||||
char* name;
|
||||
short int namelen;
|
||||
int score;
|
||||
int id;
|
||||
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||
~RankStats();
|
||||
void setUnique( const char* nn );
|
||||
inline void goDown() {++id;}
|
||||
inline void goUp() {--id;}
|
||||
inline void addStats(Stats* a) { commit( a ); }
|
||||
public:
|
||||
void setName( const char* nn );
|
||||
inline const char* getName() const { return name ? name : ""; }
|
||||
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||
inline int getPosition() const { return id; }
|
||||
inline int updatePosition( Stats* points ) {
|
||||
return parent->updatePos( this , points );
|
||||
}
|
||||
inline void MarkToDelete() {
|
||||
this->score = (1<<31);
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
RankStats* head;
|
||||
RankStats* tail;
|
||||
int rankNum;
|
||||
|
||||
struct scoreCalc{
|
||||
AMX amx;
|
||||
void* code;
|
||||
int func;
|
||||
cell amxAddr1;
|
||||
cell amxAddr2;
|
||||
cell *physAddr1;
|
||||
cell *physAddr2;
|
||||
} calc;
|
||||
|
||||
void put_before( RankStats* a, RankStats* ptr );
|
||||
void put_after( RankStats* a, RankStats* ptr );
|
||||
void unlink( RankStats* ptr );
|
||||
int updatePos( RankStats* r , Stats* s );
|
||||
|
||||
public:
|
||||
|
||||
RankSystem();
|
||||
~RankSystem();
|
||||
|
||||
void saveRank( const char* filename );
|
||||
bool loadRank( const char* filename );
|
||||
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||
RankStats* findEntryInRankByUnique(const char* unique);
|
||||
RankStats* findEntryInRankByPos(int position);
|
||||
//bool loadCalc(const char* filename, char* error);
|
||||
inline int getRankNum( ) const { return rankNum; }
|
||||
void clear();
|
||||
//void unloadCalc();
|
||||
|
||||
class iterator {
|
||||
RankStats* ptr;
|
||||
public:
|
||||
iterator(RankStats* a): ptr(a){}
|
||||
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||
inline RankStats& operator*() { return *ptr;}
|
||||
operator bool () { return (ptr != 0); }
|
||||
};
|
||||
|
||||
inline iterator front() { return iterator(head); }
|
||||
inline iterator begin() { return iterator(tail); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
53
dlls/csx/source/WinCSX/ReadMe.txt
Executable file
@ -0,0 +1,53 @@
|
||||
========================================================================
|
||||
WIN32 APPLICATION : WinCSX Project Overview
|
||||
========================================================================
|
||||
|
||||
AppWizard has created this WinCSX application for you.
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your WinCSX application.
|
||||
|
||||
|
||||
WinCSX.vcproj
|
||||
This is the main project file for VC++ projects generated using an Application Wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
Application Wizard.
|
||||
|
||||
WinCSX.cpp
|
||||
This is the main application source file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
AppWizard has created the following resources:
|
||||
|
||||
WinCSX.rc
|
||||
This is a listing of all of the Microsoft Windows resources that the
|
||||
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||
Visual C++.
|
||||
|
||||
Resource.h
|
||||
This is the standard header file, which defines new resource IDs.
|
||||
Microsoft Visual C++ reads and updates this file.
|
||||
WinCSX.ico
|
||||
This is an icon file, which is used as the application's icon (32x32).
|
||||
This icon is included by the main resource file WinCSX.rc.
|
||||
|
||||
small.ico
|
||||
This is an icon file, which contains a smaller version (16x16)
|
||||
of the application's icon. This icon is included by the main resource
|
||||
file WinCSX.rc.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named WinCSX.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
Other notes:
|
||||
|
||||
AppWizard uses "TODO:" comments to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
52
dlls/csx/source/WinCSX/Resource.h
Executable file
52
dlls/csx/source/WinCSX/Resource.h
Executable file
@ -0,0 +1,52 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by WinCSX.rc
|
||||
//
|
||||
#define IDC_MYICON 2
|
||||
#define IDD_WINCSX_DIALOG 102
|
||||
#define IDS_APP_TITLE 103
|
||||
#define IDD_WINCSXBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_WINCSX 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_WINCSX 109
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_ABOUTBOX 129
|
||||
#define IDC_LIST 1010
|
||||
#define IDC_BUTTON_ABOUT 1029
|
||||
#define IDC_ABOUT 1029
|
||||
#define IDC_BUTTON_SAVECHANGES 1030
|
||||
#define IDC_BUTTON_CLEARSTATS 1031
|
||||
#define IDC_BUTTON_DELETE 1032
|
||||
#define IDC_EDIT_NAME 1100
|
||||
#define IDC_EDIT_POSITION 1101
|
||||
#define IDC_EDIT_AUTHID 1102
|
||||
#define IDC_EDIT_DAMAGE 1103
|
||||
#define IDC_EDIT_FRAGS 1104
|
||||
#define IDC_EDIT_DEATHS 1105
|
||||
#define IDC_EDIT_TKS 1106
|
||||
#define IDC_EDIT_SHOTS 1107
|
||||
#define IDC_EDIT_HITS 1108
|
||||
#define IDC_EDIT_HS 1109
|
||||
#define IDC_EDIT_PLANTS 1110
|
||||
#define IDC_EDIT_EXPLOSIONS 1111
|
||||
#define IDC_EDIT_DEFUSIONS 1112
|
||||
#define IDC_EDIT_DEFUSED 1113
|
||||
#define IDC_AUTHOR 1114
|
||||
#define ID_HELP_DIALOG 32771
|
||||
#define IDM_FILE_DIALOG 32773
|
||||
#define IDM_WINCSX 32774
|
||||
#define IDC_STATIC -1
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NO_MFC 1
|
||||
#define _APS_NEXT_RESOURCE_VALUE 131
|
||||
#define _APS_NEXT_COMMAND_VALUE 32775
|
||||
#define _APS_NEXT_CONTROL_VALUE 1033
|
||||
#define _APS_NEXT_SYMED_VALUE 110
|
||||
#endif
|
||||
#endif
|
460
dlls/csx/source/WinCSX/WinCSX.cpp
Executable file
460
dlls/csx/source/WinCSX/WinCSX.cpp
Executable file
@ -0,0 +1,460 @@
|
||||
// WinCSX.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "WinCSX.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int APIENTRY _tWinMain(HINSTANCE hInstance,
|
||||
HINSTANCE hPrevInstance,
|
||||
LPTSTR lpCmdLine,
|
||||
int nCmdShow)
|
||||
{
|
||||
// TODO: Place code here.
|
||||
MSG msg;
|
||||
HACCEL hAccelTable;
|
||||
|
||||
// Initialize global strings
|
||||
LoadString(hInstance, IDS_APP_TITLE, g_szTitle, MAX_LOADSTRING);
|
||||
|
||||
LoadString(hInstance, IDC_WINCSX, g_szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Perform application initialization:
|
||||
if (!InitInstance (hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
hAccelTable = LoadAccelerators(hInstance, (LPCTSTR)IDC_WINCSX);
|
||||
|
||||
// Show the dialog box now.
|
||||
DialogBox(hInst, (LPCTSTR)IDD_WINCSXBOX, g_hWnd, (DLGPROC)WinCSXBox);
|
||||
|
||||
// Main message loop:
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int) msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// FUNCTION: MyRegisterClass()
|
||||
//
|
||||
// PURPOSE: Registers the window class.
|
||||
//
|
||||
// COMMENTS:
|
||||
//
|
||||
// This function and its usage are only necessary if you want this code
|
||||
// to be compatible with Win32 systems prior to the 'RegisterClassEx'
|
||||
// function that was added to Windows 95. It is important to call this function
|
||||
// so that the application will get 'well formed' small icons associated
|
||||
// with it.
|
||||
//
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance)
|
||||
{
|
||||
WNDCLASSEX wcex;
|
||||
|
||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
||||
|
||||
wcex.style = 0; // CS_HREDRAW | CS_VREDRAW;
|
||||
wcex.lpfnWndProc = (WNDPROC)WndProc;
|
||||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_WINCSX);
|
||||
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = (LPCTSTR)IDC_WINCSX;
|
||||
wcex.lpszClassName = g_szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SMALL);
|
||||
|
||||
return RegisterClassEx(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: InitInstance(HANDLE, int)
|
||||
//
|
||||
// PURPOSE: Saves instance handle and creates main window
|
||||
//
|
||||
// COMMENTS:
|
||||
//
|
||||
// In this function, we save the instance handle in a global variable and
|
||||
// create and display the main program window.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Store instance handle in our global variable
|
||||
|
||||
g_hWnd = CreateWindow(g_szWindowClass, g_szTitle, WS_DLGFRAME, CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, hInstance, NULL); // WS_OVERLAPPED WS_MINIMIZE
|
||||
|
||||
if (!g_hWnd)
|
||||
{
|
||||
MessageBox(g_hWnd, "Failed to create main window!", "A caption", MB_OK);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(g_hWnd, SW_SHOWMINNOACTIVE); // nCmdShow SW_SHOWNORMAL were rubbish. SW_SHOWMINNOACTIVE looks ok.
|
||||
UpdateWindow(g_hWnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool LoadRankFromFile(HWND hDlg) {
|
||||
if ( !g_rank.begin() )
|
||||
{
|
||||
if (!g_rank.loadRank(STATS_FILENAME)) {
|
||||
MessageBox(hDlg, "File load failed! Make sure you have csstats.dat in the same directory as this executable. Exiting...", "Where IS that file of yours?", MB_OK);
|
||||
PostQuitMessage(0);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
|
||||
//
|
||||
// PURPOSE: Processes messages for the main window.
|
||||
//
|
||||
// WM_COMMAND - process the application menu
|
||||
// WM_PAINT - Paint the main window
|
||||
// WM_DESTROY - post a quit message and return
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
//int wmId, wmEvent;
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc;
|
||||
|
||||
switch (message)
|
||||
{
|
||||
case WM_PAINT:
|
||||
hdc = BeginPaint(hWnd, &ps);
|
||||
// TODO: Add any drawing code here...
|
||||
EndPaint(hWnd, &ps);
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateListBox(HWND hDlg) {
|
||||
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||
|
||||
// Clear first if there's anything in here already
|
||||
SendMessage(listbox, LB_RESETCONTENT, NULL, NULL);
|
||||
|
||||
if (g_rank.front() == NULL) {
|
||||
MessageBox(hDlg, "The stats file is empty", "Emptiness...", MB_OK);
|
||||
return;
|
||||
}
|
||||
// This part copies the occurring authids into the lefthand listbox.
|
||||
int index = 10, len = 0;
|
||||
char tempbuffer[1024];
|
||||
|
||||
for (RankSystem::iterator b = g_rank.front(); b; --b) {
|
||||
//if ((*b).getPosition() < 1) // umm... naaah!
|
||||
//continue;
|
||||
|
||||
_snprintf(tempbuffer, 1023, "%s", (*b).getName());
|
||||
|
||||
SendMessage( // returns LRESULT in lResult
|
||||
listbox, // handle to destination control
|
||||
LB_ADDSTRING, // message ID
|
||||
0, // = (WPARAM) () wParam;
|
||||
(LPARAM) tempbuffer // = (LPARAM) () lParam;
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
LRESULT InitWinCSXBox(HWND hDlg) {
|
||||
// Load the stats
|
||||
if (!LoadRankFromFile(hDlg))
|
||||
return TRUE;
|
||||
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void ClearStatsfields(HWND hDlg) {
|
||||
SetDlgItemText(hDlg, IDC_EDIT_POSITION, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_NAME, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_FRAGS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEATHS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_HS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_TKS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_SHOTS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_HITS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DAMAGE, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_PLANTS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_EXPLOSIONS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEFUSIONS, "");
|
||||
SetDlgItemText(hDlg, IDC_EDIT_DEFUSED, "");
|
||||
}
|
||||
|
||||
void ListboxItemSelected(HWND hDlg) {
|
||||
HWND hwndList = GetDlgItem(hDlg, IDC_LIST); // Get the handle of the listbox
|
||||
LRESULT nItem = SendMessage(hwndList, LB_GETCURSEL, 0, 0); // Get the item # that's selected. First item is prolly 0...
|
||||
if (nItem == LB_ERR) {
|
||||
// Error, reset the form items...
|
||||
//MessageBox(hDlg, "Error: Couldn't find the selected record in the listbox!", "Oh fiddlesticks!", MB_OK);
|
||||
ClearStatsfields(hDlg);
|
||||
return;
|
||||
}
|
||||
// Retrieve complete stats record of this position. Position in listbox should be same as rank in our records!
|
||||
RankSystem::RankStats* stats = g_rank.findEntryInRankByPos((int)nItem + 1);
|
||||
if (stats == NULL) {
|
||||
char msg[] = "Error: Couldn't find the record by position! (nItem = %d)";
|
||||
sprintf(msg, msg, nItem);
|
||||
MessageBox(hDlg, msg, "Oh fiddlesticks!", MB_OK);
|
||||
ClearStatsfields(hDlg);
|
||||
return;
|
||||
}
|
||||
// Copy data into form
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_POSITION, stats->getPosition(), 0);
|
||||
SetDlgItemText(hDlg, IDC_EDIT_NAME, stats->getName());
|
||||
SetDlgItemText(hDlg, IDC_EDIT_AUTHID, stats->getUnique());
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_FRAGS, stats->kills, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEATHS, stats->deaths, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_HS, stats->hs, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_TKS, stats->tks, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_SHOTS, stats->shots, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_HITS, stats->hits, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, stats->damage, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_PLANTS, stats->bPlants, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, stats->bExplosions, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, stats->bDefusions, 0);
|
||||
SetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, stats->bDefused, 0);
|
||||
}
|
||||
|
||||
void SaveChanges(HWND hDlg) {
|
||||
BOOL success;
|
||||
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
char authid[32]; // "primary key"
|
||||
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||
if (!entry) {
|
||||
char buffer[256];
|
||||
sprintf(buffer, "Authid %s not found!", authid);
|
||||
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
char name[32];
|
||||
GetDlgItemText(hDlg, IDC_EDIT_NAME, name, sizeof(name));
|
||||
int frags = GetDlgItemInt(hDlg, IDC_EDIT_FRAGS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int deaths = GetDlgItemInt(hDlg, IDC_EDIT_DEATHS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int hs = GetDlgItemInt(hDlg, IDC_EDIT_HS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int tks = GetDlgItemInt(hDlg, IDC_EDIT_TKS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int shots = GetDlgItemInt(hDlg, IDC_EDIT_SHOTS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int hits = GetDlgItemInt(hDlg, IDC_EDIT_HITS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int damage = GetDlgItemInt(hDlg, IDC_EDIT_DAMAGE, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int plants = GetDlgItemInt(hDlg, IDC_EDIT_PLANTS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int explosions = GetDlgItemInt(hDlg, IDC_EDIT_EXPLOSIONS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int defusions = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSIONS, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
int defused = GetDlgItemInt(hDlg, IDC_EDIT_DEFUSED, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
// Update stats in memory
|
||||
entry->setName(name);
|
||||
entry->kills = frags;
|
||||
entry->deaths = deaths;
|
||||
entry->hs = hs;
|
||||
entry->tks = tks;
|
||||
entry->shots = shots;
|
||||
entry->hits = hits;
|
||||
entry->damage = damage;
|
||||
entry->bPlants = plants;
|
||||
entry->bExplosions = explosions;
|
||||
entry->bDefusions = defusions;
|
||||
entry->bDefused = defused;
|
||||
|
||||
int newPosition = entry->updatePosition(NULL); // Updates rank (prolly just calculates "frags - deaths" and moves up/down in rank)
|
||||
|
||||
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||
|
||||
// Now update our listbox
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
char buffer[256];
|
||||
_snprintf(buffer, 255, "New rank of %s: %d", name, newPosition);
|
||||
MessageBox(hDlg, buffer, "Update succeeded", MB_OK);
|
||||
|
||||
// In the listbox, we need to reselect the item we just updated. Use the new name.
|
||||
HWND listbox = GetDlgItem(hDlg, IDC_LIST);
|
||||
if (SendMessage(listbox, LB_SELECTSTRING, newPosition - 1, (LPARAM)name) == LB_ERR)
|
||||
MessageBox(hDlg, "Error selecting item!", "Oh fiddlesticks!", MB_OK);
|
||||
else {
|
||||
// Update
|
||||
ListboxItemSelected(hDlg);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
BadEnd:
|
||||
MessageBox(hDlg, "Update failed", "Oh fiddlesticks!", MB_OK);
|
||||
}
|
||||
|
||||
void ClearStats(HWND hDlg) {
|
||||
if (MessageBox(hDlg, "Are you sure? If you continue the whole csstats.dat will be wiped out!", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||
return;
|
||||
g_rank.clear();
|
||||
g_rank.saveRank(STATS_FILENAME);
|
||||
|
||||
// Now update our listbox
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
// Update
|
||||
ListboxItemSelected(hDlg);
|
||||
}
|
||||
|
||||
void DeleteRecord(HWND hDlg) {
|
||||
if (MessageBox(hDlg, "Are you sure?", "Omg!", MB_OKCANCEL | MB_DEFBUTTON2 | MB_ICONWARNING) != IDOK)
|
||||
return;
|
||||
|
||||
BOOL success;
|
||||
int position = GetDlgItemInt(hDlg, IDC_EDIT_POSITION, &success, false);
|
||||
if (!success)
|
||||
goto BadEnd;
|
||||
|
||||
char authid[32]; // "primary key"
|
||||
GetDlgItemText(hDlg, IDC_EDIT_AUTHID, authid, sizeof(authid));
|
||||
RankSystem::RankStats* entry = g_rank.findEntryInRankByUnique(authid);
|
||||
if (!entry) {
|
||||
char buffer[256];
|
||||
sprintf(buffer, "Authid %s not found!", authid);
|
||||
MessageBox(hDlg, buffer, "Update failed", MB_OK);
|
||||
return;
|
||||
}
|
||||
|
||||
// Mark this record to delete it.
|
||||
entry->MarkToDelete();
|
||||
|
||||
// Save ranks from memory to disk.
|
||||
g_rank.saveRank(STATS_FILENAME); // Save changes to file
|
||||
|
||||
// Clear memory.
|
||||
g_rank.clear();
|
||||
|
||||
// Reload from disk into memory.
|
||||
LoadRankFromFile(hDlg);
|
||||
|
||||
// Update list box.
|
||||
UpdateListBox(hDlg);
|
||||
|
||||
MessageBox(hDlg, "Deleted record", "Delete succeeded", MB_OK);
|
||||
|
||||
return;
|
||||
|
||||
BadEnd:
|
||||
MessageBox(hDlg, "Delete failed", "Oh fiddlesticks!", MB_OK);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Message handler for WinCSXBox.
|
||||
LRESULT CALLBACK WinCSXBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
return InitWinCSXBox(hDlg); // load all data from file and fill the listbox with the shit
|
||||
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
PostQuitMessage(0);
|
||||
|
||||
return TRUE;
|
||||
case IDC_LIST:
|
||||
switch (HIWORD(wParam))
|
||||
{
|
||||
case LBN_SELCHANGE:
|
||||
// Omg omg, a line in linebox was selected.
|
||||
ListboxItemSelected(hDlg);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
case IDC_ABOUT:
|
||||
DialogBox(hInst, (LPCTSTR)IDD_ABOUTBOX, hDlg, (DLGPROC)AboutBox);
|
||||
break;
|
||||
case IDC_BUTTON_SAVECHANGES:
|
||||
SaveChanges(hDlg);
|
||||
break;
|
||||
case IDC_BUTTON_CLEARSTATS:
|
||||
ClearStats(hDlg);
|
||||
break;
|
||||
case IDC_BUTTON_DELETE:
|
||||
DeleteRecord(hDlg);
|
||||
//DialogBox(hInst, (LPCTSTR)IDD_DELETEBOX, hDlg, (DLGPROC)DeleteBox);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Message handler for AboutBox.
|
||||
LRESULT CALLBACK AboutBox(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDOK:
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, LOWORD(wParam));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
25
dlls/csx/source/WinCSX/WinCSX.h
Executable file
25
dlls/csx/source/WinCSX/WinCSX.h
Executable file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "resource.h"
|
||||
#include "CRank.h"
|
||||
|
||||
// Constants
|
||||
#define MAX_LOADSTRING 100
|
||||
#define VERSION "0.2"
|
||||
#define STATS_FILENAME "csstats.dat"
|
||||
|
||||
// Global Variables:
|
||||
HINSTANCE hInst; // current instance
|
||||
TCHAR g_szTitle[MAX_LOADSTRING]; // The title bar text
|
||||
TCHAR g_szWindowClass[MAX_LOADSTRING]; // the main window class name
|
||||
RankSystem g_rank;
|
||||
HWND g_hWnd;
|
||||
|
||||
// Forward declarations of functions included in this code module:
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK WinCSXBox(HWND, UINT, WPARAM, LPARAM);
|
||||
LRESULT CALLBACK AboutBox(HWND, UINT, WPARAM, LPARAM);
|
||||
bool LoadRankFromFile(HWND hDlg);
|
||||
|
BIN
dlls/csx/source/WinCSX/WinCSX.ico
Executable file
BIN
dlls/csx/source/WinCSX/WinCSX.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
216
dlls/csx/source/WinCSX/WinCSX.rc
Executable file
216
dlls/csx/source/WinCSX/WinCSX.rc
Executable file
@ -0,0 +1,216 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#define APSTUDIO_HIDDEN_SYMBOLS
|
||||
#include "windows.h"
|
||||
#undef APSTUDIO_HIDDEN_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Swedish resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_WINCSX ICON "WinCSX.ico"
|
||||
IDI_SMALL ICON "small.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDC_WINCSX MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
MENUITEM "WinCSX", IDM_WINCSX
|
||||
MENUITEM "E&xit", IDM_EXIT
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Accelerator
|
||||
//
|
||||
|
||||
IDC_WINCSX ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_WINCSXBOX DIALOGEX 22, 17, 253, 204
|
||||
STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "WinCSX"
|
||||
FONT 8, "System", 0, 0, 0x0
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "Close",IDOK,206,168,39,27,WS_GROUP
|
||||
LISTBOX IDC_LIST,4,5,94,190,LBS_HASSTRINGS |
|
||||
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
EDITTEXT IDC_EDIT_NAME,109,18,87,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_POSITION,206,18,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_AUTHID,109,48,87,12,ES_AUTOHSCROLL |
|
||||
ES_READONLY
|
||||
EDITTEXT IDC_EDIT_DAMAGE,206,48,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_FRAGS,109,78,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEATHS,157,78,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_TKS,206,78,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_SHOTS,109,108,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_HITS,157,108,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_HS,206,108,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_PLANTS,109,138,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_EXPLOSIONS,157,137,40,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEFUSIONS,206,137,39,12,ES_AUTOHSCROLL
|
||||
EDITTEXT IDC_EDIT_DEFUSED,109,168,40,12,ES_AUTOHSCROLL
|
||||
LTEXT "Name (last used)",IDC_STATIC,109,5,56,8
|
||||
LTEXT "Damage",IDC_STATIC,206,35,28,8
|
||||
LTEXT "Frags",IDC_STATIC,109,65,20,8
|
||||
LTEXT "Headshots",IDC_STATIC,206,95,36,8
|
||||
LTEXT "Team kills",IDC_STATIC,206,65,35,8
|
||||
LTEXT "Hits",IDC_STATIC,157,95,14,8
|
||||
LTEXT "Shots",IDC_STATIC,109,95,20,8
|
||||
LTEXT "Deaths",IDC_STATIC,157,65,24,8
|
||||
LTEXT "Authid",IDC_STATIC,109,35,21,8
|
||||
LTEXT "Position",IDC_STATIC,206,5,28,8
|
||||
LTEXT "Plants",IDC_STATIC,109,125,22,8
|
||||
LTEXT "Explosions",IDC_STATIC,157,125,38,8
|
||||
LTEXT "Defused",IDC_STATIC,109,155,28,8
|
||||
LTEXT "Defusions",IDC_STATIC,206,125,34,8
|
||||
PUSHBUTTON "About",IDC_ABOUT,109,185,40,10
|
||||
PUSHBUTTON "Save",IDC_BUTTON_SAVECHANGES,157,155,39,8
|
||||
PUSHBUTTON "Clear stats",IDC_BUTTON_CLEARSTATS,157,168,39,27
|
||||
PUSHBUTTON "Delete",IDC_BUTTON_DELETE,206,155,39,8
|
||||
END
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 186, 95
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
|
||||
WS_SYSMENU
|
||||
CAPTION "About"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,109,68,50,14
|
||||
LTEXT "WinCSX 0.3",IDC_STATIC,18,20,66,8
|
||||
LTEXT "By JGHG",IDC_STATIC,18,28,66,8
|
||||
LTEXT "2005",IDC_STATIC,18,36,66,8
|
||||
LTEXT "http://www.amxmodx.org/",IDC_STATIC,18,44,88,8
|
||||
END
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"#include ""windows.h""\r\n"
|
||||
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_WINCSXBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 4
|
||||
RIGHTMARGIN, 248
|
||||
VERTGUIDE, 98
|
||||
VERTGUIDE, 109
|
||||
VERTGUIDE, 157
|
||||
VERTGUIDE, 196
|
||||
VERTGUIDE, 206
|
||||
VERTGUIDE, 245
|
||||
TOPMARGIN, 5
|
||||
BOTTOMMARGIN, 195
|
||||
HORZGUIDE, 18
|
||||
HORZGUIDE, 35
|
||||
HORZGUIDE, 48
|
||||
HORZGUIDE, 65
|
||||
HORZGUIDE, 78
|
||||
HORZGUIDE, 95
|
||||
HORZGUIDE, 108
|
||||
HORZGUIDE, 125
|
||||
HORZGUIDE, 137
|
||||
HORZGUIDE, 155
|
||||
HORZGUIDE, 163
|
||||
HORZGUIDE, 168
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_APP_TITLE "WinCSX"
|
||||
IDC_WINCSX "WINCSX"
|
||||
END
|
||||
|
||||
#endif // Swedish resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
187
dlls/csx/source/WinCSX/WinCSX.vcproj
Executable file
187
dlls/csx/source/WinCSX/WinCSX.vcproj
Executable file
@ -0,0 +1,187 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="WinCSX"
|
||||
ProjectGUID="{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
Keyword="Win32Proj">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
|
||||
MinimalRebuild="TRUE"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="5"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="4"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile="$(OutDir)/WinCSX.pdb"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<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="1"
|
||||
CharacterSet="2">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS"
|
||||
RuntimeLibrary="4"
|
||||
UsePrecompiledHeader="3"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="TRUE"
|
||||
DebugInformationFormat="3"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)/WinCSX.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="TRUE"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"/>
|
||||
<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;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp">
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
|
||||
<File
|
||||
RelativePath=".\Resource.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
|
||||
<File
|
||||
RelativePath=".\small.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.ico">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\WinCSX.rc">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Dependencies"
|
||||
Filter="">
|
||||
<File
|
||||
RelativePath=".\amxxmodule.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\amxxmodule.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CRank.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CRank.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\moduleconfig.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt">
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
3049
dlls/csx/source/WinCSX/amxxmodule.cpp
Executable file
3049
dlls/csx/source/WinCSX/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2197
dlls/csx/source/WinCSX/amxxmodule.h
Executable file
2197
dlls/csx/source/WinCSX/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
462
dlls/csx/source/WinCSX/moduleconfig.h
Executable file
462
dlls/csx/source/WinCSX/moduleconfig.h
Executable file
@ -0,0 +1,462 @@
|
||||
// Configuration
|
||||
|
||||
#ifndef __MODULECONFIG_H__
|
||||
#define __MODULECONFIG_H__
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "1.00"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
// 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 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__
|
BIN
dlls/csx/source/WinCSX/small.ico
Executable file
BIN
dlls/csx/source/WinCSX/small.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
8
dlls/csx/source/WinCSX/stdafx.cpp
Executable file
8
dlls/csx/source/WinCSX/stdafx.cpp
Executable file
@ -0,0 +1,8 @@
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// WinCSX.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
20
dlls/csx/source/WinCSX/stdafx.h
Executable file
20
dlls/csx/source/WinCSX/stdafx.h
Executable file
@ -0,0 +1,20 @@
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
// Windows Header Files:
|
||||
#include <windows.h>
|
||||
// C RunTime Header Files
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
//#include "CRank.h"
|
||||
//#include "amx.h"
|
@ -2296,11 +2296,6 @@ C_DLLEXPORT int Meta_Query(char *ifvers, plugin_info_t **pPlugInfo, mutil_funcs_
|
||||
|
||||
C_DLLEXPORT int Meta_Attach(PLUG_LOADTIME now, META_FUNCTIONS *pFunctionTable, meta_globals_t *pMGlobals, gamedll_funcs_t *pGamedllFuncs)
|
||||
{
|
||||
if ( gpGamedllFuncs ){
|
||||
LOG_ERROR(PLID,"gpGamedllFuncs already set");
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
if(now > Plugin_info.loadable) {
|
||||
LOG_ERROR(PLID, "Can't load module right now");
|
||||
return(FALSE);
|
||||
@ -2653,7 +2648,7 @@ void MF_Log(const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_Log("[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_Log("[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
@ -2665,7 +2660,7 @@ void MF_LogError(AMX *amx, int err, const char *fmt, ...)
|
||||
vsprintf(msg, fmt, arglst);
|
||||
va_end(arglst);
|
||||
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_NAME, msg);
|
||||
g_fn_LogErrorFunc(amx, err, "[%s] %s", MODULE_LOGTAG, msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -48,6 +48,8 @@ int gmsgSendAudio;
|
||||
int gmsgTextMsg;
|
||||
int gmsgBarTime;
|
||||
|
||||
int g_CurrentMsg;
|
||||
|
||||
cvar_t init_csstats_maxsize ={"csstats_maxsize","3500", 0 , 3500.0 };
|
||||
cvar_t init_csstats_reset ={"csstats_reset","0"};
|
||||
cvar_t init_csstats_rank ={"csstats_rank","0"};
|
||||
@ -162,7 +164,7 @@ void ServerDeactivate() {
|
||||
|
||||
// clear custom weapons info
|
||||
for ( i=MAX_WEAPONS;i<MAX_WEAPONS+MAX_CWEAPONS;i++)
|
||||
weaponData[i].ammoSlot = 0;
|
||||
weaponData[i].used = false;
|
||||
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
@ -211,11 +213,12 @@ void MessageBegin_Post(int msg_dest, int msg_type, const float *pOrigin, edict_t
|
||||
mPlayerIndex = 0;
|
||||
mPlayer = 0;
|
||||
}
|
||||
mState = 0;
|
||||
if ( msg_type < 0 || msg_type >= MAX_REG_MSGS )
|
||||
msg_type = 0;
|
||||
function=modMsgs[msg_type];
|
||||
endfunction=modMsgsEnd[msg_type];
|
||||
mState = 0;
|
||||
g_CurrentMsg = msg_type;
|
||||
if ( g_CurrentMsg < 0 || g_CurrentMsg >= MAX_REG_MSGS )
|
||||
g_CurrentMsg = 0;
|
||||
function=modMsgs[g_CurrentMsg];
|
||||
endfunction=modMsgsEnd[g_CurrentMsg];
|
||||
RETURN_META(MRES_IGNORED);
|
||||
}
|
||||
|
||||
@ -332,7 +335,6 @@ void TraceLine_Post(const float *v1, const float *v2, int fNoMonsters, edict_t *
|
||||
}
|
||||
|
||||
void OnMetaAttach() {
|
||||
|
||||
CVAR_REGISTER (&init_csstats_maxsize);
|
||||
CVAR_REGISTER (&init_csstats_reset);
|
||||
CVAR_REGISTER (&init_csstats_rank);
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
// Module info
|
||||
#define MODULE_NAME "CSX"
|
||||
#define MODULE_VERSION "1.00"
|
||||
#define MODULE_VERSION "1.01"
|
||||
#define MODULE_AUTHOR "AMX Mod X Dev Team"
|
||||
#define MODULE_URL "http://www.amxmodx.org/"
|
||||
#define MODULE_LOGTAG "CSX"
|
||||
@ -459,4 +459,4 @@
|
||||
|
||||
#endif // USE_METAMOD
|
||||
|
||||
#endif // __MODULECONFIG_H__
|
||||
#endif // __MODULECONFIG_H__
|
||||
|
@ -3,6 +3,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csx", "csx.vcproj", "{1DC4A
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCSX", "..\WinCSX\WinCSX.vcproj", "{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfiguration) = preSolution
|
||||
Debug = Debug
|
||||
@ -13,6 +17,10 @@ Global
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Debug.Build.0 = Debug|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.ActiveCfg = Release|Win32
|
||||
{1DC4A99A-F23F-4AAE-881C-79D157C91155}.Release.Build.0 = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.ActiveCfg = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Debug.Build.0 = Debug|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.ActiveCfg = Release|Win32
|
||||
{39A1E5DD-81A1-441D-B99A-E50A01DB05D7}.Release.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
EndGlobalSection
|
||||
|
@ -188,7 +188,7 @@ static cell AMX_NATIVE_CALL get_user_stats2(AMX *amx, cell *params) /* 3 param *
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
||||
static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 7 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
@ -208,6 +208,8 @@ static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
||||
cpStats[7] = (*a).getPosition();
|
||||
|
||||
MF_SetAmxString(amx,params[4],(*a).getName(),params[5]);
|
||||
if (params[6] > 0)
|
||||
MF_SetAmxString(amx, params[6], (*a).getUnique(), params[7]);
|
||||
for(int i = 1; i < 8; ++i)
|
||||
cpBodyHits[i] = (*a).bodyHits[i];
|
||||
return --a ? index : 0;
|
||||
@ -217,7 +219,7 @@ static cell AMX_NATIVE_CALL get_stats(AMX *amx, cell *params) /* 3 param */
|
||||
return 0;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
||||
static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 4 param */
|
||||
{
|
||||
|
||||
int index = params[1] + 1;
|
||||
@ -225,6 +227,8 @@ static cell AMX_NATIVE_CALL get_stats2(AMX *amx, cell *params) /* 3 param */
|
||||
for(RankSystem::iterator a = g_rank.front(); a ;--a){
|
||||
if ((*a).getPosition() == index) {
|
||||
cell *cpStats = MF_GetAmxAddr(amx,params[2]);
|
||||
if (params[4] > 0)
|
||||
MF_SetAmxString(amx, params[3], (*a).getUnique(), params[4]);
|
||||
|
||||
cpStats[0] = (*a).bDefusions;
|
||||
cpStats[1] = (*a).bDefused;
|
||||
|
@ -7,12 +7,14 @@ int damage;
|
||||
int TA;
|
||||
int weapon;
|
||||
int aim;
|
||||
bool ignore;
|
||||
CPlayer *pAttacker;
|
||||
|
||||
|
||||
void Client_ResetHUD(void* mValue){
|
||||
if ( mPlayer )
|
||||
if ( mPlayer ){
|
||||
mPlayer->clearStats = gpGlobals->time + 0.25f;
|
||||
}
|
||||
}
|
||||
|
||||
void Client_WeaponList(void* mValue){
|
||||
@ -50,22 +52,30 @@ void Client_Damage(void* mValue){
|
||||
static int bits;
|
||||
switch (mState++) {
|
||||
case 1:
|
||||
ignore = false;
|
||||
damage = *(int*)mValue;
|
||||
break;
|
||||
case 2:
|
||||
bits = *(int*)mValue;
|
||||
break;
|
||||
case 3:
|
||||
if (!mPlayer || !damage || !*(float*)mValue || bits) break;
|
||||
if (!mPlayer || !damage || bits){
|
||||
ignore = true;
|
||||
break;
|
||||
}
|
||||
|
||||
edict_t *enemy;
|
||||
enemy = mPlayer->pEdict->v.dmg_inflictor;
|
||||
|
||||
if ( FNullEnt( enemy ) )
|
||||
if ( FNullEnt( enemy ) ){
|
||||
ignore = true;
|
||||
break;
|
||||
}
|
||||
|
||||
aim = 0;
|
||||
weapon = 0;
|
||||
pAttacker = NULL;
|
||||
|
||||
|
||||
if (enemy->v.flags & (FL_CLIENT | FL_FAKECLIENT) ) {
|
||||
pAttacker = GET_PLAYER_POINTER(enemy);
|
||||
aim = pAttacker->aiming;
|
||||
@ -81,7 +91,7 @@ void Client_Damage(void* mValue){
|
||||
}
|
||||
|
||||
void Client_Damage_End(void* mValue){
|
||||
if ( !mPlayer || !damage )
|
||||
if ( ignore )
|
||||
return;
|
||||
|
||||
if ( !pAttacker ) pAttacker = mPlayer;
|
||||
@ -203,4 +213,5 @@ void Client_BarTime(void* mValue){
|
||||
g_Defuser = mPlayerIndex;
|
||||
g_bombAnnounce = BOMB_DEFUSING;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
300
dlls/csx_sql/CMisc.cpp
Executable file
300
dlls/csx_sql/CMisc.cpp
Executable file
@ -0,0 +1,300 @@
|
||||
|
||||
|
||||
#include "CMisc.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
void Grenades::put( edict_t* grenade, float time, int type, CPlayer* player )
|
||||
{
|
||||
Obj* a = new Obj;
|
||||
if ( a == 0 ) return;
|
||||
a->player = player;
|
||||
a->grenade = grenade;
|
||||
a->time = gpGlobals->time + time;
|
||||
a->type = type;
|
||||
a->prev = 0;
|
||||
a->next = head;
|
||||
if ( head ) head->prev = a;
|
||||
head = a;
|
||||
}
|
||||
|
||||
bool Grenades::find( edict_t* enemy, CPlayer** p, int* type )
|
||||
{
|
||||
bool found = false;
|
||||
Obj* a = head;
|
||||
while ( a ){
|
||||
if ( a->time > gpGlobals->time && !found ) {
|
||||
if ( a->grenade == enemy ) {
|
||||
found = true;
|
||||
*p = a->player;
|
||||
*type = a->type;
|
||||
}
|
||||
}
|
||||
else {
|
||||
Obj* next = a->next;
|
||||
if (a->prev) a->prev->next = next;
|
||||
else head = next;
|
||||
if (next) next->prev = a->prev;
|
||||
delete a;
|
||||
a = next;
|
||||
continue;
|
||||
}
|
||||
a = a->next;
|
||||
}
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Grenades::clear()
|
||||
{
|
||||
while(head){
|
||||
Obj* a = head->next;
|
||||
delete head;
|
||||
head = a;
|
||||
}
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
void CPlayer::Disconnect(){
|
||||
|
||||
if ( ignoreBots(pEdict) || !isModuleActive() ) // ignore if he is bot and bots rank is disabled or module is paused
|
||||
return;
|
||||
|
||||
rank->updatePosition( &life );
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::PutInServer(){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
restartStats();
|
||||
const char* name = STRING(pEdict->v.netname);
|
||||
const char* unique = name;
|
||||
switch((int)csstats_rank->value) {
|
||||
case 1:
|
||||
if ( (unique = GETPLAYERAUTHID(pEdict)) == 0 )
|
||||
unique = name; // failed to get authid
|
||||
break;
|
||||
case 2:
|
||||
unique = ip;
|
||||
}
|
||||
rank = g_rank.findEntryInRank( unique , name );
|
||||
}
|
||||
|
||||
void CPlayer::Connect(const char* address ){
|
||||
bot = IsBot();
|
||||
strcpy(ip,address);
|
||||
rank = 0;
|
||||
clearStats = 0.0f;
|
||||
}
|
||||
|
||||
void CPlayer::restartStats(bool all)
|
||||
{
|
||||
if ( all ) memset(weapons,0,sizeof(weapons));
|
||||
memset(weaponsRnd,0,sizeof(weaponsRnd)); //DEC-Weapon (Round) stats
|
||||
memset(attackers,0,sizeof(attackers));
|
||||
memset(victims,0,sizeof(victims));
|
||||
memset(&life,0,sizeof(life));
|
||||
}
|
||||
|
||||
void CPlayer::Init( int pi, edict_t* pe )
|
||||
{
|
||||
pEdict = pe;
|
||||
index = pi;
|
||||
current = 0;
|
||||
clearStats = 0.0f;
|
||||
rank = 0;
|
||||
}
|
||||
|
||||
void CPlayer::saveKill(CPlayer* pVictim, int wweapon, int hhs, int ttk){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( pVictim->index == index ){ // killed self
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
return;
|
||||
}
|
||||
|
||||
pVictim->attackers[index].name = weaponData[wweapon].name;
|
||||
pVictim->attackers[index].kills++;
|
||||
pVictim->attackers[index].hs += hhs;
|
||||
pVictim->attackers[index].tks += ttk;
|
||||
pVictim->attackers[0].kills++;
|
||||
pVictim->attackers[0].hs += hhs;
|
||||
pVictim->attackers[0].tks += ttk;
|
||||
pVictim->weapons[pVictim->current].deaths++;
|
||||
pVictim->weapons[0].deaths++;
|
||||
pVictim->life.deaths++;
|
||||
|
||||
|
||||
pVictim->weaponsRnd[pVictim->current].deaths++; // DEC-Weapon (round) stats
|
||||
pVictim->weaponsRnd[0].deaths++; // DEC-Weapon (round) stats
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].name = weaponData[wweapon].name;
|
||||
victims[vi].deaths++;
|
||||
victims[vi].hs += hhs;
|
||||
victims[vi].tks += ttk;
|
||||
victims[0].deaths++;
|
||||
victims[0].hs += hhs;
|
||||
victims[0].tks += ttk;
|
||||
|
||||
weaponsRnd[wweapon].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].tks += ttk; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].kills++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hs += hhs; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].tks += ttk; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].kills++;
|
||||
weapons[wweapon].hs += hhs;
|
||||
weapons[wweapon].tks += ttk;
|
||||
weapons[0].kills++;
|
||||
weapons[0].hs += hhs;
|
||||
weapons[0].tks += ttk;
|
||||
life.kills++;
|
||||
life.hs += hhs;
|
||||
life.tks += ttk;
|
||||
}
|
||||
|
||||
void CPlayer::saveHit(CPlayer* pVictim, int wweapon, int ddamage, int bbody){
|
||||
|
||||
if ( ignoreBots(pEdict,pVictim->pEdict) )
|
||||
return;
|
||||
|
||||
if ( index == pVictim->index ) return;
|
||||
|
||||
pVictim->attackers[index].hits++;
|
||||
pVictim->attackers[index].damage += ddamage;
|
||||
pVictim->attackers[index].bodyHits[bbody]++;
|
||||
pVictim->attackers[0].hits++;
|
||||
pVictim->attackers[0].damage += ddamage;
|
||||
pVictim->attackers[0].bodyHits[bbody]++;
|
||||
|
||||
|
||||
int vi = pVictim->index;
|
||||
victims[vi].hits++;
|
||||
victims[vi].damage += ddamage;
|
||||
victims[vi].bodyHits[bbody]++;
|
||||
victims[0].hits++;
|
||||
victims[0].damage += ddamage;
|
||||
victims[0].bodyHits[bbody]++;
|
||||
|
||||
weaponsRnd[wweapon].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[wweapon].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].hits++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].damage += ddamage; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].bodyHits[bbody]++; // DEC-Weapon (round) stats
|
||||
|
||||
weapons[wweapon].hits++;
|
||||
weapons[wweapon].damage += ddamage;
|
||||
weapons[wweapon].bodyHits[bbody]++;
|
||||
weapons[0].hits++;
|
||||
weapons[0].damage += ddamage;
|
||||
weapons[0].bodyHits[bbody]++;
|
||||
|
||||
life.hits++;
|
||||
life.damage += ddamage;
|
||||
life.bodyHits[bbody]++;
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveShot(int weapon){
|
||||
|
||||
if ( ignoreBots(pEdict) )
|
||||
return;
|
||||
|
||||
victims[0].shots++;
|
||||
weapons[weapon].shots++;
|
||||
weapons[0].shots++;
|
||||
life.shots++;
|
||||
weaponsRnd[weapon].shots++; // DEC-Weapon (round) stats
|
||||
weaponsRnd[0].shots++; // DEC-Weapon (round) stats
|
||||
}
|
||||
|
||||
|
||||
void CPlayer::saveBPlant(){
|
||||
life.bPlants++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBExplode(){
|
||||
life.bExplosions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefusing(){
|
||||
life.bDefusions++;
|
||||
}
|
||||
|
||||
void CPlayer::saveBDefused(){
|
||||
life.bDefused++;
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class Forward
|
||||
// *****************************************************
|
||||
|
||||
void Forward::put( AMX *a , int i ){
|
||||
head = new AmxCall( a, i , head );
|
||||
}
|
||||
|
||||
|
||||
void Forward::clear(){
|
||||
while ( head ) {
|
||||
AmxCall* a = head->next;
|
||||
delete head;
|
||||
head = a;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2,int p3,int p4,int p5,int p6){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 6,p1, p2, p3, p4, p5, p6);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2,int p3,int p4,int p5){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 5,p1, p2, p3, p4, p5);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
void Forward::exec(int p1,int p2){
|
||||
AmxCall* a = head;
|
||||
while ( a ){
|
||||
MF_AmxExec(a->amx, NULL, a->iFunctionIdx, 2,p1, p2);
|
||||
a = a->next;
|
||||
}
|
||||
}
|
||||
|
||||
// *****************************************************
|
||||
|
||||
bool ignoreBots (edict_t *pEnt, edict_t *pOther){
|
||||
if ( !rankBots && ( pEnt->v.flags & FL_FAKECLIENT || ( pOther && pOther->v.flags & FL_FAKECLIENT ) ) )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isModuleActive(){
|
||||
if ( !(int)CVAR_GET_FLOAT("csstats_pause") )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
116
dlls/csx_sql/CMisc.h
Executable file
116
dlls/csx_sql/CMisc.h
Executable file
@ -0,0 +1,116 @@
|
||||
|
||||
|
||||
#ifndef CMISC_H
|
||||
#define CMISC_H
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
|
||||
#define MAX_CWEAPONS 6
|
||||
|
||||
#define CSW_HEGRENADE 4
|
||||
#define CSW_C4 6
|
||||
#define CSW_SMOKEGRENADE 9
|
||||
#define CSW_FLASHBANG 25
|
||||
|
||||
// *****************************************************
|
||||
// class CPlayer
|
||||
// *****************************************************
|
||||
|
||||
struct CPlayer {
|
||||
edict_t* pEdict;
|
||||
char ip[32];
|
||||
int index;
|
||||
int aiming;
|
||||
int current;
|
||||
bool bot;
|
||||
float clearStats;
|
||||
RankSystem::RankStats* rank;
|
||||
|
||||
struct PlayerWeapon : Stats {
|
||||
const char* name;
|
||||
int ammo;
|
||||
int clip;
|
||||
};
|
||||
|
||||
PlayerWeapon weapons[MAX_WEAPONS+MAX_CWEAPONS];
|
||||
PlayerWeapon attackers[33];
|
||||
PlayerWeapon victims[33];
|
||||
Stats weaponsRnd[MAX_WEAPONS+MAX_CWEAPONS]; // DEC-Weapon (Round) stats
|
||||
Stats life;
|
||||
|
||||
int teamId;
|
||||
|
||||
void Init( int pi, edict_t* pe );
|
||||
void Connect(const char* ip );
|
||||
void PutInServer();
|
||||
void Disconnect();
|
||||
void saveKill(CPlayer* pVictim, int weapon, int hs, int tk);
|
||||
void saveHit(CPlayer* pVictim, int weapon, int damage, int aiming);
|
||||
void saveShot(int weapon);
|
||||
|
||||
void saveBPlant();
|
||||
void saveBExplode();
|
||||
void saveBDefusing();
|
||||
void saveBDefused();
|
||||
|
||||
void restartStats(bool all = true);
|
||||
inline bool IsBot(){
|
||||
const char* auth= (*g_engfuncs.pfnGetPlayerAuthId)(pEdict);
|
||||
return ( auth && !strcmp( auth , "BOT" ) );
|
||||
}
|
||||
inline bool IsAlive(){
|
||||
return ((pEdict->v.deadflag==DEAD_NO)&&(pEdict->v.health>0));
|
||||
}
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class Grenades
|
||||
// *****************************************************
|
||||
|
||||
class Grenades
|
||||
{
|
||||
struct Obj
|
||||
{
|
||||
CPlayer* player;
|
||||
edict_t* grenade;
|
||||
float time;
|
||||
int type;
|
||||
Obj* next;
|
||||
Obj* prev;
|
||||
} *head;
|
||||
|
||||
public:
|
||||
Grenades() { head = 0; }
|
||||
~Grenades() { clear(); }
|
||||
void put( edict_t* grenade, float time, int type, CPlayer* player );
|
||||
bool find( edict_t* enemy, CPlayer** p, int* type );
|
||||
void clear();
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class Forward
|
||||
// *****************************************************
|
||||
|
||||
class Forward
|
||||
{
|
||||
struct AmxCall {
|
||||
AMX *amx;
|
||||
int iFunctionIdx;
|
||||
AmxCall* next;
|
||||
AmxCall( AMX *a , int i, AmxCall* n ): amx(a), iFunctionIdx(i), next(n) {}
|
||||
} *head;
|
||||
public:
|
||||
Forward() { head = 0; }
|
||||
~Forward() { clear(); }
|
||||
void clear();
|
||||
void put( AMX *a , int i );
|
||||
void exec(int p1,int p2,int p3,int p4,int p5,int p6);
|
||||
void exec(int p1,int p2,int p3,int p4,int p5);
|
||||
void exec(int p1,int p2);
|
||||
};
|
||||
|
||||
#endif // CMISC_H
|
||||
|
||||
|
||||
|
306
dlls/csx_sql/CRank.cpp
Executable file
306
dlls/csx_sql/CRank.cpp
Executable file
@ -0,0 +1,306 @@
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include "rank.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
Stats::Stats(){
|
||||
hits = shots = damage = hs = tks = kills = deaths = bDefusions = bDefused = bPlants = bExplosions = 0;
|
||||
memset( bodyHits , 0 ,sizeof( bodyHits ) );
|
||||
}
|
||||
void Stats::commit(Stats* a){
|
||||
hits += a->hits;
|
||||
shots += a->shots;
|
||||
damage += a->damage;
|
||||
hs += a->hs;
|
||||
tks += a->tks;
|
||||
kills += a->kills;
|
||||
deaths += a->deaths;
|
||||
|
||||
bDefusions += a->bDefusions;
|
||||
bDefused += a->bDefused;
|
||||
bPlants += a->bPlants;
|
||||
bExplosions += a->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
bodyHits[i] += a->bodyHits[i];
|
||||
}
|
||||
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
RankSystem::RankStats::RankStats( const char* uu, const char* nn, RankSystem* pp ) {
|
||||
name = 0;
|
||||
namelen = 0;
|
||||
unique = 0;
|
||||
uniquelen = 0;
|
||||
score = 0;
|
||||
parent = pp;
|
||||
id = ++parent->rankNum;
|
||||
next = prev = 0;
|
||||
setName( nn );
|
||||
setUnique( uu );
|
||||
}
|
||||
|
||||
RankSystem::RankStats::~RankStats() {
|
||||
delete[] name;
|
||||
delete[] unique;
|
||||
--parent->rankNum;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setName( const char* nn ) {
|
||||
delete[] name;
|
||||
namelen = strlen(nn) + 1;
|
||||
name = new char[namelen];
|
||||
if ( name )
|
||||
strcpy( name , nn );
|
||||
else
|
||||
namelen = 0;
|
||||
}
|
||||
|
||||
void RankSystem::RankStats::setUnique( const char* nn ) {
|
||||
delete[] unique;
|
||||
uniquelen = strlen(nn) + 1;
|
||||
unique = new char[uniquelen];
|
||||
if ( unique )
|
||||
strcpy( unique , nn );
|
||||
else
|
||||
uniquelen = 0;
|
||||
}
|
||||
|
||||
RankSystem::RankSystem() {
|
||||
head = 0;
|
||||
tail = 0;
|
||||
rankNum = 0;
|
||||
calc.code = 0;
|
||||
}
|
||||
|
||||
RankSystem::~RankSystem() {
|
||||
clear();
|
||||
}
|
||||
|
||||
void RankSystem::put_before( RankStats* a, RankStats* ptr ){
|
||||
a->next = ptr;
|
||||
if ( ptr ){
|
||||
a->prev = ptr->prev;
|
||||
ptr->prev = a;
|
||||
}
|
||||
else{
|
||||
a->prev = head;
|
||||
head = a;
|
||||
}
|
||||
if ( a->prev ) a->prev->next = a;
|
||||
else tail = a;
|
||||
}
|
||||
|
||||
void RankSystem::put_after( RankStats* a, RankStats* ptr ) {
|
||||
a->prev = ptr;
|
||||
if ( ptr ){
|
||||
a->next = ptr->next;
|
||||
ptr->next = a;
|
||||
}
|
||||
else{
|
||||
a->next = tail;
|
||||
tail = a;
|
||||
}
|
||||
if ( a->next ) a->next->prev = a;
|
||||
else head = a;
|
||||
}
|
||||
|
||||
void RankSystem::unlink( RankStats* ptr ){
|
||||
if (ptr->prev) ptr->prev->next = ptr->next;
|
||||
else tail = ptr->next;
|
||||
if (ptr->next) ptr->next->prev = ptr->prev;
|
||||
else head = ptr->prev;
|
||||
}
|
||||
|
||||
void RankSystem::clear(){
|
||||
while( tail ){
|
||||
head = tail->next;
|
||||
delete tail;
|
||||
tail = head;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool RankSystem::loadCalc(const char* filename, char* error)
|
||||
{
|
||||
if ((MF_LoadAmxScript(&calc.amx,&calc.code,filename,error,0)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr1, &calc.physAddr1)!=AMX_ERR_NONE)||
|
||||
(MF_AmxAllot(&calc.amx, 8 , &calc.amxAddr2, &calc.physAddr2)!=AMX_ERR_NONE)||
|
||||
(MF_AmxFindPublic(&calc.amx,"get_score",&calc.func)!=AMX_ERR_NONE)){
|
||||
LOG_CONSOLE( PLID, "Couldn't load plugin (file \"%s\")",filename);
|
||||
MF_UnloadAmxScript(&calc.amx, &calc.code);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void RankSystem::unloadCalc()
|
||||
{
|
||||
MF_UnloadAmxScript(&calc.amx , &calc.code);
|
||||
}
|
||||
|
||||
RankSystem::RankStats* RankSystem::findEntryInRank(const char* unique, const char* name )
|
||||
{
|
||||
RankStats* a = head;
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( strcmp( a->getUnique() ,unique ) == 0 )
|
||||
return a;
|
||||
|
||||
a = a->prev;
|
||||
}
|
||||
a = new RankStats( unique ,name,this );
|
||||
if ( a == 0 ) return 0;
|
||||
put_after( a , 0 );
|
||||
return a;
|
||||
}
|
||||
|
||||
void RankSystem::updatePos( RankStats* rr , Stats* s )
|
||||
{
|
||||
rr->addStats( s );
|
||||
if ( calc.code ) {
|
||||
calc.physAddr1[0] = rr->kills;
|
||||
calc.physAddr1[1] = rr->deaths;
|
||||
calc.physAddr1[2] = rr->hs;
|
||||
calc.physAddr1[3] = rr->tks;
|
||||
calc.physAddr1[4] = rr->shots;
|
||||
calc.physAddr1[5] = rr->hits;
|
||||
calc.physAddr1[6] = rr->damage;
|
||||
|
||||
calc.physAddr1[7] = rr->bDefusions;
|
||||
calc.physAddr1[8] = rr->bDefused;
|
||||
calc.physAddr1[9] = rr->bPlants;
|
||||
calc.physAddr1[10] = rr->bExplosions;
|
||||
|
||||
for(int i = 1; i < 8; ++i)
|
||||
calc.physAddr2[i] = rr->bodyHits[i];
|
||||
cell result = 0;
|
||||
int err;
|
||||
if ((err = MF_AmxExec(&calc.amx,&result, calc.func ,2,calc.amxAddr1,calc.amxAddr2 )) != AMX_ERR_NONE)
|
||||
LOG_CONSOLE( PLID, "Run time error %d on line %ld (plugin \"%s\")", err,calc.amx.curline,LOCALINFO("csstats_score"));
|
||||
rr->score = result;
|
||||
}
|
||||
else rr->score = rr->kills - rr->deaths;
|
||||
|
||||
|
||||
RankStats* aa = rr->next;
|
||||
while ( aa && (aa->score <= rr->score) ) { // try to nominate
|
||||
rr->goUp();
|
||||
aa->goDown();
|
||||
aa = aa->next; // go to next rank
|
||||
}
|
||||
if ( aa != rr->next )
|
||||
{
|
||||
unlink( rr );
|
||||
put_before( rr, aa );
|
||||
}
|
||||
else
|
||||
{
|
||||
aa = rr->prev;
|
||||
while ( aa && (aa->score > rr->score) ) { // go down
|
||||
rr->goDown();
|
||||
aa->goUp();
|
||||
aa = aa->prev; // go to prev rank
|
||||
}
|
||||
if ( aa != rr->prev ){
|
||||
unlink( rr );
|
||||
put_after( rr, aa );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RankSystem::loadRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen( filename , "rb" );
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = 0;
|
||||
fread(&i, 1 , sizeof(short int) , bfp);
|
||||
|
||||
if (i == RANK_VERSION)
|
||||
{
|
||||
Stats d;
|
||||
char unique[64], name[64];
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
while( i )
|
||||
{
|
||||
fread(name , i,sizeof(char) , bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
fread(unique , i,sizeof(char) , bfp);
|
||||
fread(&d.tks, 1,sizeof(int), bfp);
|
||||
fread(&d.damage, 1,sizeof(int), bfp);
|
||||
fread(&d.deaths, 1,sizeof(int), bfp);
|
||||
fread(&d.kills, 1,sizeof(int), bfp);
|
||||
fread(&d.shots, 1,sizeof(int), bfp);
|
||||
fread(&d.hits, 1,sizeof(int), bfp);
|
||||
fread(&d.hs, 1,sizeof(int), bfp);
|
||||
|
||||
fread(&d.bDefusions, 1,sizeof(int), bfp);
|
||||
fread(&d.bDefused, 1,sizeof(int), bfp);
|
||||
fread(&d.bPlants, 1,sizeof(int), bfp);
|
||||
fread(&d.bExplosions, 1,sizeof(int), bfp);
|
||||
|
||||
fread(d.bodyHits, 1,sizeof(d.bodyHits), bfp);
|
||||
fread(&i , 1, sizeof(short int), bfp);
|
||||
|
||||
RankSystem::RankStats* a = findEntryInRank( unique , name );
|
||||
|
||||
if ( a ) a->updatePosition( &d );
|
||||
}
|
||||
}
|
||||
fclose(bfp);
|
||||
}
|
||||
|
||||
void RankSystem::saveRank( const char* filename )
|
||||
{
|
||||
FILE *bfp = fopen(filename, "wb");
|
||||
|
||||
if ( !bfp ) return;
|
||||
|
||||
short int i = RANK_VERSION;
|
||||
|
||||
fwrite(&i, 1, sizeof(short int) , bfp);
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
fwrite( &(*a).namelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).name , (*a).namelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).uniquelen , 1, sizeof(short int), bfp);
|
||||
fwrite( (*a).unique , (*a).uniquelen , sizeof(char) , bfp);
|
||||
fwrite( &(*a).tks, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).damage, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).deaths, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).kills, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).shots, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hits, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).hs, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( &(*a).bDefusions, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bDefused, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bPlants, 1, sizeof(int), bfp);
|
||||
fwrite( &(*a).bExplosions, 1, sizeof(int), bfp);
|
||||
|
||||
fwrite( (*a).bodyHits, 1, sizeof((*a).bodyHits), bfp);
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
fwrite( &i , 1, sizeof(short int), bfp); // null terminator
|
||||
|
||||
fclose(bfp);
|
||||
}
|
123
dlls/csx_sql/CRank.h
Executable file
123
dlls/csx_sql/CRank.h
Executable file
@ -0,0 +1,123 @@
|
||||
|
||||
|
||||
#ifndef CRANK_H
|
||||
#define CRANK_H
|
||||
|
||||
#define RANK_VERSION 11
|
||||
|
||||
#include "amxxmodule.h"
|
||||
|
||||
// *****************************************************
|
||||
// class Stats
|
||||
// *****************************************************
|
||||
|
||||
struct Stats {
|
||||
int hits;
|
||||
int shots;
|
||||
int damage;
|
||||
int hs;
|
||||
int tks;
|
||||
int kills;
|
||||
int deaths;
|
||||
int bodyHits[9]; ////////////////////
|
||||
|
||||
// SiDLuke start
|
||||
int bPlants;
|
||||
int bExplosions;
|
||||
int bDefusions;
|
||||
int bDefused;
|
||||
// SiDLuke end :D
|
||||
|
||||
Stats();
|
||||
void commit(Stats* a);
|
||||
};
|
||||
|
||||
// *****************************************************
|
||||
// class RankSystem
|
||||
// *****************************************************
|
||||
|
||||
class RankSystem
|
||||
{
|
||||
public:
|
||||
class RankStats;
|
||||
friend class RankStats;
|
||||
class iterator;
|
||||
|
||||
class RankStats : public Stats {
|
||||
friend class RankSystem;
|
||||
friend class iterator;
|
||||
RankSystem* parent;
|
||||
RankStats* next;
|
||||
RankStats* prev;
|
||||
char* unique;
|
||||
short int uniquelen;
|
||||
char* name;
|
||||
short int namelen;
|
||||
int score;
|
||||
int id;
|
||||
RankStats( const char* uu, const char* nn, RankSystem* pp );
|
||||
~RankStats();
|
||||
void setUnique( const char* nn );
|
||||
inline void goDown() {++id;}
|
||||
inline void goUp() {--id;}
|
||||
inline void addStats(Stats* a) { commit( a ); }
|
||||
public:
|
||||
void setName( const char* nn );
|
||||
inline const char* getName() const { return name ? name : ""; }
|
||||
inline const char* getUnique() const { return unique ? unique : ""; }
|
||||
inline int getPosition() const { return id; }
|
||||
inline void updatePosition( Stats* points ) {
|
||||
parent->updatePos( this , points );
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
RankStats* head;
|
||||
RankStats* tail;
|
||||
int rankNum;
|
||||
|
||||
struct scoreCalc{
|
||||
AMX amx;
|
||||
void* code;
|
||||
int func;
|
||||
cell amxAddr1;
|
||||
cell amxAddr2;
|
||||
cell *physAddr1;
|
||||
cell *physAddr2;
|
||||
} calc;
|
||||
|
||||
void put_before( RankStats* a, RankStats* ptr );
|
||||
void put_after( RankStats* a, RankStats* ptr );
|
||||
void unlink( RankStats* ptr );
|
||||
void updatePos( RankStats* r , Stats* s );
|
||||
|
||||
public:
|
||||
|
||||
RankSystem();
|
||||
~RankSystem();
|
||||
|
||||
void saveRank( const char* filename );
|
||||
void saveRankSql(); // JGHG added this one
|
||||
void loadRank( const char* filename );
|
||||
RankStats* findEntryInRank(const char* unique, const char* name );
|
||||
bool loadCalc(const char* filename, char* error);
|
||||
inline int getRankNum( ) const { return rankNum; }
|
||||
void clear();
|
||||
void unloadCalc();
|
||||
|
||||
class iterator {
|
||||
RankStats* ptr;
|
||||
public:
|
||||
iterator(RankStats* a): ptr(a){}
|
||||
inline iterator& operator--() { ptr = ptr->prev; return *this;}
|
||||
inline iterator& operator++() { ptr = ptr->next; return *this; }
|
||||
inline RankStats& operator*() { return *ptr;}
|
||||
operator bool () { return (ptr != 0); }
|
||||
};
|
||||
|
||||
inline iterator front() { return iterator(head); }
|
||||
inline iterator begin() { return iterator(tail); }
|
||||
};
|
||||
|
||||
|
||||
#endif
|
234
dlls/csx_sql/CRank_sql.cpp
Executable file
234
dlls/csx_sql/CRank_sql.cpp
Executable file
@ -0,0 +1,234 @@
|
||||
// The good stuff: http://dev.mysql.com/doc/mysql/en/mysql_query.html
|
||||
|
||||
#include "amxxmodule.h"
|
||||
#include "CRank.h"
|
||||
#include "rank.h"
|
||||
|
||||
#ifndef __linux__
|
||||
#define WINDOWS_LEAN_AND_MEAN
|
||||
#include <winsock.h>
|
||||
#endif
|
||||
#include <mysql/mysql.h>
|
||||
#include <mysql/errmsg.h>
|
||||
|
||||
#include <time.h>
|
||||
#define MYSQL_QUERY_IS_A_OKAY 0
|
||||
|
||||
cvar_t init_csx_sqlstats_host = {"csx_sqlstats_host", "127.0.0.1", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t init_csx_sqlstats_username = {"csx_sqlstats_username", "", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t init_csx_sqlstats_password = {"csx_sqlstats_password", "", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t init_csx_sqlstats_db = {"csx_sqlstats_db", "amxmodx_stats_cs", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t init_csx_sqlstats_table = {"csx_sqlstats_table", "cs", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t init_csx_sqlstats_exportstats = {"csx_sqlstats_exportstats", "0", FCVAR_SPONLY | FCVAR_PROTECTED};
|
||||
cvar_t *csx_sqlstats_host;
|
||||
cvar_t *csx_sqlstats_username;
|
||||
cvar_t *csx_sqlstats_password;
|
||||
cvar_t *csx_sqlstats_db;
|
||||
cvar_t *csx_sqlstats_table;
|
||||
cvar_t *csx_sqlstats_exportstats;
|
||||
|
||||
void OnMetaAttach_sql() {
|
||||
CVAR_REGISTER(&init_csx_sqlstats_host);
|
||||
CVAR_REGISTER(&init_csx_sqlstats_username);
|
||||
CVAR_REGISTER(&init_csx_sqlstats_password);
|
||||
CVAR_REGISTER(&init_csx_sqlstats_db);
|
||||
CVAR_REGISTER(&init_csx_sqlstats_table);
|
||||
CVAR_REGISTER(&init_csx_sqlstats_exportstats);
|
||||
|
||||
csx_sqlstats_host = CVAR_GET_POINTER(init_csx_sqlstats_host.name);
|
||||
csx_sqlstats_username = CVAR_GET_POINTER(init_csx_sqlstats_username.name);
|
||||
csx_sqlstats_password = CVAR_GET_POINTER(init_csx_sqlstats_password.name);
|
||||
csx_sqlstats_db = CVAR_GET_POINTER(init_csx_sqlstats_db.name);
|
||||
csx_sqlstats_table = CVAR_GET_POINTER(init_csx_sqlstats_table.name);
|
||||
csx_sqlstats_exportstats = CVAR_GET_POINTER(init_csx_sqlstats_exportstats.name);
|
||||
}
|
||||
|
||||
int Error(MYSQL *mysql)
|
||||
{
|
||||
if (mysql == NULL)
|
||||
return 0;
|
||||
|
||||
return mysql_errno(mysql);
|
||||
}
|
||||
|
||||
void RankSystem::saveRankSql()
|
||||
{
|
||||
// Don't do anything if cvar says so.
|
||||
if (csx_sqlstats_exportstats->value == 0.0)
|
||||
return;
|
||||
|
||||
MF_PrintSrvConsole("[CSX Sql] Exporting players' statistics to SQL db...");
|
||||
clock_t startTime = clock();
|
||||
|
||||
MYSQL *mysql = NULL;
|
||||
mysql = mysql_init(NULL);
|
||||
|
||||
|
||||
/* Attempt to get a port */
|
||||
int port = 0;
|
||||
char *p = strchr(csx_sqlstats_host->string, ':');
|
||||
if (p)
|
||||
port = atoi(p+1);
|
||||
/*************************/
|
||||
//MF_PrintSrvConsole("Host: %s (%d) Port: %d", host, strcspn(csx_sqlstats_host->string, ":"), port);
|
||||
|
||||
int error = 0;
|
||||
if (!mysql_real_connect(mysql, csx_sqlstats_host->string, csx_sqlstats_username->string, csx_sqlstats_password->string, NULL, port, NULL, 0)) {
|
||||
error = Error(mysql);
|
||||
if (error) {
|
||||
MF_Log("DB Connection failed (%d): %s", error, mysql_error(mysql));
|
||||
mysql_close(mysql);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mysql_select_db(mysql, csx_sqlstats_db->string) != 0) {
|
||||
error = Error(mysql);
|
||||
if (error) {
|
||||
MF_Log("DB Select DB failed (%d): %s", error, mysql_error(mysql));
|
||||
mysql_close(mysql);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Query
|
||||
char query[2048];
|
||||
|
||||
snprintf(query, 2047, "CREATE TABLE IF NOT EXISTS `%s` (`timestamp` int(11) NOT NULL default '0', `stats_authid` varchar(100) NOT NULL default '', `stats_name` varchar(100) NOT NULL default '', `stats_tks` int(11) NOT NULL default '0', `stats_damage` int(11) NOT NULL default '0', `stats_deaths` int(11) NOT NULL default '0', `stats_frags` int(11) NOT NULL default '0', `stats_shots` int(11) NOT NULL default '0', `stats_hits` int(11) NOT NULL default '0', `stats_hs` int(11) NOT NULL default '0', `stats_defusions` int(11) NOT NULL default '0', `stats_defused` int(11) NOT NULL default '0', `stats_plants` int(11) NOT NULL default '0', `stats_explosions` int(11) NOT NULL default '0', `stats_bodyhits0` int(11) NOT NULL default '0', `stats_bodyhits1` int(11) NOT NULL default '0', `stats_bodyhits2` int(11) NOT NULL default '0', `stats_bodyhits3` int(11) NOT NULL default '0', `stats_bodyhits4` int(11) NOT NULL default '0', `stats_bodyhits5` int(11) NOT NULL default '0', `stats_bodyhits6` int(11) NOT NULL default '0', `stats_bodyhits7` int(11) NOT NULL default '0', `stats_bodyhits8` int(11) NOT NULL default '0', `stats_score` int(11) NOT NULL default '0') TYPE=MyISAM",
|
||||
csx_sqlstats_table->string);
|
||||
int queryResult = mysql_query(mysql, query);
|
||||
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||
{
|
||||
error = Error(mysql);
|
||||
MF_Log("DB Query Create Table If Not Exists failed (%d): %s", error, mysql_error(mysql));
|
||||
mysql_close(mysql);
|
||||
return;
|
||||
}
|
||||
|
||||
int exportedRecords = 0;
|
||||
|
||||
RankSystem::iterator a = front();
|
||||
|
||||
char *authid, *name;
|
||||
int tks, damage, deaths, kills, shots, hits, hs, defusions, defused, plants, explosions, *bodyHits, score;
|
||||
time_t now = time(NULL);
|
||||
|
||||
while ( a )
|
||||
{
|
||||
if ( (*a).score != (1<<31) ) // score must be different than mincell
|
||||
{
|
||||
authid = (*a).unique;
|
||||
if (strcmp(authid, "BOT") == 0 || strcmp(authid, "STEAM_ID_PENDING") == 0) {
|
||||
--a;
|
||||
continue;
|
||||
}
|
||||
exportedRecords++;
|
||||
|
||||
name = (*a).name;
|
||||
tks = (*a).tks;
|
||||
damage = (*a).damage;
|
||||
deaths = (*a).deaths;
|
||||
kills = (*a).kills;
|
||||
shots = (*a).shots;
|
||||
hits = (*a).hits;
|
||||
hs = (*a).hs;
|
||||
defusions = (*a).bDefusions;
|
||||
defused = (*a).bDefused;
|
||||
plants = (*a).bPlants;
|
||||
explosions = (*a).bExplosions;
|
||||
bodyHits = ((*a).bodyHits);
|
||||
score = (*a).score;
|
||||
|
||||
snprintf(query, 2047, "UPDATE `%s` SET `timestamp` = %d, `stats_name` = \"%s\", `stats_tks` = \"%d\", `stats_damage` = \"%d\", `stats_deaths` = \"%d\", `stats_frags` = \"%d\", `stats_shots` = \"%d\", `stats_hits` = \"%d\", `stats_hs` = \"%d\", `stats_defusions` = \"%d\", `stats_defused` = \"%d\", `stats_plants` = \"%d\", `stats_explosions` = \"%d\", `stats_bodyhits0` = \"%d\", `stats_bodyhits1` = \"%d\", `stats_bodyhits2` = \"%d\", `stats_bodyhits3` = \"%d\", `stats_bodyhits4` = \"%d\", `stats_bodyhits5` = \"%d\", `stats_bodyhits6` = \"%d\", `stats_bodyhits7` = \"%d\", `stats_bodyhits8` = \"%d\", `stats_score` = \"%d\" WHERE `stats_authid` = \"%s\" LIMIT 1",
|
||||
csx_sqlstats_table->string,
|
||||
now,
|
||||
name,
|
||||
tks,
|
||||
damage,
|
||||
deaths,
|
||||
kills,
|
||||
shots,
|
||||
hits,
|
||||
hs,
|
||||
defusions,
|
||||
defused,
|
||||
plants,
|
||||
explosions,
|
||||
bodyHits[0],
|
||||
bodyHits[1],
|
||||
bodyHits[2],
|
||||
bodyHits[3],
|
||||
bodyHits[4],
|
||||
bodyHits[5],
|
||||
bodyHits[6],
|
||||
bodyHits[7],
|
||||
bodyHits[8],
|
||||
score,
|
||||
authid);
|
||||
//
|
||||
|
||||
int queryResult = mysql_query(mysql, query);
|
||||
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||
{
|
||||
error = Error(mysql);
|
||||
MF_Log("DB Query Update failed (%d): %s", error, mysql_error(mysql));
|
||||
mysql_close(mysql);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mysql_affected_rows(mysql) == 0) {
|
||||
// New player, do insert
|
||||
snprintf(query, 2047, "INSERT INTO `%s` (`timestamp`, `stats_authid`, `stats_name`, `stats_tks`, `stats_damage`, `stats_deaths`, `stats_frags`, `stats_shots`, `stats_hits`, `stats_hs`, `stats_defusions`, `stats_defused`, `stats_plants`, `stats_explosions`, `stats_bodyhits0`, `stats_bodyhits1`, `stats_bodyhits2`, `stats_bodyhits3`, `stats_bodyhits4`, `stats_bodyhits5`, `stats_bodyhits6`, `stats_bodyhits7`, `stats_bodyhits8`, `stats_score`) VALUES (\"%d\", \"%s\", \"%s\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\", \"%d\")",
|
||||
csx_sqlstats_table->string,
|
||||
now,
|
||||
|
||||
authid,
|
||||
name,
|
||||
|
||||
tks,
|
||||
damage,
|
||||
deaths,
|
||||
kills,
|
||||
shots,
|
||||
|
||||
hits,
|
||||
hs,
|
||||
defusions,
|
||||
defused,
|
||||
plants,
|
||||
|
||||
explosions,
|
||||
|
||||
bodyHits[0],
|
||||
bodyHits[1],
|
||||
bodyHits[2],
|
||||
bodyHits[3],
|
||||
bodyHits[4],
|
||||
bodyHits[5],
|
||||
bodyHits[6],
|
||||
bodyHits[7],
|
||||
bodyHits[8],
|
||||
|
||||
score
|
||||
);
|
||||
|
||||
int queryResult = mysql_query(mysql, query);
|
||||
if (queryResult != MYSQL_QUERY_IS_A_OKAY)
|
||||
{
|
||||
error = Error(mysql);
|
||||
MF_Log("DB Query Insert failed (%d): %s", error, mysql_error(mysql));
|
||||
mysql_close(mysql);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
--a;
|
||||
}
|
||||
|
||||
// Disconnect
|
||||
mysql_close(mysql);
|
||||
|
||||
clock_t stopTime = clock();
|
||||
MF_PrintSrvConsole("...done! (exported %d records in %.2f seconds)\n", exportedRecords, (double)(stopTime - startTime) / (double)CLOCKS_PER_SEC);
|
||||
}
|
404
dlls/csx_sql/CString.h
Executable file
404
dlls/csx_sql/CString.h
Executable file
@ -0,0 +1,404 @@
|
||||
/* AMX Mod X
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE_CSTRING_H
|
||||
#define _INCLUDE_CSTRING_H
|
||||
|
||||
//by David "BAILOPAN" Anderson
|
||||
class String
|
||||
{
|
||||
public:
|
||||
String()
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0;
|
||||
Grow(2);
|
||||
assign("");
|
||||
}
|
||||
|
||||
~String()
|
||||
{
|
||||
if (v)
|
||||
delete [] v;
|
||||
}
|
||||
|
||||
String(const char *src)
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0; assign(src);
|
||||
}
|
||||
|
||||
String(String &src)
|
||||
{
|
||||
v = NULL;
|
||||
mSize = 0;
|
||||
cSize = 0;
|
||||
assign(src.c_str());
|
||||
}
|
||||
|
||||
const char *c_str() { return v?v:""; }
|
||||
const char *c_str() const { return v?v:""; }
|
||||
|
||||
void append(const char *t)
|
||||
{
|
||||
Grow(cSize + strlen(t) + 1);
|
||||
strcat(v, t);
|
||||
cSize = strlen(v);
|
||||
}
|
||||
|
||||
void append(const char c)
|
||||
{
|
||||
Grow(cSize + 2);
|
||||
v[cSize] = c;
|
||||
v[++cSize] = 0;
|
||||
}
|
||||
|
||||
void append(String &d)
|
||||
{
|
||||
const char *t = d.c_str();
|
||||
Grow(cSize + strlen(t));
|
||||
strcat(v, t);
|
||||
cSize = strlen(v);
|
||||
}
|
||||
|
||||
void assign(const String &src)
|
||||
{
|
||||
assign(src.c_str());
|
||||
}
|
||||
|
||||
void assign(const char *d)
|
||||
{
|
||||
if (!d)
|
||||
{
|
||||
Grow(1);
|
||||
cSize = 0;
|
||||
strcpy(v, "");
|
||||
return;
|
||||
}
|
||||
Grow(strlen(d));
|
||||
if (v)
|
||||
{
|
||||
strcpy(v, d);
|
||||
cSize = strlen(v);
|
||||
} else {
|
||||
cSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
if (v)
|
||||
{
|
||||
v[0] = 0;
|
||||
cSize = 0;
|
||||
}
|
||||
}
|
||||
|
||||
int compare (const char *d)
|
||||
{
|
||||
if (v) {
|
||||
if (d) {
|
||||
return strcmp(v, d);
|
||||
} else {
|
||||
return strlen(v);
|
||||
}
|
||||
} else {
|
||||
if (d) {
|
||||
return strlen(d);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Added this for amxx inclusion
|
||||
bool empty()
|
||||
{
|
||||
if (!v || !cSize)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int size()
|
||||
{
|
||||
if (!v)
|
||||
return 0;
|
||||
return cSize;
|
||||
}
|
||||
|
||||
const char * _fread(FILE *fp)
|
||||
{
|
||||
Grow(512);
|
||||
char * ret = fgets(v, 511, fp);
|
||||
cSize = strlen(v);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int find(const char c, int index = 0)
|
||||
{
|
||||
if (!v)
|
||||
return npos;
|
||||
if (index >= (int)cSize || index < 0)
|
||||
return npos;
|
||||
unsigned int i = 0;
|
||||
for (i=index; i<cSize; i++)
|
||||
{
|
||||
if (v[i] == c)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return npos;
|
||||
}
|
||||
|
||||
bool is_space(int c)
|
||||
{
|
||||
if (c == '\f' || c == '\n' ||
|
||||
c == '\t' || c == '\r' ||
|
||||
c == '\v' || c == ' ')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void trim()
|
||||
{
|
||||
if (!v)
|
||||
return;
|
||||
unsigned int i = 0;
|
||||
unsigned int j = 0;
|
||||
|
||||
if (cSize == 1)
|
||||
{
|
||||
if (is_space(v[i]))
|
||||
{
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char c0 = v[0];
|
||||
|
||||
if (is_space(c0))
|
||||
{
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (!is_space(v[i]) || (is_space(v[i]) && ((unsigned char)i==cSize-1)))
|
||||
{
|
||||
erase(0, i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cSize = strlen(v);
|
||||
|
||||
if (cSize < 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_space(v[cSize-1]))
|
||||
{
|
||||
for (i=cSize-1; i>=0; i--)
|
||||
{
|
||||
if (!is_space(v[i])
|
||||
|| (is_space(v[i]) && i==0))
|
||||
{
|
||||
erase(i+1, j);
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
if (cSize == 1)
|
||||
{
|
||||
if (is_space(v[0]))
|
||||
{
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String & erase(unsigned int start, int num = npos)
|
||||
{
|
||||
if (!v)
|
||||
return (*this);
|
||||
unsigned int i = 0;
|
||||
//check for bounds
|
||||
if (num == npos || start+num > cSize-num+1)
|
||||
num = cSize - start;
|
||||
//do the erasing
|
||||
bool copyflag = false;
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (i>=start && i<start+num)
|
||||
{
|
||||
if (i+num < cSize)
|
||||
{
|
||||
v[i] = v[i+num];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
copyflag = true;
|
||||
} else if (copyflag) {
|
||||
if (i+num < cSize)
|
||||
{
|
||||
v[i] = v[i+num];
|
||||
} else {
|
||||
v[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
cSize -= num;
|
||||
v[cSize] = 0;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
|
||||
String substr(unsigned int index, int num = npos)
|
||||
{
|
||||
String ns;
|
||||
|
||||
if (index >= cSize || !v)
|
||||
return ns;
|
||||
|
||||
if (num == npos)
|
||||
{
|
||||
num = cSize - index;
|
||||
} else if (index+num >= cSize) {
|
||||
num = cSize - index;
|
||||
}
|
||||
|
||||
unsigned int i = 0, j=0;
|
||||
char *s = new char[cSize+1];
|
||||
|
||||
for (i=index; i<index+num; i++)
|
||||
{
|
||||
s[j++] = v[i];
|
||||
}
|
||||
s[j] = 0;
|
||||
|
||||
ns.assign(s);
|
||||
|
||||
delete [] s;
|
||||
|
||||
return ns;
|
||||
}
|
||||
|
||||
void toLower()
|
||||
{
|
||||
if (!v)
|
||||
return;
|
||||
unsigned int i = 0;
|
||||
for (i=0; i<cSize; i++)
|
||||
{
|
||||
if (v[i] >= 65 && v[i] <= 90)
|
||||
v[i] |= 32;
|
||||
}
|
||||
}
|
||||
|
||||
String & operator = (const String &src)
|
||||
{
|
||||
assign(src);
|
||||
return *this;
|
||||
}
|
||||
|
||||
String & operator = (const char *src)
|
||||
{
|
||||
assign(src);
|
||||
return *this;
|
||||
|
||||
}
|
||||
|
||||
char operator [] (unsigned int index)
|
||||
{
|
||||
if (index > cSize)
|
||||
{
|
||||
return -1;
|
||||
} else {
|
||||
return v[index];
|
||||
}
|
||||
}
|
||||
|
||||
int at(int a)
|
||||
{
|
||||
if (a < 0 || a >= (int)cSize)
|
||||
return -1;
|
||||
|
||||
return v[a];
|
||||
}
|
||||
|
||||
bool at(int at, char c)
|
||||
{
|
||||
if (at < 0 || at >= (int)cSize)
|
||||
return false;
|
||||
|
||||
v[at] = c;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
void Grow(unsigned int d)
|
||||
{
|
||||
if (d<1)
|
||||
return;
|
||||
if (d > mSize)
|
||||
{
|
||||
mSize = d + 16; // allocate a buffer
|
||||
char *t = new char[d+1];
|
||||
if (v) {
|
||||
strcpy(t, v);
|
||||
t[cSize] = 0;
|
||||
delete [] v;
|
||||
}
|
||||
v = t;
|
||||
mSize = d;
|
||||
}
|
||||
}
|
||||
|
||||
char *v;
|
||||
unsigned int mSize;
|
||||
unsigned int cSize;
|
||||
public:
|
||||
static const int npos = -1;
|
||||
};
|
||||
|
||||
#endif //_INCLUDE_CSTRING_H
|
444
dlls/csx_sql/CVector.h
Executable file
444
dlls/csx_sql/CVector.h
Executable file
@ -0,0 +1,444 @@
|
||||
/* AMX Mod X
|
||||
*
|
||||
* by the AMX Mod X Development Team
|
||||
* originally developed by OLO
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
* In addition, as a special exception, the author gives permission to
|
||||
* link the code of this program with the Half-Life Game Engine ("HL
|
||||
* Engine") and Modified Game Libraries ("MODs") developed by Valve,
|
||||
* L.L.C ("Valve"). You must obey the GNU General Public License in all
|
||||
* respects for all of the code used other than the HL Engine and MODs
|
||||
* from Valve. If you modify this file, you may extend this exception
|
||||
* to your version of the file, but you are not obligated to do so. If
|
||||
* you do not wish to do so, delete this exception statement from your
|
||||
* version.
|
||||
*/
|
||||
|
||||
#ifndef __CVECTOR_H__
|
||||
#define __CVECTOR_H__
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
// Vector
|
||||
template <class T> class CVector
|
||||
{
|
||||
bool Grow()
|
||||
{
|
||||
// automatic grow
|
||||
size_t newSize = m_Size * 2;
|
||||
if (newSize == 0)
|
||||
newSize = 8; // a good init value
|
||||
T *newData = new T[newSize];
|
||||
if (!newData)
|
||||
return false;
|
||||
if (m_Data)
|
||||
{
|
||||
memcpy(newData, m_Data, m_Size * sizeof(T));
|
||||
delete [] m_Data;
|
||||
}
|
||||
m_Data = newData;
|
||||
m_Size = newSize;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GrowIfNeeded()
|
||||
{
|
||||
if (m_CurrentUsedSize >= m_Size)
|
||||
return Grow();
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChangeSize(size_t size)
|
||||
{
|
||||
// change size
|
||||
if (size == m_Size)
|
||||
return true;
|
||||
T *newData = new T[size];
|
||||
if (!newData)
|
||||
return false;
|
||||
if (m_Data)
|
||||
{
|
||||
memcpy(newData, m_Data, (m_Size < size) ? (m_Size * sizeof(T)) : (size * sizeof(T)));
|
||||
delete [] m_Data;
|
||||
}
|
||||
if (m_Size < size)
|
||||
m_CurrentSize = size;
|
||||
m_Data = newData;
|
||||
m_Size = size;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FreeMemIfPossible()
|
||||
{
|
||||
|
||||
}
|
||||
protected:
|
||||
T *m_Data;
|
||||
size_t m_Size;
|
||||
size_t m_CurrentUsedSize;
|
||||
size_t m_CurrentSize;
|
||||
public:
|
||||
class iterator
|
||||
{
|
||||
protected:
|
||||
T *m_Ptr;
|
||||
public:
|
||||
// constructors / destructors
|
||||
iterator()
|
||||
{
|
||||
m_Ptr = NULL;
|
||||
}
|
||||
|
||||
iterator(T * ptr)
|
||||
{
|
||||
m_Ptr = ptr;
|
||||
}
|
||||
|
||||
// member functions
|
||||
T * base()
|
||||
{
|
||||
return m_Ptr;
|
||||
}
|
||||
|
||||
const T * base() const
|
||||
{
|
||||
return m_Ptr;
|
||||
}
|
||||
|
||||
// operators
|
||||
T & operator*()
|
||||
{
|
||||
return *m_Ptr;
|
||||
}
|
||||
|
||||
T * operator->()
|
||||
{
|
||||
return m_Ptr;
|
||||
}
|
||||
|
||||
iterator & operator++() // preincrement
|
||||
{
|
||||
++m_Ptr;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
iterator operator++(int) // postincrement
|
||||
{
|
||||
iterator tmp = *this;
|
||||
++m_Ptr;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
iterator & operator--() // predecrement
|
||||
{
|
||||
--m_Ptr;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
iterator operator--(int) // postdecrememnt
|
||||
{
|
||||
iterator tmp = *this;
|
||||
--m_Ptr;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
bool operator==(T * right) const
|
||||
{
|
||||
return (m_Ptr == right);
|
||||
}
|
||||
|
||||
bool operator==(const iterator & right) const
|
||||
{
|
||||
return (m_Ptr == right.m_Ptr);
|
||||
}
|
||||
|
||||
bool operator!=(T * right) const
|
||||
{
|
||||
return (m_Ptr != right);
|
||||
}
|
||||
|
||||
bool operator!=(const iterator & right) const
|
||||
{
|
||||
return (m_Ptr != right.m_Ptr);
|
||||
}
|
||||
|
||||
iterator & operator+=(size_t offset)
|
||||
{
|
||||
m_Ptr += offset;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
iterator & operator-=(size_t offset)
|
||||
{
|
||||
m_Ptr += offset;
|
||||
return (*this);
|
||||
}
|
||||
|
||||
iterator operator+(size_t offset) const
|
||||
{
|
||||
iterator tmp(*this);
|
||||
tmp.m_Ptr += offset;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
iterator operator-(size_t offset) const
|
||||
{
|
||||
iterator tmp(*this);
|
||||
tmp.m_Ptr += offset;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
T & operator[](size_t offset)
|
||||
{
|
||||
return (*(*this + offset));
|
||||
}
|
||||
|
||||
const T & operator[](size_t offset) const
|
||||
{
|
||||
return (*(*this + offset));
|
||||
}
|
||||
|
||||
bool operator<(const iterator & right) const
|
||||
{
|
||||
return m_Ptr < right.m_Ptr;
|
||||
}
|
||||
|
||||
bool operator>(const iterator & right) const
|
||||
{
|
||||
return m_Ptr > right.m_Ptr;
|
||||
}
|
||||
|
||||
bool operator<=(const iterator & right) const
|
||||
{
|
||||
return m_Ptr <= right.m_Ptr;
|
||||
}
|
||||
|
||||
bool operator>=(const iterator & right) const
|
||||
{
|
||||
return m_Ptr >= right.m_Ptr;
|
||||
}
|
||||
|
||||
size_t operator-(const iterator & right) const
|
||||
{
|
||||
return m_Ptr - right.m_Ptr;
|
||||
}
|
||||
};
|
||||
|
||||
// constructors / destructors
|
||||
CVector<T>()
|
||||
{
|
||||
m_Size = 0;
|
||||
m_CurrentUsedSize = 0;
|
||||
m_Data = NULL;
|
||||
}
|
||||
|
||||
CVector<T>(const CVector<T> & other)
|
||||
{
|
||||
// copy data
|
||||
m_Data = new T [other.m_Size];
|
||||
m_Size = other.m_Size;
|
||||
m_CurrentUsedSize = other.m_CurrentUsedSize;
|
||||
memcpy(m_Data, other.m_Data, m_CurrentUsedSize * sizeof(T));
|
||||
}
|
||||
|
||||
~CVector<T>()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
|
||||
// interface
|
||||
size_t size() const
|
||||
{
|
||||
return m_CurrentUsedSize;
|
||||
}
|
||||
|
||||
size_t capacity() const
|
||||
{
|
||||
return m_Size;
|
||||
}
|
||||
|
||||
iterator begin()
|
||||
{
|
||||
return iterator(m_Data);
|
||||
}
|
||||
|
||||
iterator end()
|
||||
{
|
||||
return iterator(m_Data + m_CurrentUsedSize);
|
||||
}
|
||||
|
||||
iterator iterAt(size_t pos)
|
||||
{
|
||||
if (pos > m_CurrentUsedSize)
|
||||
assert(0);
|
||||
return iterator(m_Data + pos);
|
||||
}
|
||||
|
||||
bool reserve(size_t newSize)
|
||||
{
|
||||
return ChangeSize(newSize);
|
||||
}
|
||||
|
||||
bool push_back(const T & elem)
|
||||
{
|
||||
++m_CurrentUsedSize;
|
||||
if (!GrowIfNeeded())
|
||||
{
|
||||
--m_CurrentUsedSize;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_Data[m_CurrentUsedSize - 1] = elem;
|
||||
return true;
|
||||
}
|
||||
|
||||
void pop_back()
|
||||
{
|
||||
--m_CurrentUsedSize;
|
||||
if (m_CurrentUsedSize < 0)
|
||||
m_CurrentUsedSize = 0;
|
||||
// :TODO: free memory sometimes
|
||||
}
|
||||
|
||||
bool resize(size_t newSize)
|
||||
{
|
||||
if (!ChangeSize(newSize))
|
||||
return false;
|
||||
FreeMemIfPossible();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool empty() const
|
||||
{
|
||||
return (m_CurrentUsedSize == 0);
|
||||
}
|
||||
|
||||
T & at(size_t pos)
|
||||
{
|
||||
if (pos > m_CurrentUsedSize)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[pos];
|
||||
}
|
||||
|
||||
const T & at(size_t pos) const
|
||||
{
|
||||
if (pos > m_CurrentUsedSize)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[pos];
|
||||
}
|
||||
|
||||
T & operator[](size_t pos)
|
||||
{
|
||||
return at(pos);
|
||||
}
|
||||
|
||||
const T & operator[](size_t pos) const
|
||||
{
|
||||
return at(pos);
|
||||
}
|
||||
|
||||
T & front()
|
||||
{
|
||||
if (m_CurrentUsedSize < 1)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[0];
|
||||
}
|
||||
|
||||
const T & front() const
|
||||
{
|
||||
if (m_CurrentUsedSize < 1)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[0];
|
||||
}
|
||||
|
||||
T & back()
|
||||
{
|
||||
if (m_CurrentUsedSize < 1)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[m_CurrentUsedSize - 1];
|
||||
}
|
||||
|
||||
const T & back() const
|
||||
{
|
||||
if (m_CurrentUsedSize < 1)
|
||||
{
|
||||
assert(0);
|
||||
}
|
||||
return m_Data[m_CurrentUsedSize - 1];
|
||||
}
|
||||
|
||||
bool insert(iterator where, const T & value)
|
||||
{
|
||||
// we have to insert before
|
||||
// if it is begin, don't decrement
|
||||
if (where != m_Data)
|
||||
--where;
|
||||
// validate iter
|
||||
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
|
||||
return false;
|
||||
|
||||
++m_CurrentUsedSize;
|
||||
if (!GrowIfNeeded())
|
||||
{
|
||||
--m_CurrentUsedSize;
|
||||
return false;
|
||||
}
|
||||
|
||||
memmove(where.base() + 1, where.base(), m_CurrentUsedSize - (where - m_Data));
|
||||
memcpy(where.base(), &value, sizeof(T));
|
||||
return true;
|
||||
}
|
||||
|
||||
void erase(iterator where)
|
||||
{
|
||||
// validate iter
|
||||
if (where < m_Data || where >= (m_Data + m_CurrentUsedSize))
|
||||
return false;
|
||||
|
||||
if (m_CurrentUsedSize > 1)
|
||||
{
|
||||
// move
|
||||
memmove(where.base(), where.base() + 1, m_CurrentUsedSize - 1);
|
||||
}
|
||||
|
||||
--m_CurrentUsedSize;
|
||||
// :TODO: free memory sometimes
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_Size = 0;
|
||||
m_CurrentUsedSize = 0;
|
||||
delete [] m_Data;
|
||||
m_Data = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // __CVECTOR_H__
|
||||
|
102
dlls/csx_sql/Makefile
Executable file
102
dlls/csx_sql/Makefile
Executable file
@ -0,0 +1,102 @@
|
||||
MODNAME = csx_amxx
|
||||
SRCFILES = amxxmodule.cpp CMisc.cpp CRank.cpp meta_api.cpp rank.cpp usermsg.cpp
|
||||
|
||||
EXTRA_LIBS_LINUX =
|
||||
EXTRA_LIBS_WIN32 =
|
||||
EXTRA_LIBDIRS_LINUX = -Lextra/lib_linux
|
||||
EXTRA_LIBDIRS_WIN32 = -Lextra/lib_win32
|
||||
|
||||
EXTRA_INCLUDEDIRS = -Iextra/include -I../amx
|
||||
|
||||
EXTRA_FLAGS = -Dstrcmpi=strcasecmp
|
||||
|
||||
AMXDIR=../amx
|
||||
SDKSRC=../sdk
|
||||
METADIR=../metamod
|
||||
|
||||
OBJDIR_LINUX=obj.linux
|
||||
OBJDIR_WIN32=obj.win32
|
||||
SRCDIR=.
|
||||
|
||||
ifdef windir
|
||||
OS=WIN32
|
||||
else
|
||||
OS=LINUX
|
||||
endif
|
||||
|
||||
CC_LINUX=gcc
|
||||
ifeq "$(OS)" "WIN32"
|
||||
CC_WIN32=gcc
|
||||
LD_WINDLL=dllwrap
|
||||
DEFAULT=win32
|
||||
CLEAN=clean_win32
|
||||
else
|
||||
CC_WIN32=/usr/local/cross-tools/i386-mingw32msvc/bin/gcc
|
||||
LD_WINDLL=/usr/local/cross-tools/bin/i386-mingw32msvc-dllwrap
|
||||
DEFAULT=linux win32
|
||||
CLEAN=clean_both
|
||||
endif
|
||||
|
||||
|
||||
LIBFILE_LINUX = $(MODNAME)_i386.so
|
||||
LIBFILE_WIN32 = $(MODNAME).dll
|
||||
TARGET_LINUX = $(OBJDIR_LINUX)/$(LIBFILE_LINUX)
|
||||
TARGET_WIN32 = $(OBJDIR_WIN32)/$(LIBFILE_WIN32)
|
||||
|
||||
FILES_ALL = *.cpp *.h [A-Z]* *.rc
|
||||
ifeq "$(OS)" "LINUX"
|
||||
ASRCFILES := $(shell ls -t $(SRCFILES))
|
||||
else
|
||||
ASRCFILES := $(shell dir /b)
|
||||
endif
|
||||
OBJ_LINUX := $(SRCFILES:%.cpp=$(OBJDIR_LINUX)/%.o)
|
||||
OBJ_WIN32 := $(SRCFILES:%.cpp=$(OBJDIR_WIN32)/%.o)
|
||||
|
||||
CCOPT = -march=i586 -O6 -ffast-math -funroll-loops \
|
||||
-fomit-frame-pointer -fexpensive-optimizations -malign-loops=2 \
|
||||
-malign-jumps=2 -malign-functions=2 -s -DNDEBUG
|
||||
|
||||
INCLUDEDIRS=-I../curl/include -I$(SRCDIR) -I$(AMXDIR) -I$(METADIR) -I$(SDKSRC)/engine -I$(SDKSRC)/common -I$(SDKSRC)/dlls -I$(SDKSRC) $(EXTRA_INCLUDEDIRS)
|
||||
CFLAGS=-Wall -Wno-unknown-pragmas
|
||||
ODEF = -DOPT_TYPE=\"optimized\"
|
||||
CFLAGS:=$(CCOPT) $(CFLAGS) $(ODEF) $(EXTRA_FLAGS)
|
||||
|
||||
DO_CC_LINUX=$(CC_LINUX) $(CFLAGS) -fPIC $(INCLUDEDIRS) -o $@ -c $<
|
||||
DO_CC_WIN32=$(CC_WIN32) $(CFLAGS) $(INCLUDEDIRS) -o $@ -c $<
|
||||
LINK_LINUX=$(CC_LINUX) $(CFLAGS) -shared -ldl -lm $(OBJ_LINUX) $(EXTRA_LIBDIRS_LINUX) $(EXTRA_LIBS_LINUX) -o $@
|
||||
LINK_WIN32=$(LD_WINDLL) -mwindows --add-stdcall-alias $(OBJ_WIN32) $(EXTRA_LIBDIRS_WIN32) $(EXTRA_LIBS_WIN32) -o $@
|
||||
|
||||
$(OBJDIR_LINUX)/%.o: $(SRCDIR)/%.cpp
|
||||
$(DO_CC_LINUX)
|
||||
|
||||
$(OBJDIR_WIN32)/%.o: $(SRCDIR)/%.cpp
|
||||
$(DO_CC_WIN32)
|
||||
|
||||
default: $(DEFAULT)
|
||||
|
||||
$(TARGET_LINUX): $(OBJDIR_LINUX) $(OBJ_LINUX)
|
||||
$(LINK_LINUX)
|
||||
|
||||
$(TARGET_WIN32): $(OBJDIR_WIN32) $(OBJ_WIN32)
|
||||
$(LINK_WIN32)
|
||||
|
||||
$(OBJDIR_LINUX):
|
||||
mkdir $@
|
||||
|
||||
$(OBJDIR_WIN32):
|
||||
mkdir $@
|
||||
|
||||
win32: $(TARGET_WIN32)
|
||||
|
||||
linux: $(TARGET_LINUX)
|
||||
|
||||
clean: $(CLEAN)
|
||||
|
||||
clean_both:
|
||||
-rm -f $(OBJDIR_LINUX)/*
|
||||
-rm -f $(OBJDIR_WIN32)/*
|
||||
|
||||
clean_win32:
|
||||
del /q $(OBJDIR_WIN32)
|
||||
|
||||
|
178
dlls/csx_sql/Makefile.pl
Executable file
178
dlls/csx_sql/Makefile.pl
Executable file
@ -0,0 +1,178 @@
|
||||
#!/usr/bin/perl
|
||||
#(C)2004 AMX Mod X Development Team
|
||||
# by David "BAILOPAN" Anderson
|
||||
|
||||
# output will occur in bin.x.proc
|
||||
# where x is debug or opt and proc is ix86 or amd64
|
||||
# You must use this script from the project src dir
|
||||
|
||||
#options =
|
||||
# debug - enable gdb debugging
|
||||
# amd64 - compile for AMD64
|
||||
# proc=ix86 - assumed not amd64
|
||||
# clean - clean the specifications above
|
||||
|
||||
$PROJECT = "csx_amxx";
|
||||
$sdk = "../../../hlsdk/SourceCode";
|
||||
$mm = "../../../metamod/metamod";
|
||||
$gccf = "gcc";
|
||||
|
||||
@CPP_SOURCE_FILES = ("amxxmodule.cpp", "CMisc.cpp", "usermsg.cpp", "meta_api.cpp", "rank.cpp", "CRank.cpp");
|
||||
|
||||
@C_SOURCE_FILES = ();
|
||||
my %OPTIONS, %OPT;
|
||||
|
||||
$OPT{"debug"} = "-g -ggdb";
|
||||
$OPT{"opt"} = "-O2 -ffast-math -funroll-loops -fomit-frame-pointer -s -DNDEBUG -Wall -Wno-unknown-pragmas -DOPT_TYPE=\"optimized\" -fno-exceptions -fno-rtti";
|
||||
|
||||
$OPTIONS{"include"} = "-I$sdk -I. -I$mm -I$sdk/engine -I$sdk/common -I$sdk/pm_shared -I$sdk/dlls";
|
||||
|
||||
while ($cmd = shift)
|
||||
{
|
||||
if ($cmd =~ /amd64/) {
|
||||
$OPTIONS{"amd64"} = 1;
|
||||
} elsif ($cmd =~ /debug/) {
|
||||
$OPTIONS{"debug"} = 1;
|
||||
} elsif ($cmd =~ /proc=i(\d)86/) {
|
||||
$proc = $1;
|
||||
if ($OPTIONS{"amd64"})
|
||||
{
|
||||
die "You cannot compile for i".$proc."86 and AMD64.\n";
|
||||
} else {
|
||||
$OPTIONS{"proc"} = "i".$proc."86";
|
||||
}
|
||||
} elsif ($cmd =~ /clean/) {
|
||||
$OPTIONS{"clean"} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
$gcc = `$gccf --version`;
|
||||
if ($gcc =~ /2\.9/)
|
||||
{
|
||||
$OPT{"opt"} .= " -malign-loops=2 -malign-jumps=2 -malign-functions=2";
|
||||
} else {
|
||||
$OPT{"opt"} .= " -falign-loops=2 -falign-jumps=2 -falign-functions=2";
|
||||
}
|
||||
|
||||
if ($OPTIONS{"debug"})
|
||||
{
|
||||
$cflags = $OPT{"debug"};
|
||||
} else {
|
||||
if (!$OPTIONS{"amd64"})
|
||||
{
|
||||
$proc = $OPTIONS{"proc"};
|
||||
if (!$proc)
|
||||
{
|
||||
$proc = 3;
|
||||
}
|
||||
$cflags = "-march=i".$proc."86 ".$OPT{"opt"};
|
||||
} else {
|
||||
$cflags = $OPT{"opt"};
|
||||
}
|
||||
}
|
||||
|
||||
if ($OPTIONS{"amd64"})
|
||||
{
|
||||
$cflags .= " -m64 -DHAVE_I64 -DSMALL_CELL_SIZE=64 $cflags";
|
||||
}
|
||||
|
||||
if ($OPTIONS{"debug"})
|
||||
{
|
||||
$outdir = "bin.debug";
|
||||
} else {
|
||||
$outdir = "bin.opt";
|
||||
}
|
||||
|
||||
if ($OPTIONS{"amd64"})
|
||||
{
|
||||
$outdir .= ".amd64";
|
||||
$bin = $PROJECT."_amd64.so";
|
||||
} else {
|
||||
$proc = $OPTIONS{"proc"};
|
||||
if ($proc)
|
||||
{
|
||||
$outdir .= ".i".$proc."86";
|
||||
$bin = $PROJECT."_i".$proc."86.so";
|
||||
} else {
|
||||
$outdir .= ".i386";
|
||||
$bin = $PROJECT."_i386.so";
|
||||
}
|
||||
}
|
||||
|
||||
unlink("$outdir/$bin");
|
||||
if ($OPTIONS{"clean"})
|
||||
{
|
||||
`rm $outdir/*.o`;
|
||||
die("Project cleaned.\n");
|
||||
}
|
||||
|
||||
#create the dirs
|
||||
#build link list
|
||||
my @LINK;
|
||||
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||
{
|
||||
$file = $CPP_SOURCE_FILES[$i];
|
||||
$file =~ s/\.cpp/\.o/;
|
||||
push(@LINK, $outdir."/".$file);
|
||||
}
|
||||
for ($i=0; $i<=$#C_SOURCE_FILES; $i++)
|
||||
{
|
||||
$file = $C_SOURCE_FILES[$i];
|
||||
$file =~ s/\.c/\.o/;
|
||||
push(@LINK, $outdir."/".$file);
|
||||
}
|
||||
|
||||
if (!(-d $outdir))
|
||||
{
|
||||
mkdir($outdir);
|
||||
}
|
||||
|
||||
$inc = $OPTIONS{"include"};
|
||||
|
||||
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||
{
|
||||
$file = $CPP_SOURCE_FILES[$i];
|
||||
$ofile = $file;
|
||||
$ofile =~ s/\.cpp/\.o/;
|
||||
$ofile = "$outdir/$ofile";
|
||||
$gcc = "$gccf $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||
if (-e $ofile)
|
||||
{
|
||||
$file_time = (stat($file))[9];
|
||||
$ofile_time = (stat($ofile))[9];
|
||||
if ($file_time > $ofile_time)
|
||||
{
|
||||
print "$gcc\n";
|
||||
`$gcc`;
|
||||
}
|
||||
} else {
|
||||
print "$gcc\n";
|
||||
`$gcc`;
|
||||
}
|
||||
}
|
||||
|
||||
for ($i=0; $i<=$#CPP_SOURCE_FILES; $i++)
|
||||
{
|
||||
$file = $C_SOURCE_FILES[$i];
|
||||
$ofile = $file;
|
||||
$ofile =~ s/\.c/\.o/;
|
||||
$ofile = "$outdir/$ofile";
|
||||
$gcc = "cc $cflags -Dstrcmpi=strcasecmp -fPIC $inc -c $file -o $ofile";
|
||||
if (-e $ofile)
|
||||
{
|
||||
$file_time = (stat($file))[9];
|
||||
$ofile_time = (stat($ofile))[9];
|
||||
if ($file_time > $ofile_time)
|
||||
{
|
||||
print "$gcc\n";
|
||||
`$gcc`;
|
||||
}
|
||||
} else {
|
||||
print "$gcc\n";
|
||||
`$gcc`;
|
||||
}
|
||||
}
|
||||
|
||||
$gcc = "$gccf $cflags -shared -ldl -lm @LINK -o $outdir/$bin";
|
||||
print "$gcc\n";
|
||||
`$gcc`;
|
3042
dlls/csx_sql/amxxmodule.cpp
Executable file
3042
dlls/csx_sql/amxxmodule.cpp
Executable file
File diff suppressed because it is too large
Load Diff
2197
dlls/csx_sql/amxxmodule.h
Executable file
2197
dlls/csx_sql/amxxmodule.h
Executable file
File diff suppressed because it is too large
Load Diff
6
dlls/csx_sql/compile.bat
Executable file
6
dlls/csx_sql/compile.bat
Executable file
@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
PATH=D:\gcc\bin;%PATH%
|
||||
|
||||
make
|
||||
|
||||
pause
|
85
dlls/csx_sql/extra/include/mysql/config-netware.h
Executable file
85
dlls/csx_sql/extra/include/mysql/config-netware.h
Executable file
@ -0,0 +1,85 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Defines for netware compatible with MySQL */
|
||||
|
||||
/* required headers */
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <screen.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <pthread.h>
|
||||
#include <termios.h>
|
||||
|
||||
/* required adjustments */
|
||||
#undef HAVE_READDIR_R
|
||||
#undef HAVE_RWLOCK_INIT
|
||||
#undef HAVE_SCHED_H
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
#undef HAVE_SYNCH_H
|
||||
#undef HAVE_CRYPT
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||
#define HAVE_PTHREAD_SIGMASK 1
|
||||
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
|
||||
#define HAVE_BROKEN_REALPATH 1
|
||||
|
||||
/* include the old function apis */
|
||||
#define USE_OLD_FUNCTIONS 1
|
||||
|
||||
/* no case sensitivity */
|
||||
#define FN_NO_CASE_SENCE 1
|
||||
|
||||
/* the thread alarm is not used */
|
||||
#define DONT_USE_THR_ALARM 1
|
||||
|
||||
/* signals do not interrupt sockets */
|
||||
#define SIGNALS_DONT_BREAK_READ 1
|
||||
|
||||
/* signal by closing the sockets */
|
||||
#define SIGNAL_WITH_VIO_CLOSE 1
|
||||
|
||||
/* default directory information */
|
||||
#define DEFAULT_MYSQL_HOME "sys:/mysql"
|
||||
#define PACKAGE "mysql"
|
||||
#define DEFAULT_BASEDIR "sys:/"
|
||||
#define SHAREDIR "share/"
|
||||
#define DEFAULT_CHARSET_HOME "sys:/mysql/"
|
||||
#define DATADIR "data/"
|
||||
|
||||
/* 64-bit file system calls */
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define off_t off64_t
|
||||
#define chsize chsize64
|
||||
#define ftruncate ftruncate64
|
||||
#define lseek lseek64
|
||||
#define pread pread64
|
||||
#define pwrite pwrite64
|
||||
#define tell tell64
|
||||
|
||||
/* do not use the extended time in LibC sys\stat.h */
|
||||
#define _POSIX_SOURCE
|
||||
|
||||
/* Some macros for portability */
|
||||
|
||||
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=(SEC); (ABSTIME).tv_nsec=0; }
|
832
dlls/csx_sql/extra/include/mysql/config-os2.h
Executable file
832
dlls/csx_sql/extra/include/mysql/config-os2.h
Executable file
@ -0,0 +1,832 @@
|
||||
/* Copyright (C) 2000 MySQL AB & Yuri Dario
|
||||
All the above parties has a full, independent copyright to
|
||||
the following code, including the right to use the code in
|
||||
any manner without any demands from the other parties.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/* Defines for OS2 to make it compatible for MySQL */
|
||||
|
||||
#ifndef __CONFIG_OS2_H__
|
||||
#define __CONFIG_OS2_H__
|
||||
|
||||
#include <os2.h>
|
||||
#include <math.h>
|
||||
#include <io.h>
|
||||
#include <types.h>
|
||||
|
||||
/* Define to name of system eg solaris*/
|
||||
#define SYSTEM_TYPE "IBM OS/2 Warp"
|
||||
/* Define to machine type name eg sun10 */
|
||||
#define MACHINE_TYPE "i686"
|
||||
/* Name of package */
|
||||
#define PACKAGE "mysql"
|
||||
/* Version number of package */
|
||||
#define VERSION MYSQL_SERVER_VERSION
|
||||
/* Default socket */
|
||||
#define MYSQL_UNIX_ADDR "\\socket\\MySQL"
|
||||
|
||||
#define FN_LIBCHAR '\\'
|
||||
#define FN_ROOTDIR "\\"
|
||||
#define MY_NFILE 1024 /* This is only used to save filenames */
|
||||
|
||||
#define HAVE_ACCESS
|
||||
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#define _POSIX_PATH_MAX 255
|
||||
#define DWORD ULONG
|
||||
|
||||
#define O_SHARE 0x1000 /* Open file in sharing mode */
|
||||
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
|
||||
#define S_IROTH S_IREAD /* for my_lib */
|
||||
|
||||
#define CANT_DELETE_OPEN_FILES /* saves open files in a list, for delayed delete */
|
||||
|
||||
#define O_NONBLOCK 0x10
|
||||
|
||||
#define NO_OPEN_3 /* For my_create() */
|
||||
#define SIGQUIT SIGTERM /* No SIGQUIT */
|
||||
#define SIGALRM 14 /* Alarm */
|
||||
|
||||
#define NO_FCNTL_NONBLOCK
|
||||
|
||||
#define EFBIG E2BIG
|
||||
/*#define ENFILE EMFILE */
|
||||
/*#define ENAMETOOLONG (EOS2ERR+2) */
|
||||
/*#define ETIMEDOUT 145 */
|
||||
/*#define EPIPE 146 */
|
||||
#define EROFS 147
|
||||
|
||||
#define sleep(A) DosSleep((A)*1000)
|
||||
#define closesocket(A) soclose(A)
|
||||
|
||||
#define F_OK 0
|
||||
#define W_OK 2
|
||||
|
||||
#define bzero(x,y) memset((x),'\0',(y))
|
||||
#define bcopy(x,y,z) memcpy((y),(x),(z))
|
||||
#define bcmp(x,y,z) memcmp((y),(x),(z))
|
||||
|
||||
#define F_RDLCK 4 /* Read lock. */
|
||||
#define F_WRLCK 2 /* Write lock. */
|
||||
#define F_UNLCK 0 /* Remove lock. */
|
||||
|
||||
#define S_IFMT 0x17000 /* Mask for file type */
|
||||
#define F_TO_EOF 0L /* Param to lockf() to lock rest of file */
|
||||
|
||||
#define HUGE_PTR
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
double _cdecl rint( double nr);
|
||||
|
||||
DWORD TlsAlloc( void);
|
||||
BOOL TlsFree( DWORD);
|
||||
PVOID TlsGetValue( DWORD);
|
||||
BOOL TlsSetValue( DWORD, PVOID);
|
||||
|
||||
/* support for > 2GB file size */
|
||||
#define SIZEOF_OFF_T 8
|
||||
#define lseek(A,B,C) _lseek64( A, B, C)
|
||||
#define tell(A) _lseek64( A, 0, SEEK_CUR)
|
||||
|
||||
void* dlopen( char* path, int flag);
|
||||
char* dlerror( void);
|
||||
void* dlsym( void* hmod, char* fn);
|
||||
void dlclose( void* hmod);
|
||||
|
||||
/* Some typedefs */
|
||||
typedef unsigned long long os_off_t;
|
||||
|
||||
/* config.h. Generated automatically by configure. */
|
||||
/* config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
/* #define HAVE_ALLOCA_H 1 */
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
/* #undef HAVE_MMAP */
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
/* #undef HAVE_RESTARTABLE_SYSCALLS */
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
/* #define HAVE_SYS_WAIT_H 1 */
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#define HAVE_UTIME_NULL 1
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
/* #undef size_t */
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Version of .frm files */
|
||||
#define DOT_FRM_VERSION 6
|
||||
|
||||
/* READLINE: */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
|
||||
/* #undef GWINSZ_IN_SYS_IOCTL */
|
||||
|
||||
/* Do we have FIONREAD */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* atomic_add() from <asm/atomic.h> (Linux only) */
|
||||
/* #undef HAVE_ATOMIC_ADD */
|
||||
|
||||
/* atomic_sub() from <asm/atomic.h> (Linux only) */
|
||||
/* #undef HAVE_ATOMIC_SUB */
|
||||
|
||||
/* bool is not defined by all C++ compilators */
|
||||
#define HAVE_BOOL 1
|
||||
|
||||
/* Have berkeley db installed */
|
||||
/* #define HAVE_BERKELEY_DB 1 */
|
||||
|
||||
/* DSB style signals ? */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* Can netinet be included */
|
||||
/* #undef HAVE_BROKEN_NETINET_INCLUDES */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* ZLIB and compress: */
|
||||
#define HAVE_COMPRESS 1
|
||||
|
||||
/* Define if we are using OSF1 DEC threads */
|
||||
/* #undef HAVE_DEC_THREADS */
|
||||
|
||||
/* Define if we are using OSF1 DEC threads on 3.2 */
|
||||
/* #undef HAVE_DEC_3_2_THREADS */
|
||||
|
||||
/* fp_except from ieeefp.h */
|
||||
/* #undef HAVE_FP_EXCEPT */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_GETPW_DECLS */
|
||||
|
||||
/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
|
||||
this with 6 arguments */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE */
|
||||
|
||||
/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */
|
||||
|
||||
/* Define if int8, int16 and int32 types exist */
|
||||
/* #undef HAVE_INT_8_16_32 */
|
||||
|
||||
/* Define if have -lwrap */
|
||||
/* #undef HAVE_LIBWRAP */
|
||||
|
||||
/* Define if we are using Xavier Leroy's LinuxThreads */
|
||||
/* #undef HAVE_LINUXTHREADS */
|
||||
|
||||
/* Do we use user level threads */
|
||||
/* #undef HAVE_mit_thread */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
|
||||
|
||||
/* READLINE: */
|
||||
#define HAVE_POSIX_SIGNALS 0
|
||||
|
||||
/* sigwait with one argument */
|
||||
/* #undef HAVE_NONPOSIX_SIGWAIT */
|
||||
|
||||
/* pthread_attr_setscope */
|
||||
#define HAVE_PTHREAD_ATTR_SETSCOPE 1
|
||||
|
||||
/* POSIX readdir_r */
|
||||
/* #undef HAVE_READDIR_R */
|
||||
|
||||
/* POSIX sigwait */
|
||||
/* #undef HAVE_SIGWAIT */
|
||||
|
||||
/* crypt */
|
||||
#define HAVE_CRYPT 1
|
||||
|
||||
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
|
||||
this with 8 arguments */
|
||||
/* #undef HAVE_SOLARIS_STYLE_GETHOST */
|
||||
|
||||
/* Timespec has a ts_sec instead of tv_sev */
|
||||
#define HAVE_TIMESPEC_TS_SEC 1
|
||||
|
||||
/* Have the tzname variable */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if the system files define uchar */
|
||||
/* #undef HAVE_UCHAR */
|
||||
|
||||
/* Define if the system files define uint */
|
||||
/* #undef HAVE_UINT */
|
||||
|
||||
/* Define if the system files define ulong */
|
||||
/* #undef HAVE_ULONG */
|
||||
|
||||
/* UNIXWARE7 threads are not posix */
|
||||
/* #undef HAVE_UNIXWARE7_THREADS */
|
||||
|
||||
/* new UNIXWARE7 threads that are not yet posix */
|
||||
/* #undef HAVE_UNIXWARE7_POSIX */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_USG_SIGHOLD */
|
||||
|
||||
/* Define if want -lwrap */
|
||||
/* #undef LIBWRAP */
|
||||
|
||||
/* mysql client protocoll version */
|
||||
#define PROTOCOL_VERSION 10
|
||||
|
||||
/* Define if qsort returns void */
|
||||
#define QSORT_TYPE_IS_VOID 1
|
||||
|
||||
/* Define as the return type of qsort (int or void). */
|
||||
#define RETQSORTTYPE void
|
||||
|
||||
/* Define as the base type of the last arg to accept */
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
|
||||
/* Last argument to get/setsockopt */
|
||||
/* #undef SOCKOPT_OPTLEN_TYPE */
|
||||
|
||||
/* #undef SPEED_T_IN_SYS_TYPES */
|
||||
/* #undef SPRINTF_RETURNS_PTR */
|
||||
#define SPRINTF_RETURNS_INT 1
|
||||
/* #undef SPRINTF_RETURNS_GARBAGE */
|
||||
|
||||
/* #undef STRUCT_DIRENT_HAS_D_FILENO */
|
||||
#define STRUCT_DIRENT_HAS_D_INO 1
|
||||
|
||||
/* Define if you want to have threaded code. This may be undef on client code */
|
||||
#define THREAD 1
|
||||
|
||||
/* Should be client be thread safe */
|
||||
/* #undef THREAD_SAFE_CLIENT */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef TIOCSTAT_IN_SYS_IOCTL */
|
||||
|
||||
/* Use multi-byte character routines */
|
||||
/* #undef USE_MB */
|
||||
/* #undef USE_MB_IDENT */
|
||||
|
||||
/* Use MySQL RAID */
|
||||
/* #undef USE_RAID */
|
||||
|
||||
/* Use strcoll() functions when comparing and sorting. */
|
||||
/* #undef USE_STRCOLL */
|
||||
|
||||
/* READLINE: */
|
||||
#define VOID_SIGHANDLER 1
|
||||
|
||||
/* The number of bytes in a char. */
|
||||
#define SIZEOF_CHAR 1
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The number of bytes in a long. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The number of bytes in a long long. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* Define if you have the alarm function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define if you have the atod function. */
|
||||
/* #undef HAVE_ATOD */
|
||||
|
||||
/* Define if you have the bcmp function. */
|
||||
#define HAVE_BCMP 1
|
||||
|
||||
/* Define if you have the bfill function. */
|
||||
/* #undef HAVE_BFILL */
|
||||
|
||||
/* Define if you have the bmove function. */
|
||||
/* #undef HAVE_BMOVE */
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#define HAVE_BZERO 1
|
||||
|
||||
/* Define if you have the chsize function. */
|
||||
#define HAVE_CHSIZE 1
|
||||
|
||||
/* Define if you have the cuserid function. */
|
||||
/* #define HAVE_CUSERID 1 */
|
||||
|
||||
/* Define if you have the dlerror function. */
|
||||
#define HAVE_DLERROR 1
|
||||
|
||||
/* Define if you have the dlopen function. */
|
||||
#define HAVE_DLOPEN 1
|
||||
|
||||
/* Define if you have the fchmod function. */
|
||||
/* #undef HAVE_FCHMOD */
|
||||
|
||||
/* Define if you have the fcntl function. */
|
||||
/* #define HAVE_FCNTL 1 */
|
||||
|
||||
/* Define if you have the fconvert function. */
|
||||
/* #undef HAVE_FCONVERT */
|
||||
|
||||
/* Define if you have the finite function. */
|
||||
/* #undef HAVE_FINITE */
|
||||
|
||||
/* Define if you have the fpresetsticky function. */
|
||||
/* #undef HAVE_FPRESETSTICKY */
|
||||
|
||||
/* Define if you have the fpsetmask function. */
|
||||
/* #undef HAVE_FPSETMASK */
|
||||
|
||||
/* Define if you have the fseeko function. */
|
||||
/* #undef HAVE_FSEEKO */
|
||||
|
||||
/* Define if you have the ftruncate function. */
|
||||
/* #define HAVE_FTRUNCATE 1 */
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define if you have the gethostbyaddr_r function. */
|
||||
/* #undef HAVE_GETHOSTBYADDR_R */
|
||||
|
||||
/* Define if you have the gethostbyname_r function. */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R */
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define if you have the getpass function. */
|
||||
/*#define HAVE_GETPASS 1 */
|
||||
|
||||
/* Define if you have the getpassphrase function. */
|
||||
/* #undef HAVE_GETPASSPHRASE */
|
||||
|
||||
/* Define if you have the getpwnam function. */
|
||||
/* #define HAVE_GETPWNAM 1 */
|
||||
|
||||
/* Define if you have the getpwuid function. */
|
||||
/* #define HAVE_GETPWUID 1 */
|
||||
|
||||
/* Define if you have the getrlimit function. */
|
||||
/* #undef HAVE_GETRLIMIT */
|
||||
|
||||
/* Define if you have the getrusage function. */
|
||||
/* #undef HAVE_GETRUSAGE */
|
||||
|
||||
/* Define if you have the getwd function. */
|
||||
#define HAVE_GETWD 1
|
||||
|
||||
/* Define if you have the index function. */
|
||||
#define HAVE_INDEX 1
|
||||
|
||||
/* Define if you have the initgroups function. */
|
||||
/* #undef HAVE_INITGROUPS */
|
||||
|
||||
/* Define if you have the localtime_r function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define if you have the locking function. */
|
||||
/* #undef HAVE_LOCKING */
|
||||
|
||||
/* Define if you have the longjmp function. */
|
||||
#define HAVE_LONGJMP 1
|
||||
|
||||
/* Define if you have the lrand48 function. */
|
||||
/* #undef HAVE_LRAND48 */
|
||||
|
||||
/* Define if you have the lstat function. */
|
||||
/* #undef HAVE_LSTAT */
|
||||
|
||||
/* Define if you have the madvise function. */
|
||||
/* #undef HAVE_MADVISE */
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#define HAVE_MEMCPY 1
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define if you have the mkstemp function. */
|
||||
/* #define HAVE_MKSTEMP 1 */
|
||||
|
||||
/* Define if you have the mlockall function. */
|
||||
/* #undef HAVE_MLOCKALL */
|
||||
|
||||
/* Define if you have the perror function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define if you have the poll function. */
|
||||
/* #undef HAVE_POLL */
|
||||
|
||||
/* Define if you have the pread function. */
|
||||
/* #undef HAVE_PREAD */
|
||||
|
||||
/* Define if you have the pthread_attr_create function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_CREATE */
|
||||
|
||||
/* Define if you have the pthread_attr_setprio function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETPRIO 1
|
||||
|
||||
/* Define if you have the pthread_attr_setschedparam function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_SETSCHEDPARAM */
|
||||
|
||||
/* Define if you have the pthread_attr_setstacksize function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||
|
||||
/* Define if you have the pthread_condattr_create function. */
|
||||
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
|
||||
|
||||
/* Define if you have the pthread_getsequence_np function. */
|
||||
/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */
|
||||
|
||||
/* Define if you have the pthread_init function. */
|
||||
/* #undef HAVE_PTHREAD_INIT */
|
||||
|
||||
/* Define if you have the pthread_rwlock_rdlock function. */
|
||||
/* #undef HAVE_PTHREAD_RWLOCK_RDLOCK */
|
||||
|
||||
/* Define if you have the pthread_setprio function. */
|
||||
#define HAVE_PTHREAD_SETPRIO 1
|
||||
|
||||
/* Define if you have the pthread_setprio_np function. */
|
||||
/* #undef HAVE_PTHREAD_SETPRIO_NP */
|
||||
|
||||
/* Define if you have the pthread_setschedparam function. */
|
||||
/* #undef HAVE_PTHREAD_SETSCHEDPARAM */
|
||||
|
||||
/* Define if you have the pthread_sigmask function. */
|
||||
#define HAVE_PTHREAD_SIGMASK 1
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#define HAVE_PUTENV 1
|
||||
|
||||
/* Define if you have the readlink function. */
|
||||
/* #undef HAVE_READLINK */
|
||||
|
||||
/* Define if you have the realpath function. */
|
||||
/* #undef HAVE_REALPATH */
|
||||
|
||||
/* Define if you have the rename function. */
|
||||
#define HAVE_RENAME 1
|
||||
|
||||
/* Define if you have the rint function. */
|
||||
#define HAVE_RINT 1
|
||||
|
||||
/* Define if you have the rwlock_init function. */
|
||||
/* #undef HAVE_RWLOCK_INIT */
|
||||
|
||||
/* Define if you have the select function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
/* #undef HAVE_SETENV */
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define if you have the setupterm function. */
|
||||
/* #undef HAVE_SETUPTERM */
|
||||
|
||||
/* Define if you have the sighold function. */
|
||||
/* #undef HAVE_SIGHOLD */
|
||||
|
||||
/* Define if you have the sigset function. */
|
||||
/* #undef HAVE_SIGSET */
|
||||
|
||||
/* Define if you have the sigthreadmask function. */
|
||||
/* #undef HAVE_SIGTHREADMASK */
|
||||
|
||||
/* Define if you have the snprintf function. */
|
||||
/* #define HAVE_SNPRINTF 1 */
|
||||
|
||||
/* Define if you have the socket function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
/* #undef HAVE_STPCPY */
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
/* #undef HAVE_STRCASECMP */
|
||||
|
||||
/* Define if you have the strcoll function. */
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define if you have the strnlen function. */
|
||||
/* #undef HAVE_STRNLEN */
|
||||
|
||||
/* Define if you have the strpbrk function. */
|
||||
#define HAVE_STRPBRK 1
|
||||
|
||||
/* Define if you have the strstr function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define if you have the strtok_r function. */
|
||||
/* #undef HAVE_STRTOK_R */
|
||||
|
||||
/* Define if you have the strtol function. */
|
||||
#define HAVE_STRTOL 1
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#define HAVE_STRTOUL 1
|
||||
|
||||
/* Define if you have the strtoull function. */
|
||||
/* #undef HAVE_STRTOULL */
|
||||
|
||||
/* Define if you have the tcgetattr function. */
|
||||
#define HAVE_TCGETATTR 1
|
||||
|
||||
/* Define if you have the tell function. */
|
||||
#define HAVE_TELL 1
|
||||
|
||||
/* Define if you have the tempnam function. */
|
||||
#define HAVE_TEMPNAM 1
|
||||
|
||||
/* Define if you have the thr_setconcurrency function. */
|
||||
/* #undef HAVE_THR_SETCONCURRENCY */
|
||||
|
||||
/* Define if you have the vidattr function. */
|
||||
/* #undef HAVE_VIDATTR */
|
||||
|
||||
/* Define if you have the <alloca.h> header file. */
|
||||
/* #define HAVE_ALLOCA_H 1 */
|
||||
|
||||
/* Define if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define if you have the <asm/termbits.h> header file. */
|
||||
/* #undef HAVE_ASM_TERMBITS_H */
|
||||
|
||||
/* Define if you have the <crypt.h> header file. */
|
||||
#define HAVE_CRYPT_H 1
|
||||
|
||||
/* Define if you have the <curses.h> header file. */
|
||||
/* #define HAVE_CURSES_H 1 */
|
||||
|
||||
/* Define if you have the <dirent.h> header file. */
|
||||
/* #define HAVE_DIRENT_H 1 */
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define if you have the <float.h> header file. */
|
||||
#define HAVE_FLOAT_H 1
|
||||
|
||||
/* Define if you have the <floatingpoint.h> header file. */
|
||||
/* #undef HAVE_FLOATINGPOINT_H */
|
||||
|
||||
/* Define if you have the <grp.h> header file. */
|
||||
/* #define HAVE_GRP_H 1 */
|
||||
|
||||
/* Define if you have the <ieeefp.h> header file. */
|
||||
/* #undef HAVE_IEEEFP_H */
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define if you have the <paths.h> header file. */
|
||||
/* #undef HAVE_PATHS_H */
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
/* #define HAVE_PWD_H 1 */
|
||||
|
||||
/* Define if you have the <sched.h> header file. */
|
||||
/* #undef HAVE_SCHED_H */
|
||||
|
||||
/* Define if you have the <select.h> header file. */
|
||||
/* #undef HAVE_SELECT_H */
|
||||
|
||||
/* Define if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
/* #define HAVE_STRINGS_H 1 */
|
||||
|
||||
/* Define if you have the <synch.h> header file. */
|
||||
/* #undef HAVE_SYNCH_H */
|
||||
|
||||
/* Define if you have the <sys/dir.h> header file. */
|
||||
/* #define HAVE_SYS_DIR_H 1 */
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
/* #define HAVE_SYS_FILE_H 1 */
|
||||
|
||||
/* Define if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define if you have the <sys/mman.h> header file. */
|
||||
/* #undef HAVE_SYS_MMAN_H */
|
||||
|
||||
/* Define if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define if you have the <sys/pte.h> header file. */
|
||||
/* #undef HAVE_SYS_PTE_H */
|
||||
|
||||
/* Define if you have the <sys/ptem.h> header file. */
|
||||
/* #undef HAVE_SYS_PTEM_H */
|
||||
|
||||
/* Define if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define if you have the <sys/stream.h> header file. */
|
||||
/* #undef HAVE_SYS_STREAM_H */
|
||||
|
||||
/* Define if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define if you have the <sys/un.h> header file. */
|
||||
#define HAVE_SYS_UN_H 1
|
||||
|
||||
/* Define if you have the <sys/utime.h> header file. */
|
||||
#define HAVE_SYS_UTIME_H 1
|
||||
|
||||
/* Define if you have the <sys/vadvise.h> header file. */
|
||||
/* #undef HAVE_SYS_VADVISE_H */
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
/* #define HAVE_SYS_WAIT_H 1 */
|
||||
|
||||
/* Define if you have the <term.h> header file. */
|
||||
/* #undef HAVE_TERM_H */
|
||||
|
||||
/* Define if you have the <termbits.h> header file. */
|
||||
/* #undef HAVE_TERMBITS_H */
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
/* #define HAVE_TERMCAP_H 1 */
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
/* /#define HAVE_TERMIO_H 1 */
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
/* #define HAVE_TERMIOS_H 1 */
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define if you have the <varargs.h> header file. */
|
||||
#define HAVE_VARARGS_H 1
|
||||
|
||||
/* Define if you have the bind library (-lbind). */
|
||||
/* #undef HAVE_LIBBIND */
|
||||
|
||||
/* Define if you have the c_r library (-lc_r). */
|
||||
/* #undef HAVE_LIBC_R */
|
||||
|
||||
/* Define if you have the compat library (-lcompat). */
|
||||
/* #undef HAVE_LIBCOMPAT */
|
||||
|
||||
/* Define if you have the crypt library (-lcrypt). */
|
||||
#define HAVE_LIBCRYPT 1
|
||||
|
||||
/* Define if you have the dl library (-ldl). */
|
||||
#define HAVE_LIBDL 1
|
||||
|
||||
/* Define if you have the gen library (-lgen). */
|
||||
/* #undef HAVE_LIBGEN */
|
||||
|
||||
/* Define if you have the m library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define if you have the nsl library (-lnsl). */
|
||||
/* #undef HAVE_LIBNSL */
|
||||
|
||||
/* Define if you have the nsl_r library (-lnsl_r). */
|
||||
/* #undef HAVE_LIBNSL_R */
|
||||
|
||||
/* Define if you have the pthread library (-lpthread). */
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
|
||||
/* Define if you have the socket library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
/* #undef _FILE_OFFSET_BITS */
|
||||
|
||||
/* Define to make fseeko etc. visible, on some hosts. */
|
||||
/* #undef _LARGEFILE_SOURCE */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
#endif /* __CONFIG_OS2_H__ */
|
335
dlls/csx_sql/extra/include/mysql/config-win.h
Executable file
335
dlls/csx_sql/extra/include/mysql/config-win.h
Executable file
@ -0,0 +1,335 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Defines for Win32 to make it compatible for MySQL */
|
||||
|
||||
#include <sys/locking.h>
|
||||
#include <windows.h>
|
||||
#include <math.h> /* Because of rint() */
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#if defined(__NT__)
|
||||
#define SYSTEM_TYPE "NT"
|
||||
#elif defined(__WIN2000__)
|
||||
#define SYSTEM_TYPE "WIN2000"
|
||||
#else
|
||||
#define SYSTEM_TYPE "Win95/Win98"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || defined(WIN64)
|
||||
#define MACHINE_TYPE "ia64" /* Define to machine type name */
|
||||
#else
|
||||
#define MACHINE_TYPE "i32" /* Define to machine type name */
|
||||
#ifndef _WIN32
|
||||
#define _WIN32 /* Compatible with old source */
|
||||
#endif
|
||||
#ifndef __WIN32__
|
||||
#define __WIN32__
|
||||
#endif
|
||||
#endif /* _WIN64 */
|
||||
#ifndef __WIN__
|
||||
#define __WIN__ /* To make it easier in VC++ */
|
||||
#endif
|
||||
|
||||
/* File and lock constants */
|
||||
#define O_SHARE 0x1000 /* Open file in sharing mode */
|
||||
#ifdef __BORLANDC__
|
||||
#define F_RDLCK LK_NBLCK /* read lock */
|
||||
#define F_WRLCK LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK LK_UNLCK /* remove lock(s) */
|
||||
#else
|
||||
#define F_RDLCK _LK_NBLCK /* read lock */
|
||||
#define F_WRLCK _LK_NBRLCK /* write lock */
|
||||
#define F_UNLCK _LK_UNLCK /* remove lock(s) */
|
||||
#endif
|
||||
|
||||
#define F_EXCLUSIVE 1 /* We have only exclusive locking */
|
||||
#define F_TO_EOF (INT_MAX32/2) /* size for lock of all file */
|
||||
#define F_OK 0 /* parameter to access() */
|
||||
|
||||
#define S_IROTH S_IREAD /* for my_lib */
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#define FILE_BINARY O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY 0
|
||||
#define O_SHORT_LIVED 0
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#else
|
||||
#define O_BINARY _O_BINARY /* compability with MSDOS */
|
||||
#define FILE_BINARY _O_BINARY /* my_fopen in binary mode */
|
||||
#define O_TEMPORARY _O_TEMPORARY
|
||||
#define O_SHORT_LIVED _O_SHORT_LIVED
|
||||
#define SH_DENYNO _SH_DENYNO
|
||||
#endif
|
||||
#define NO_OPEN_3 /* For my_create() */
|
||||
|
||||
#define SIGQUIT SIGTERM /* No SIGQUIT */
|
||||
|
||||
#undef _REENTRANT /* Crashes something for win32 */
|
||||
#undef SAFE_MUTEX /* Can't be used on windows */
|
||||
|
||||
#define LONGLONG_MIN ((__int64) 0x8000000000000000)
|
||||
#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF)
|
||||
#define ULONGLONG_MAX ((unsigned __int64) 0xFFFFFFFFFFFFFFFF)
|
||||
#define LL(A) ((__int64) A)
|
||||
|
||||
/* Type information */
|
||||
|
||||
typedef unsigned short ushort;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned __int64 ulonglong; /* Microsofts 64 bit types */
|
||||
typedef __int64 longlong;
|
||||
typedef int sigset_t;
|
||||
#define longlong_defined
|
||||
/* off_t should not be __int64 because of conflicts in header files;
|
||||
Use my_off_t or os_off_t instead */
|
||||
typedef long off_t;
|
||||
typedef __int64 os_off_t;
|
||||
#ifdef _WIN64
|
||||
typedef UINT_PTR rf_SetTimer;
|
||||
#else
|
||||
typedef unsigned int size_t;
|
||||
typedef uint rf_SetTimer;
|
||||
#endif
|
||||
|
||||
#define Socket_defined
|
||||
#define my_socket SOCKET
|
||||
#define bool BOOL
|
||||
#define SIGPIPE SIGINT
|
||||
#define RETQSORTTYPE void
|
||||
#define QSORT_TYPE_IS_VOID
|
||||
#define RETSIGTYPE void
|
||||
#define SOCKET_SIZE_TYPE int
|
||||
#define my_socket_defined
|
||||
#define bool_defined
|
||||
#define byte_defined
|
||||
#define HUGE_PTR
|
||||
#define STDCALL __stdcall /* Used by libmysql.dll */
|
||||
#define isnan(X) _isnan(X)
|
||||
#define finite(X) _finite(X)
|
||||
|
||||
#ifndef UNDEF_THREAD_HACK
|
||||
#define THREAD
|
||||
#endif
|
||||
#define VOID_SIGHANDLER
|
||||
#define SIZEOF_CHAR 1
|
||||
#define SIZEOF_LONG 4
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
#define SIZEOF_OFF_T 8
|
||||
#ifdef _WIN64
|
||||
#define SIZEOF_CHARP 8
|
||||
#else
|
||||
#define SIZEOF_CHARP 4
|
||||
#endif
|
||||
#define HAVE_BROKEN_NETINET_INCLUDES
|
||||
#ifdef __NT__
|
||||
#define HAVE_NAMED_PIPE /* We can only create pipes on NT */
|
||||
#endif
|
||||
|
||||
/* We need to close files to break connections on shutdown */
|
||||
#ifndef SIGNAL_WITH_VIO_CLOSE
|
||||
#define SIGNAL_WITH_VIO_CLOSE
|
||||
#endif
|
||||
|
||||
/* Use all character sets in MySQL */
|
||||
#define USE_MB 1
|
||||
#define USE_MB_IDENT 1
|
||||
#define USE_STRCOLL 1
|
||||
|
||||
/* All windows servers should support .sym files */
|
||||
#undef USE_SYMDIR
|
||||
#define USE_SYMDIR
|
||||
|
||||
/* If LOAD DATA LOCAL INFILE should be enabled by default */
|
||||
#define ENABLED_LOCAL_INFILE 1
|
||||
|
||||
/* Convert some simple functions to Posix */
|
||||
|
||||
#define sigset(A,B) signal((A),(B))
|
||||
#define finite(A) _finite(A)
|
||||
#define sleep(A) Sleep((A)*1000)
|
||||
|
||||
#ifndef __BORLANDC__
|
||||
#define access(A,B) _access(A,B)
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
|
||||
inline double rint(double nr)
|
||||
{
|
||||
double f = floor(nr);
|
||||
double c = ceil(nr);
|
||||
return (((c-nr) >= (nr-f)) ? f :c);
|
||||
}
|
||||
|
||||
#ifdef _WIN64
|
||||
#define ulonglong2double(A) ((double) (ulonglong) (A))
|
||||
#define my_off_t2double(A) ((double) (my_off_t) (A))
|
||||
|
||||
#else
|
||||
inline double ulonglong2double(ulonglong value)
|
||||
{
|
||||
longlong nr=(longlong) value;
|
||||
if (nr >= 0)
|
||||
return (double) nr;
|
||||
return (18446744073709551616.0 + (double) nr);
|
||||
}
|
||||
#define my_off_t2double(A) ulonglong2double(A)
|
||||
#endif /* _WIN64 */
|
||||
#else
|
||||
#define inline __inline
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#if SIZEOF_OFF_T > 4
|
||||
#define lseek(A,B,C) _lseeki64((A),(longlong) (B),(C))
|
||||
#define tell(A) _telli64(A)
|
||||
#endif
|
||||
|
||||
#define set_timespec(ABSTIME,SEC) { (ABSTIME).tv_sec=time((time_t*)0) + (time_t) (SEC); (ABSTIME).tv_nsec=0; }
|
||||
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* Optimized store functions for Intel x86 */
|
||||
|
||||
#ifndef _WIN64
|
||||
#define sint2korr(A) (*((int16 *) (A)))
|
||||
#define sint3korr(A) ((int32) ((((uchar) (A)[2]) & 128) ? \
|
||||
(((uint32) 255L << 24) | \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])) : \
|
||||
(((uint32) (uchar) (A)[2]) << 16) |\
|
||||
(((uint32) (uchar) (A)[1]) << 8) | \
|
||||
((uint32) (uchar) (A)[0])))
|
||||
#define sint4korr(A) (*((long *) (A)))
|
||||
#define uint2korr(A) (*((uint16 *) (A)))
|
||||
#define uint3korr(A) (long) (*((unsigned long *) (A)) & 0xFFFFFF)
|
||||
#define uint4korr(A) (*((unsigned long *) (A)))
|
||||
#define uint5korr(A) ((ulonglong)(((uint32) ((uchar) (A)[0])) +\
|
||||
(((uint32) ((uchar) (A)[1])) << 8) +\
|
||||
(((uint32) ((uchar) (A)[2])) << 16) +\
|
||||
(((uint32) ((uchar) (A)[3])) << 24)) +\
|
||||
(((ulonglong) ((uchar) (A)[4])) << 32))
|
||||
#define uint8korr(A) (*((ulonglong *) (A)))
|
||||
#define sint8korr(A) (*((longlong *) (A)))
|
||||
#define int2store(T,A) *((uint16*) (T))= (uint16) (A)
|
||||
#define int3store(T,A) { *(T)= (uchar) ((A));\
|
||||
*(T+1)=(uchar) (((uint) (A) >> 8));\
|
||||
*(T+2)=(uchar) (((A) >> 16)); }
|
||||
#define int4store(T,A) *((long *) (T))= (long) (A)
|
||||
#define int5store(T,A) { *(T)= (uchar)((A));\
|
||||
*((T)+1)=(uchar) (((A) >> 8));\
|
||||
*((T)+2)=(uchar) (((A) >> 16));\
|
||||
*((T)+3)=(uchar) (((A) >> 24)); \
|
||||
*((T)+4)=(uchar) (((A) >> 32)); }
|
||||
#define int8store(T,A) *((ulonglong *) (T))= (ulonglong) (A)
|
||||
|
||||
#define doubleget(V,M) { *((long *) &V) = *((long*) M); \
|
||||
*(((long *) &V)+1) = *(((long*) M)+1); }
|
||||
#define doublestore(T,V) { *((long *) T) = *((long*) &V); \
|
||||
*(((long *) T)+1) = *(((long*) &V)+1); }
|
||||
#define float4get(V,M) { *((long *) &(V)) = *((long*) (M)); }
|
||||
#define float8get(V,M) doubleget((V),(M))
|
||||
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
|
||||
#define float8store(V,M) doublestore((V),(M))
|
||||
#endif /* _WIN64 */
|
||||
|
||||
#define HAVE_PERROR
|
||||
#define HAVE_VFPRINT
|
||||
#define HAVE_RENAME /* Have rename() as function */
|
||||
#define HAVE_BINARY_STREAMS /* Have "b" flag in streams */
|
||||
#define HAVE_LONG_JMP /* Have long jump function */
|
||||
#define HAVE_LOCKING /* have locking() call */
|
||||
#define HAVE_ERRNO_AS_DEFINE /* errno is a define */
|
||||
#define HAVE_STDLIB /* everything is include in this file */
|
||||
#define HAVE_MEMCPY
|
||||
#define HAVE_MEMMOVE
|
||||
#define HAVE_GETCWD
|
||||
#define HAVE_TELL
|
||||
#define HAVE_TZNAME
|
||||
#define HAVE_PUTENV
|
||||
#define HAVE_SELECT
|
||||
#define HAVE_SETLOCALE
|
||||
#define HAVE_SOCKET /* Giangi */
|
||||
#define HAVE_FLOAT_H
|
||||
#define HAVE_LIMITS_H
|
||||
#define HAVE_STDDEF_H
|
||||
#define HAVE_RINT /* defined in this file */
|
||||
#define NO_FCNTL_NONBLOCK /* No FCNTL */
|
||||
#define HAVE_ALLOCA
|
||||
#define HAVE_STRPBRK
|
||||
#define HAVE_STRSTR
|
||||
#define HAVE_COMPRESS
|
||||
#define HAVE_CREATESEMAPHORE
|
||||
#define HAVE_ISNAN
|
||||
#define HAVE_FINITE
|
||||
#define HAVE_ISAM /* We want to have support for ISAM in 4.0 */
|
||||
#define HAVE_QUERY_CACHE
|
||||
#define SPRINTF_RETURNS_INT
|
||||
#define HAVE_SETFILEPOINTER
|
||||
|
||||
#ifdef NOT_USED
|
||||
#define HAVE_SNPRINTF /* Gave link error */
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */
|
||||
#define HAVE_ANSI_INCLUDE
|
||||
#define HAVE_SYS_UTIME_H
|
||||
#define HAVE_STRTOUL
|
||||
#endif
|
||||
#define my_reinterpret_cast(A) reinterpret_cast <A>
|
||||
#define my_const_cast(A) const_cast<A>
|
||||
|
||||
|
||||
/* MYSQL OPTIONS */
|
||||
|
||||
#ifdef _CUSTOMCONFIG_
|
||||
#include <custom_conf.h>
|
||||
#else
|
||||
#define DEFAULT_MYSQL_HOME "c:\\mysql"
|
||||
#define PACKAGE "mysql"
|
||||
#define DEFAULT_BASEDIR "C:\\"
|
||||
#define SHAREDIR "share"
|
||||
#define DEFAULT_CHARSET_HOME "C:/mysql/"
|
||||
#endif
|
||||
|
||||
/* File name handling */
|
||||
|
||||
#define FN_LIBCHAR '\\'
|
||||
#define FN_ROOTDIR "\\"
|
||||
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
|
||||
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
|
||||
#define MY_NFILE 1024
|
||||
|
||||
#define DO_NOT_REMOVE_THREAD_WRAPPERS
|
||||
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
|
||||
/* The following is only used for statistics, so it should be good enough */
|
||||
#ifdef __NT__ /* This should also work on Win98 but .. */
|
||||
#define thread_safe_add(V,C,L) InterlockedExchangeAdd((long*) &(V),(C))
|
||||
#define thread_safe_sub(V,C,L) InterlockedExchangeAdd((long*) &(V),-(long) (C))
|
||||
#define statistic_add(V,C,L) thread_safe_add((V),(C),(L))
|
||||
#else
|
||||
#define thread_safe_add(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)+=(C); pthread_mutex_unlock((L));
|
||||
#define thread_safe_sub(V,C,L) \
|
||||
pthread_mutex_lock((L)); (V)-=(C); pthread_mutex_unlock((L));
|
||||
#define statistic_add(V,C,L) (V)+=(C)
|
||||
#endif
|
||||
#define statistic_increment(V,L) thread_safe_increment((V),(L))
|
93
dlls/csx_sql/extra/include/mysql/dbug.h
Executable file
93
dlls/csx_sql/extra/include/mysql/dbug.h
Executable file
@ -0,0 +1,93 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _dbug_h
|
||||
#define _dbug_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(DBUG_OFF) && !defined(_lint)
|
||||
extern int _db_on_,_no_db_;
|
||||
extern FILE *_db_fp_;
|
||||
extern char *_db_process_;
|
||||
extern int _db_keyword_(const char *keyword);
|
||||
extern void _db_setjmp_(void);
|
||||
extern void _db_longjmp_(void);
|
||||
extern void _db_push_(const char *control);
|
||||
extern void _db_pop_(void);
|
||||
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
|
||||
const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_, char ***);
|
||||
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_);
|
||||
extern void _db_pargs_(uint _line_,const char *keyword);
|
||||
extern void _db_doprnt_ _VARARGS((const char *format,...));
|
||||
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
|
||||
uint length);
|
||||
extern void _db_lock_file();
|
||||
extern void _db_unlock_file();
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
|
||||
&_db_framep_)
|
||||
#define DBUG_LEAVE \
|
||||
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
|
||||
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
|
||||
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
|
||||
#define DBUG_EXECUTE(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
|
||||
#define DBUG_PRINT(keyword,arglist) \
|
||||
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
|
||||
#define DBUG_PUSH(a1) _db_push_ (a1)
|
||||
#define DBUG_POP() _db_pop_ ()
|
||||
#define DBUG_PROCESS(a1) (_db_process_ = a1)
|
||||
#define DBUG_FILE (_db_fp_)
|
||||
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
|
||||
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
|
||||
#define DBUG_DUMP(keyword,a1,a2)\
|
||||
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
|
||||
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
|
||||
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
|
||||
#define DEBUGGER_ON _no_db_=0
|
||||
#define DBUG_LOCK_FILE { _db_lock_file(); }
|
||||
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
|
||||
#define DBUG_ASSERT(A) assert(A)
|
||||
#else /* No debugger */
|
||||
|
||||
#define DBUG_ENTER(a1)
|
||||
#define DBUG_RETURN(a1) return(a1)
|
||||
#define DBUG_VOID_RETURN return
|
||||
#define DBUG_EXECUTE(keyword,a1) {}
|
||||
#define DBUG_PRINT(keyword,arglist) {}
|
||||
#define DBUG_PUSH(a1) {}
|
||||
#define DBUG_POP() {}
|
||||
#define DBUG_PROCESS(a1) {}
|
||||
#define DBUG_FILE (stderr)
|
||||
#define DBUG_SETJMP setjmp
|
||||
#define DBUG_LONGJMP longjmp
|
||||
#define DBUG_DUMP(keyword,a1,a2) {}
|
||||
#define DBUG_IN_USE 0
|
||||
#define DEBUGGER_OFF
|
||||
#define DEBUGGER_ON
|
||||
#define DBUG_LOCK_FILE
|
||||
#define DBUG_UNLOCK_FILE
|
||||
#define DBUG_ASSERT(A) {}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
66
dlls/csx_sql/extra/include/mysql/errmsg.h
Executable file
66
dlls/csx_sql/extra/include/mysql/errmsg.h
Executable file
@ -0,0 +1,66 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Error messages for mysql clients */
|
||||
/* error messages for the demon is in share/language/errmsg.sys */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void init_client_errs(void);
|
||||
extern const char *client_errors[]; /* Error messages */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#define CR_MIN_ERROR 2000 /* For easier client code */
|
||||
#define CR_MAX_ERROR 2999
|
||||
#if defined(OS2) && defined(MYSQL_SERVER)
|
||||
#define CER(X) client_errors[(X)-CR_MIN_ERROR]
|
||||
#else
|
||||
#define ER(X) client_errors[(X)-CR_MIN_ERROR]
|
||||
#endif
|
||||
#define CLIENT_ERRMAP 2 /* Errormap used by my_error() */
|
||||
|
||||
#define CR_UNKNOWN_ERROR 2000
|
||||
#define CR_SOCKET_CREATE_ERROR 2001
|
||||
#define CR_CONNECTION_ERROR 2002
|
||||
#define CR_CONN_HOST_ERROR 2003
|
||||
#define CR_IPSOCK_ERROR 2004
|
||||
#define CR_UNKNOWN_HOST 2005
|
||||
#define CR_SERVER_GONE_ERROR 2006
|
||||
#define CR_VERSION_ERROR 2007
|
||||
#define CR_OUT_OF_MEMORY 2008
|
||||
#define CR_WRONG_HOST_INFO 2009
|
||||
#define CR_LOCALHOST_CONNECTION 2010
|
||||
#define CR_TCP_CONNECTION 2011
|
||||
#define CR_SERVER_HANDSHAKE_ERR 2012
|
||||
#define CR_SERVER_LOST 2013
|
||||
#define CR_COMMANDS_OUT_OF_SYNC 2014
|
||||
#define CR_NAMEDPIPE_CONNECTION 2015
|
||||
#define CR_NAMEDPIPEWAIT_ERROR 2016
|
||||
#define CR_NAMEDPIPEOPEN_ERROR 2017
|
||||
#define CR_NAMEDPIPESETSTATE_ERROR 2018
|
||||
#define CR_CANT_READ_CHARSET 2019
|
||||
#define CR_NET_PACKET_TOO_LARGE 2020
|
||||
#define CR_EMBEDDED_CONNECTION 2021
|
||||
#define CR_PROBE_SLAVE_STATUS 2022
|
||||
#define CR_PROBE_SLAVE_HOSTS 2023
|
||||
#define CR_PROBE_SLAVE_CONNECT 2024
|
||||
#define CR_PROBE_MASTER_CONNECT 2025
|
||||
#define CR_SSL_CONNECTION_ERROR 2026
|
||||
#define CR_MALFORMED_PACKET 2027
|
||||
|
67
dlls/csx_sql/extra/include/mysql/ft_global.h
Executable file
67
dlls/csx_sql/extra/include/mysql/ft_global.h
Executable file
@ -0,0 +1,67 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
|
||||
|
||||
/* some definitions for full-text indices */
|
||||
|
||||
/* #include "myisam.h" */
|
||||
|
||||
#ifndef _ft_global_h
|
||||
#define _ft_global_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define FT_QUERY_MAXLEN 1024
|
||||
#define HA_FT_MAXLEN 254
|
||||
|
||||
typedef struct st_ft_info FT_INFO;
|
||||
struct _ft_vft
|
||||
{
|
||||
int (*read_next)(FT_INFO *, char *);
|
||||
float (*find_relevance)(FT_INFO *, byte *, uint);
|
||||
void (*close_search)(FT_INFO *);
|
||||
float (*get_relevance)(FT_INFO *);
|
||||
void (*reinit_search)(FT_INFO *);
|
||||
};
|
||||
|
||||
#ifndef FT_CORE
|
||||
struct st_ft_info
|
||||
{
|
||||
struct _ft_vft *please; /* INTERCAL style :-) */
|
||||
};
|
||||
#endif
|
||||
|
||||
extern const char *ft_stopword_file;
|
||||
extern const char *ft_precompiled_stopwords[];
|
||||
|
||||
extern ulong ft_min_word_len;
|
||||
extern ulong ft_max_word_len;
|
||||
extern ulong ft_max_word_len_for_sort;
|
||||
extern const char *ft_boolean_syntax;
|
||||
|
||||
int ft_init_stopwords(void);
|
||||
void ft_free_stopwords(void);
|
||||
|
||||
#define FT_NL 0
|
||||
#define FT_BOOL 1
|
||||
FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, my_bool);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
66
dlls/csx_sql/extra/include/mysql/hash.h
Executable file
66
dlls/csx_sql/extra/include/mysql/hash.h
Executable file
@ -0,0 +1,66 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* Dynamic hashing of record with different key-length */
|
||||
|
||||
#ifndef _hash_h
|
||||
#define _hash_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef byte *(*hash_get_key)(const byte *,uint*,my_bool);
|
||||
typedef void (*hash_free_key)(void *);
|
||||
|
||||
/* flags for hash_init */
|
||||
#define HASH_CASE_INSENSITIVE 1
|
||||
|
||||
typedef struct st_hash_info {
|
||||
uint next; /* index to next key */
|
||||
byte *data; /* data for current entry */
|
||||
} HASH_LINK;
|
||||
|
||||
typedef struct st_hash {
|
||||
uint key_offset,key_length; /* Length of key if const length */
|
||||
uint records,blength,current_record;
|
||||
uint flags;
|
||||
DYNAMIC_ARRAY array; /* Place for hash_keys */
|
||||
hash_get_key get_key;
|
||||
void (*free)(void *);
|
||||
uint (*calc_hashnr)(const byte *key,uint length);
|
||||
} HASH;
|
||||
|
||||
#define hash_init(A,B,C,D,E,F,G) _hash_init(A,B,C,D,E,F,G CALLER_INFO)
|
||||
my_bool _hash_init(HASH *hash,uint default_array_elements, uint key_offset,
|
||||
uint key_length, hash_get_key get_key,
|
||||
void (*free_element)(void*), uint flags CALLER_INFO_PROTO);
|
||||
void hash_free(HASH *tree);
|
||||
byte *hash_element(HASH *hash,uint idx);
|
||||
gptr hash_search(HASH *info,const byte *key,uint length);
|
||||
gptr hash_next(HASH *info,const byte *key,uint length);
|
||||
my_bool hash_insert(HASH *info,const byte *data);
|
||||
my_bool hash_delete(HASH *hash,byte *record);
|
||||
my_bool hash_update(HASH *hash,byte *record,byte *old_key,uint old_key_length);
|
||||
void hash_replace(HASH *hash, uint idx, byte *new_row);
|
||||
my_bool hash_check(HASH *hash); /* Only in debug library */
|
||||
|
||||
#define hash_clear(H) bzero((char*) (H),sizeof(*(H)))
|
||||
#define hash_inited(H) ((H)->array.buffer != 0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
185
dlls/csx_sql/extra/include/mysql/heap.h
Executable file
185
dlls/csx_sql/extra/include/mysql/heap.h
Executable file
@ -0,0 +1,185 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* This file should be included when using heap_database_funktions */
|
||||
/* Author: Michael Widenius */
|
||||
|
||||
#ifndef _heap_h
|
||||
#define _heap_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _my_base_h
|
||||
#include <my_base.h>
|
||||
#endif
|
||||
#ifdef THREAD
|
||||
#include <my_pthread.h>
|
||||
#include <thr_lock.h>
|
||||
#endif
|
||||
|
||||
/* defines used by heap-funktions */
|
||||
|
||||
#define HP_MAX_LEVELS 4 /* 128^5 records is enough */
|
||||
#define HP_PTRS_IN_NOD 128
|
||||
|
||||
/* struct used with heap_funktions */
|
||||
|
||||
typedef struct st_heapinfo /* Struct from heap_info */
|
||||
{
|
||||
ulong records; /* Records in database */
|
||||
ulong deleted; /* Deleted records in database */
|
||||
ulong max_records;
|
||||
ulong data_length;
|
||||
ulong index_length;
|
||||
uint reclength; /* Length of one record */
|
||||
int errkey;
|
||||
my_bool implicit_emptied;
|
||||
} HEAPINFO;
|
||||
|
||||
|
||||
/* Structs used by heap-database-handler */
|
||||
|
||||
typedef struct st_heap_ptrs
|
||||
{
|
||||
byte *blocks[HP_PTRS_IN_NOD]; /* pointers to HP_PTRS or records */
|
||||
} HP_PTRS;
|
||||
|
||||
struct st_level_info
|
||||
{
|
||||
uint free_ptrs_in_block,records_under_level;
|
||||
HP_PTRS *last_blocks; /* pointers to HP_PTRS or records */
|
||||
};
|
||||
|
||||
typedef struct st_heap_block /* The data is saved in blocks */
|
||||
{
|
||||
HP_PTRS *root;
|
||||
struct st_level_info level_info[HP_MAX_LEVELS+1];
|
||||
uint levels;
|
||||
uint records_in_block; /* Records in a heap-block */
|
||||
uint recbuffer; /* Length of one saved record */
|
||||
ulong last_allocated; /* Blocks allocated, used by keys */
|
||||
} HP_BLOCK;
|
||||
|
||||
typedef struct st_hp_keyseg /* Key-portion */
|
||||
{
|
||||
uint start; /* Start of key in record (from 0) */
|
||||
uint length; /* Keylength */
|
||||
uint type;
|
||||
uint null_bit; /* bit set in row+null_pos */
|
||||
uint null_pos;
|
||||
} HP_KEYSEG;
|
||||
|
||||
typedef struct st_hp_keydef /* Key definition with open */
|
||||
{
|
||||
uint flag; /* HA_NOSAME |<7C>HA_NULL_PART_KEY */
|
||||
uint keysegs; /* Number of key-segment */
|
||||
uint length; /* Length of key (automatic) */
|
||||
HP_KEYSEG *seg;
|
||||
HP_BLOCK block; /* Where keys are saved */
|
||||
} HP_KEYDEF;
|
||||
|
||||
typedef struct st_heap_share
|
||||
{
|
||||
HP_BLOCK block;
|
||||
HP_KEYDEF *keydef;
|
||||
ulong min_records,max_records; /* Params to open */
|
||||
ulong data_length,index_length;
|
||||
uint records; /* records */
|
||||
uint blength;
|
||||
uint deleted; /* Deleted records in database */
|
||||
uint reclength; /* Length of one record */
|
||||
uint changed;
|
||||
uint keys,max_key_length;
|
||||
uint open_count;
|
||||
byte *del_link; /* Link to next block with del. rec */
|
||||
my_string name; /* Name of "memory-file" */
|
||||
#ifdef THREAD
|
||||
THR_LOCK lock;
|
||||
pthread_mutex_t intern_lock; /* Locking for use with _locking */
|
||||
#endif
|
||||
my_bool delete_on_close;
|
||||
LIST open_list;
|
||||
} HP_SHARE;
|
||||
|
||||
struct st_hp_hash_info;
|
||||
|
||||
typedef struct st_heap_info
|
||||
{
|
||||
HP_SHARE *s;
|
||||
byte *current_ptr;
|
||||
struct st_hp_hash_info *current_hash_ptr;
|
||||
ulong current_record,next_block;
|
||||
int lastinx,errkey;
|
||||
int mode; /* Mode of file (READONLY..) */
|
||||
uint opt_flag,update;
|
||||
byte *lastkey; /* Last used key with rkey */
|
||||
my_bool implicit_emptied;
|
||||
#ifdef THREAD
|
||||
THR_LOCK_DATA lock;
|
||||
#endif
|
||||
LIST open_list;
|
||||
} HP_INFO;
|
||||
|
||||
/* Prototypes for heap-functions */
|
||||
|
||||
extern HP_INFO* heap_open(const char *name,int mode,uint keys,
|
||||
HP_KEYDEF *keydef,uint reclength,
|
||||
ulong max_records,ulong min_reloc);
|
||||
extern int heap_close(HP_INFO *info);
|
||||
extern int heap_write(HP_INFO *info,const byte *buff);
|
||||
extern int heap_update(HP_INFO *info,const byte *old,const byte *newdata);
|
||||
extern int heap_rrnd(HP_INFO *info,byte *buf,byte *pos);
|
||||
extern int heap_scan_init(HP_INFO *info);
|
||||
extern int heap_scan(register HP_INFO *info, byte *record);
|
||||
extern int heap_delete(HP_INFO *info,const byte *buff);
|
||||
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
|
||||
extern int heap_create(const char *name);
|
||||
extern int heap_delete_table(const char *name);
|
||||
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
|
||||
extern int heap_rename(const char *old_name,const char *new_name);
|
||||
extern int heap_panic(enum ha_panic_function flag);
|
||||
extern int heap_rsame(HP_INFO *info,byte *record,int inx);
|
||||
extern int heap_rnext(HP_INFO *info,byte *record);
|
||||
extern int heap_rprev(HP_INFO *info,byte *record);
|
||||
extern int heap_rfirst(HP_INFO *info,byte *record);
|
||||
extern int heap_rlast(HP_INFO *info,byte *record);
|
||||
extern void heap_clear(HP_INFO *info);
|
||||
extern int heap_rkey(HP_INFO *info,byte *record,int inx,const byte *key);
|
||||
extern gptr heap_find(HP_INFO *info,int inx,const byte *key);
|
||||
extern int heap_check_heap(HP_INFO *info, my_bool print_status);
|
||||
extern byte *heap_position(HP_INFO *info);
|
||||
|
||||
/* The following is for programs that uses the old HEAP interface where
|
||||
pointer to rows where a long instead of a (byte*).
|
||||
*/
|
||||
|
||||
#if defined(WANT_OLD_HEAP_VERSION) || defined(OLD_HEAP_VERSION)
|
||||
extern int heap_rrnd_old(HP_INFO *info,byte *buf,ulong pos);
|
||||
extern ulong heap_position_old(HP_INFO *info);
|
||||
#endif
|
||||
#ifdef OLD_HEAP_VERSION
|
||||
typedef ulong HEAP_PTR;
|
||||
#define heap_position(A) heap_position_old(A)
|
||||
#define heap_rrnd(A,B,C) heap_rrnd_old(A,B,C)
|
||||
#else
|
||||
typedef byte *HEAP_PTR;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
172
dlls/csx_sql/extra/include/mysql/m_ctype.h
Executable file
172
dlls/csx_sql/extra/include/mysql/m_ctype.h
Executable file
@ -0,0 +1,172 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
A better inplementation of the UNIX ctype(3) library.
|
||||
Notes: my_global.h should be included before ctype.h
|
||||
*/
|
||||
|
||||
#ifndef _m_ctype_h
|
||||
#define _m_ctype_h
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CHARSET_DIR "charsets/"
|
||||
|
||||
typedef struct charset_info_st
|
||||
{
|
||||
uint number;
|
||||
const char *name;
|
||||
uchar *ctype;
|
||||
uchar *to_lower;
|
||||
uchar *to_upper;
|
||||
uchar *sort_order;
|
||||
|
||||
uint strxfrm_multiply;
|
||||
int (*strcoll)(const uchar *, const uchar *);
|
||||
int (*strxfrm)(uchar *, const uchar *, int);
|
||||
int (*strnncoll)(const uchar *, int, const uchar *, int);
|
||||
int (*strnxfrm)(uchar *, const uchar *, int, int);
|
||||
my_bool (*like_range)(const char *, uint, pchar, uint,
|
||||
char *, char *, uint *, uint *);
|
||||
|
||||
uint mbmaxlen;
|
||||
int (*ismbchar)(const char *, const char *);
|
||||
my_bool (*ismbhead)(uint);
|
||||
int (*mbcharlen)(uint);
|
||||
} CHARSET_INFO;
|
||||
|
||||
/* strings/ctype.c */
|
||||
extern CHARSET_INFO *default_charset_info;
|
||||
extern CHARSET_INFO *find_compiled_charset(uint cs_number);
|
||||
extern CHARSET_INFO *find_compiled_charset_by_name(const char *name);
|
||||
extern CHARSET_INFO compiled_charsets[];
|
||||
extern uint compiled_charset_number(const char *name);
|
||||
extern const char *compiled_charset_name(uint charset_number);
|
||||
|
||||
#define MY_CHARSET_UNDEFINED 0
|
||||
#define MY_CHARSET_CURRENT (default_charset_info->number)
|
||||
|
||||
/* Don't include std ctype.h when this is included */
|
||||
#define _CTYPE_H
|
||||
#define _CTYPE_H_
|
||||
#define _CTYPE_INCLUDED
|
||||
#define __CTYPE_INCLUDED
|
||||
#define _CTYPE_USING /* Don't put names in global namespace. */
|
||||
|
||||
/* Fix things, if ctype.h would have been included before */
|
||||
#undef toupper
|
||||
#undef _toupper
|
||||
#undef _tolower
|
||||
#undef toupper
|
||||
#undef tolower
|
||||
#undef isalpha
|
||||
#undef isupper
|
||||
#undef islower
|
||||
#undef isdigit
|
||||
#undef isxdigit
|
||||
#undef isalnum
|
||||
#undef isspace
|
||||
#undef ispunct
|
||||
#undef isprint
|
||||
#undef isgraph
|
||||
#undef iscntrl
|
||||
#undef isascii
|
||||
#undef toascii
|
||||
|
||||
#define _U 01 /* Upper case */
|
||||
#define _L 02 /* Lower case */
|
||||
#define _NMR 04 /* Numeral (digit) */
|
||||
#define _SPC 010 /* Spacing character */
|
||||
#define _PNT 020 /* Punctuation */
|
||||
#define _CTR 040 /* Control character */
|
||||
#define _B 0100 /* Blank */
|
||||
#define _X 0200 /* heXadecimal digit */
|
||||
|
||||
#define my_ctype (default_charset_info->ctype)
|
||||
#define my_to_upper (default_charset_info->to_upper)
|
||||
#define my_to_lower (default_charset_info->to_lower)
|
||||
#define my_sort_order (default_charset_info->sort_order)
|
||||
|
||||
#define _toupper(c) (char) my_to_upper[(uchar) (c)]
|
||||
#define _tolower(c) (char) my_to_lower[(uchar) (c)]
|
||||
#define toupper(c) (char) my_to_upper[(uchar) (c)]
|
||||
#define tolower(c) (char) my_to_lower[(uchar) (c)]
|
||||
|
||||
#define isalpha(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L))
|
||||
#define isupper(c) ((my_ctype+1)[(uchar) (c)] & _U)
|
||||
#define islower(c) ((my_ctype+1)[(uchar) (c)] & _L)
|
||||
#define isdigit(c) ((my_ctype+1)[(uchar) (c)] & _NMR)
|
||||
#define isxdigit(c) ((my_ctype+1)[(uchar) (c)] & _X)
|
||||
#define isalnum(c) ((my_ctype+1)[(uchar) (c)] & (_U | _L | _NMR))
|
||||
#define isspace(c) ((my_ctype+1)[(uchar) (c)] & _SPC)
|
||||
#define ispunct(c) ((my_ctype+1)[(uchar) (c)] & _PNT)
|
||||
#define isprint(c) ((my_ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B))
|
||||
#define isgraph(c) ((my_ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR))
|
||||
#define iscntrl(c) ((my_ctype+1)[(uchar) (c)] & _CTR)
|
||||
#define isascii(c) (!((c) & ~0177))
|
||||
#define toascii(c) ((c) & 0177)
|
||||
|
||||
#ifdef ctype
|
||||
#undef ctype
|
||||
#endif /* ctype */
|
||||
|
||||
#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L))
|
||||
#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _U)
|
||||
#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _L)
|
||||
#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _NMR)
|
||||
#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _X)
|
||||
#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _NMR))
|
||||
#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _SPC)
|
||||
#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _PNT)
|
||||
#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B))
|
||||
#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR))
|
||||
#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _CTR)
|
||||
|
||||
#define use_strcoll(s) ((s)->strcoll != NULL)
|
||||
#define MY_STRXFRM_MULTIPLY (default_charset_info->strxfrm_multiply)
|
||||
#define my_strnxfrm(s, a, b, c, d) ((s)->strnxfrm((a), (b), (c), (d)))
|
||||
#define my_strnncoll(s, a, b, c, d) ((s)->strnncoll((a), (b), (c), (d)))
|
||||
#define my_strcoll(s, a, b) ((s)->strcoll((a), (b)))
|
||||
#define my_like_range(s, a, b, c, d, e, f, g, h) \
|
||||
((s)->like_range((a), (b), (c), (d), (e), (f), (g), (h)))
|
||||
|
||||
#define use_mb(s) ((s)->ismbchar != NULL)
|
||||
#define MBMAXLEN (default_charset_info->mbmaxlen)
|
||||
#define my_ismbchar(s, a, b) ((s)->ismbchar((a), (b)))
|
||||
#define my_ismbhead(s, a) ((s)->ismbhead((a)))
|
||||
#define my_mbcharlen(s, a) ((s)->mbcharlen((a)))
|
||||
|
||||
/* Some macros that should be cleaned up a little */
|
||||
#define isvar(c) (isalnum(c) || (c) == '_')
|
||||
#define isvar_start(c) (isalpha(c) || (c) == '_')
|
||||
#define tocntrl(c) ((c) & 31)
|
||||
#define toprint(c) ((c) | 64)
|
||||
|
||||
/* XXX: still need to take care of this one */
|
||||
#ifdef MY_CHARSET_TIS620
|
||||
#error The TIS620 charset is broken at the moment. Tell tim to fix it.
|
||||
#define USE_TIS620
|
||||
#include "t_ctype.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _m_ctype_h */
|
254
dlls/csx_sql/extra/include/mysql/m_string.h
Executable file
254
dlls/csx_sql/extra/include/mysql/m_string.h
Executable file
@ -0,0 +1,254 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* There may be prolems include all of theese. Try to test in
|
||||
configure with ones are needed? */
|
||||
|
||||
/* This is needed for the definitions of strchr... on solaris */
|
||||
|
||||
#ifndef _m_string_h
|
||||
#define _m_string_h
|
||||
#ifndef __USE_GNU
|
||||
#define __USE_GNU /* We want to use stpcpy */
|
||||
#endif
|
||||
#if defined(HAVE_STRINGS_H)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#if defined(HAVE_STRING_H)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Correct some things for UNIXWARE7 */
|
||||
#ifdef HAVE_UNIXWARE7_THREADS
|
||||
#undef HAVE_STRINGS_H
|
||||
#undef HAVE_MEMORY_H
|
||||
#define HAVE_MEMCPY
|
||||
#ifndef HAVE_MEMMOVE
|
||||
#define HAVE_MEMMOVE
|
||||
#endif
|
||||
#undef HAVE_BCMP
|
||||
#undef bcopy
|
||||
#undef bcmp
|
||||
#undef bzero
|
||||
#endif /* HAVE_UNIXWARE7_THREADS */
|
||||
#ifdef _AIX
|
||||
#undef HAVE_BCMP
|
||||
#endif
|
||||
|
||||
/* This is needed for the definitions of bzero... on solaris */
|
||||
#if defined(HAVE_STRINGS_H) && !defined(HAVE_mit_thread)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
/* This is needed for the definitions of memcpy... on solaris */
|
||||
#if defined(HAVE_MEMORY_H) && !defined(__cplusplus)
|
||||
#include <memory.h>
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_MEMCPY) && !defined(HAVE_MEMMOVE)
|
||||
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
||||
# define memset(A,C,B) bfill((A),(B),(C))
|
||||
# define memmove(d, s, n) bmove ((d), (s), (n))
|
||||
#elif defined(HAVE_MEMMOVE)
|
||||
# define bmove(d, s, n) memmove((d), (s), (n))
|
||||
#else
|
||||
# define memmove(d, s, n) bmove((d), (s), (n)) /* our bmove */
|
||||
#endif
|
||||
|
||||
/* Unixware 7 */
|
||||
#if !defined(HAVE_BFILL)
|
||||
# define bfill(A,B,C) memset((A),(C),(B))
|
||||
# define bmove_allign(A,B,C) memcpy((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_BCMP)
|
||||
# define bcopy(s, d, n) memcpy((d), (s), (n))
|
||||
# define bcmp(A,B,C) memcmp((A),(B),(C))
|
||||
# define bzero(A,B) memset((A),0,(B))
|
||||
# define bmove_allign(A,B,C) memcpy((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(OS2)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_STPCPY) && !defined(HAVE_mit_thread)
|
||||
#define strmov(A,B) stpcpy((A),(B))
|
||||
#ifndef stpcpy
|
||||
extern char *stpcpy(char *, const char *); /* For AIX with gcc 2.95.3 */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern char NEAR _dig_vec[]; /* Declared in int2str() */
|
||||
|
||||
#ifdef BAD_STRING_COMPILER
|
||||
#define strmov(A,B) (memccpy(A,B,0,INT_MAX)-1)
|
||||
#else
|
||||
#define strmov_overlapp(A,B) strmov(A,B)
|
||||
#define strmake_overlapp(A,B,C) strmake(A,B,C)
|
||||
#endif
|
||||
|
||||
#ifdef BAD_MEMCPY /* Problem with gcc on Alpha */
|
||||
#define memcpy_fixed(A,B,C) bmove((A),(B),(C))
|
||||
#else
|
||||
#define memcpy_fixed(A,B,C) memcpy((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#ifdef MSDOS
|
||||
#undef bmove_allign
|
||||
#define bmove512(A,B,C) bmove_allign(A,B,C)
|
||||
#define my_itoa(A,B,C) itoa(A,B,C)
|
||||
#define my_ltoa(A,B,C) ltoa(A,B,C)
|
||||
extern void bmove_allign(gptr dst,const gptr src,uint len);
|
||||
#endif
|
||||
|
||||
#if (!defined(USE_BMOVE512) || defined(HAVE_purify)) && !defined(bmove512)
|
||||
#define bmove512(A,B,C) memcpy(A,B,C)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_purify
|
||||
#include <assert.h>
|
||||
#define memcpy_overlap(A,B,C) \
|
||||
DBUG_ASSERT((A) == (B) || ((A)+(C)) <= (B) || ((B)+(C)) <= (A)); \
|
||||
bmove((byte*) key,(byte*) from,(size_t) length);
|
||||
#else
|
||||
#define memcpy_overlap(A,B,C) memcpy((A), (B), (C))
|
||||
#endif /* HAVE_purify */
|
||||
|
||||
|
||||
/* Prototypes for string functions */
|
||||
|
||||
#if !defined(bfill) && !defined(HAVE_BFILL)
|
||||
extern void bfill(gptr dst,uint len,pchar fill);
|
||||
#endif
|
||||
|
||||
#if !defined(bzero) && !defined(HAVE_BZERO)
|
||||
extern void bzero(gptr dst,uint len);
|
||||
#endif
|
||||
|
||||
#if !defined(bcmp) && !defined(HAVE_BCMP)
|
||||
extern int bcmp(const char *s1,const char *s2,uint len);
|
||||
#endif
|
||||
#ifdef HAVE_purify
|
||||
extern int my_bcmp(const char *s1,const char *s2,uint len);
|
||||
#undef bcmp
|
||||
#define bcmp(A,B,C) my_bcmp((A),(B),(C))
|
||||
#endif
|
||||
|
||||
#ifndef bmove512
|
||||
extern void bmove512(gptr dst,const gptr src,uint len);
|
||||
#endif
|
||||
|
||||
#if !defined(HAVE_BMOVE) && !defined(bmove)
|
||||
extern void bmove(char *dst, const char *src,uint len);
|
||||
#endif
|
||||
|
||||
extern void bmove_upp(char *dst,const char *src,uint len);
|
||||
extern void bchange(char *dst,uint old_len,const char *src,
|
||||
uint new_len,uint tot_len);
|
||||
extern void strappend(char *s,uint len,pchar fill);
|
||||
extern char *strend(const char *s);
|
||||
extern char *strcend(const char *, pchar);
|
||||
extern char *strfield(char *src,int fields,int chars,int blanks,
|
||||
int tabch);
|
||||
extern char *strfill(my_string s,uint len,pchar fill);
|
||||
extern uint strinstr(const char *str,const char *search);
|
||||
extern uint r_strinstr(reg1 my_string str,int from, reg4 my_string search);
|
||||
extern char *strkey(char *dst,char *head,char *tail,char *flags);
|
||||
extern char *strmake(char *dst,const char *src,uint length);
|
||||
#ifndef strmake_overlapp
|
||||
extern char *strmake_overlapp(char *dst,const char *src, uint length);
|
||||
#endif
|
||||
|
||||
#ifndef strmov
|
||||
extern char *strmov(char *dst,const char *src);
|
||||
#endif
|
||||
extern char *strnmov(char *dst,const char *src,uint n);
|
||||
extern char *strsuff(const char *src,const char *suffix);
|
||||
extern char *strcont(const char *src,const char *set);
|
||||
extern char *strxcat _VARARGS((char *dst,const char *src, ...));
|
||||
extern char *strxmov _VARARGS((char *dst,const char *src, ...));
|
||||
extern char *strxcpy _VARARGS((char *dst,const char *src, ...));
|
||||
extern char *strxncat _VARARGS((char *dst,uint len, const char *src, ...));
|
||||
extern char *strxnmov _VARARGS((char *dst,uint len, const char *src, ...));
|
||||
extern char *strxncpy _VARARGS((char *dst,uint len, const char *src, ...));
|
||||
|
||||
/* Prototypes of normal stringfunctions (with may ours) */
|
||||
|
||||
#ifdef WANT_STRING_PROTOTYPES
|
||||
extern char *strcat(char *, const char *);
|
||||
extern char *strchr(const char *, pchar);
|
||||
extern char *strrchr(const char *, pchar);
|
||||
extern char *strcpy(char *, const char *);
|
||||
extern int strcmp(const char *, const char *);
|
||||
#ifndef __GNUC__
|
||||
extern size_t strlen(const char *);
|
||||
#endif
|
||||
#endif
|
||||
#ifndef HAVE_STRNLEN
|
||||
extern uint strnlen(const char *s, uint n);
|
||||
#endif
|
||||
|
||||
#if !defined(__cplusplus)
|
||||
#ifndef HAVE_STRPBRK
|
||||
extern char *strpbrk(const char *, const char *);
|
||||
#endif
|
||||
#ifndef HAVE_STRSTR
|
||||
extern char *strstr(const char *, const char *);
|
||||
#endif
|
||||
#endif
|
||||
extern int is_prefix(const char *, const char *);
|
||||
|
||||
/* Conversion rutins */
|
||||
|
||||
#ifdef USE_MY_ITOA
|
||||
extern char *my_itoa(int val,char *dst,int radix);
|
||||
extern char *my_ltoa(long val,char *dst,int radix);
|
||||
#endif
|
||||
|
||||
extern char *llstr(longlong value,char *buff);
|
||||
#ifndef HAVE_STRTOUL
|
||||
extern long strtol(const char *str, char **ptr, int base);
|
||||
extern ulong strtoul(const char *str, char **ptr, int base);
|
||||
#endif
|
||||
|
||||
extern char *int2str(long val,char *dst,int radix);
|
||||
extern char *int10_to_str(long val,char *dst,int radix);
|
||||
extern char *str2int(const char *src,int radix,long lower,long upper,
|
||||
long *val);
|
||||
#if SIZEOF_LONG == SIZEOF_LONG_LONG
|
||||
#define longlong2str(A,B,C) int2str((A),(B),(C))
|
||||
#define longlong10_to_str(A,B,C) int10_to_str((A),(B),(C))
|
||||
#define strtoll(A,B,C) strtol((A),(B),(C))
|
||||
#define strtoull(A,B,C) strtoul((A),(B),(C))
|
||||
#ifndef HAVE_STRTOULL
|
||||
#define HAVE_STRTOULL
|
||||
#endif
|
||||
#else
|
||||
#ifdef HAVE_LONG_LONG
|
||||
extern char *longlong2str(longlong val,char *dst,int radix);
|
||||
extern char *longlong10_to_str(longlong val,char *dst,int radix);
|
||||
#if (!defined(HAVE_STRTOULL) || defined(HAVE_mit_thread)) || defined(NO_STRTOLL_PROTO)
|
||||
extern longlong strtoll(const char *str, char **ptr, int base);
|
||||
extern ulonglong strtoull(const char *str, char **ptr, int base);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && !defined(OS2)
|
||||
}
|
||||
#endif
|
||||
#endif
|
93
dlls/csx_sql/extra/include/mysql/md5.h
Executable file
93
dlls/csx_sql/extra/include/mysql/md5.h
Executable file
@ -0,0 +1,93 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
|
||||
/* MD5.H - header file for MD5C.C
|
||||
*/
|
||||
|
||||
/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
|
||||
rights reserved.
|
||||
|
||||
License to copy and use this software is granted provided that it
|
||||
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
|
||||
Algorithm" in all material mentioning or referencing this software
|
||||
or this function.
|
||||
|
||||
License is also granted to make and use derivative works provided
|
||||
that such works are identified as "derived from the RSA Data
|
||||
Security, Inc. MD5 Message-Digest Algorithm" in all material
|
||||
mentioning or referencing the derived work.
|
||||
|
||||
RSA Data Security, Inc. makes no representations concerning either
|
||||
the merchantability of this software or the suitability of this
|
||||
software for any particular purpose. It is provided "as is"
|
||||
without express or implied warranty of any kind.
|
||||
|
||||
These notices must be retained in any copies of any part of this
|
||||
documentation and/or software.
|
||||
*/
|
||||
|
||||
/* GLOBAL.H - RSAREF types and constants
|
||||
*/
|
||||
|
||||
/* PROTOTYPES should be set to one if and only if the compiler supports
|
||||
function argument prototyping.
|
||||
The following makes PROTOTYPES default to 0 if it has not already
|
||||
been defined with C compiler flags.
|
||||
*/
|
||||
|
||||
/* egcs 1.1.2 under linux didn't defined it.... :( */
|
||||
|
||||
#ifndef PROTOTYPES
|
||||
#define PROTOTYPES 1 /* Assume prototypes */
|
||||
#endif
|
||||
|
||||
/* POINTER defines a generic pointer type */
|
||||
typedef unsigned char *POINTER;
|
||||
|
||||
/* UINT2 defines a two byte word */
|
||||
typedef uint16 UINT2; /* Fix for MySQL / Alpha */
|
||||
|
||||
/* UINT4 defines a four byte word */
|
||||
typedef uint32 UINT4; /* Fix for MySQL / Alpha */
|
||||
|
||||
/* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
|
||||
If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
|
||||
returns an empty list.
|
||||
*/
|
||||
#if PROTOTYPES
|
||||
#define PROTO_LIST(list) list
|
||||
#else
|
||||
#define PROTO_LIST(list) ()
|
||||
#endif
|
||||
/* MD5 context. */
|
||||
typedef struct {
|
||||
UINT4 state[4]; /* state (ABCD) */
|
||||
UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
unsigned char buffer[64]; /* input buffer */
|
||||
} my_MD5_CTX;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void my_MD5Init PROTO_LIST ((my_MD5_CTX *));
|
||||
void my_MD5Update PROTO_LIST
|
||||
((my_MD5_CTX *, unsigned char *, unsigned int));
|
||||
void my_MD5Final PROTO_LIST ((unsigned char [16], my_MD5_CTX *));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
93
dlls/csx_sql/extra/include/mysql/merge.h
Executable file
93
dlls/csx_sql/extra/include/mysql/merge.h
Executable file
@ -0,0 +1,93 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* This file should be included when using merge_isam_funktions */
|
||||
/* Author: Michael Widenius */
|
||||
|
||||
#ifndef _merge_h
|
||||
#define _merge_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef _my_base_h
|
||||
#include <my_base.h>
|
||||
#endif
|
||||
#ifndef _nisam_h
|
||||
#include <nisam.h>
|
||||
#endif
|
||||
|
||||
#define MRG_NAME_EXT ".MRG"
|
||||
|
||||
/* Param to/from mrg_info */
|
||||
|
||||
typedef struct st_mrg_info /* Struct from h_info */
|
||||
{
|
||||
ulonglong records; /* Records in database */
|
||||
ulonglong deleted; /* Deleted records in database */
|
||||
ulonglong recpos; /* Pos for last used record */
|
||||
ulonglong data_file_length;
|
||||
uint reclength; /* Recordlength */
|
||||
int errkey; /* With key was dupplicated on err */
|
||||
uint options; /* HA_OPTION_... used */
|
||||
} MERGE_INFO;
|
||||
|
||||
typedef struct st_mrg_table_info
|
||||
{
|
||||
N_INFO *table;
|
||||
ulonglong file_offset;
|
||||
} MRG_TABLE;
|
||||
|
||||
typedef struct st_merge
|
||||
{
|
||||
MRG_TABLE *open_tables,*current_table,*end_table,*last_used_table;
|
||||
ulonglong records; /* records in tables */
|
||||
ulonglong del; /* Removed records */
|
||||
ulonglong data_file_length;
|
||||
uint tables,options,reclength;
|
||||
my_bool cache_in_use;
|
||||
LIST open_list;
|
||||
} MRG_INFO;
|
||||
|
||||
typedef ulong mrg_off_t;
|
||||
|
||||
/* Prototypes for merge-functions */
|
||||
|
||||
extern int mrg_close(MRG_INFO *file);
|
||||
extern int mrg_delete(MRG_INFO *file,const byte *buff);
|
||||
extern MRG_INFO *mrg_open(const char *name,int mode,int wait_if_locked);
|
||||
extern int mrg_panic(enum ha_panic_function function);
|
||||
extern int mrg_rfirst(MRG_INFO *file,byte *buf,int inx);
|
||||
extern int mrg_rkey(MRG_INFO *file,byte *buf,int inx,const byte *key,
|
||||
uint key_len, enum ha_rkey_function search_flag);
|
||||
extern int mrg_rrnd(MRG_INFO *file,byte *buf, mrg_off_t pos);
|
||||
extern int mrg_rsame(MRG_INFO *file,byte *record,int inx);
|
||||
extern int mrg_update(MRG_INFO *file,const byte *old,const byte *new_rec);
|
||||
extern int mrg_info(MRG_INFO *file,MERGE_INFO *x,int flag);
|
||||
extern int mrg_lock_database(MRG_INFO *file,int lock_type);
|
||||
extern int mrg_create(const char *name,const char **table_names);
|
||||
extern int mrg_extra(MRG_INFO *file,enum ha_extra_function function);
|
||||
extern ha_rows mrg_records_in_range(MRG_INFO *info,int inx,
|
||||
const byte *start_key,uint start_key_len,
|
||||
enum ha_rkey_function start_search_flag,
|
||||
const byte *end_key,uint end_key_len,
|
||||
enum ha_rkey_function end_search_flag);
|
||||
|
||||
extern mrg_off_t mrg_position(MRG_INFO *info);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
66
dlls/csx_sql/extra/include/mysql/my_aes.h
Executable file
66
dlls/csx_sql/extra/include/mysql/my_aes.h
Executable file
@ -0,0 +1,66 @@
|
||||
/* Copyright (C) 2002 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
|
||||
/* Header file for my_aes.c */
|
||||
/* Wrapper to give simple interface for MySQL to AES standard encryption */
|
||||
|
||||
#include "rijndael.h"
|
||||
|
||||
C_MODE_START
|
||||
|
||||
#define AES_KEY_LENGTH 128 /* Must be 128 192 or 256 */
|
||||
|
||||
/*
|
||||
my_aes_encrypt - Crypt buffer with AES encryption algorithm.
|
||||
source - Pointer to data for encryption
|
||||
source_length - size of encryption data
|
||||
dest - buffer to place encrypted data (must be large enough)
|
||||
key - Key to be used for encryption
|
||||
kel_length - Length of the key. Will handle keys of any length
|
||||
|
||||
returns - size of encrypted data, or negative in case of error.
|
||||
*/
|
||||
|
||||
int my_aes_encrypt(const char *source, int source_length, char *dest,
|
||||
const char *key, int key_length);
|
||||
|
||||
/*
|
||||
my_aes_decrypt - DeCrypt buffer with AES encryption algorithm.
|
||||
source - Pointer to data for decryption
|
||||
source_length - size of encrypted data
|
||||
dest - buffer to place decrypted data (must be large enough)
|
||||
key - Key to be used for decryption
|
||||
kel_length - Length of the key. Will handle keys of any length
|
||||
|
||||
returns - size of original data, or negative in case of error.
|
||||
*/
|
||||
|
||||
|
||||
int my_aes_decrypt(const char *source, int source_length, char *dest,
|
||||
const char *key, int key_length);
|
||||
|
||||
/*
|
||||
my_aes_get_size - get size of buffer which will be large enough for encrypted
|
||||
data
|
||||
source_length - length of data to be encrypted
|
||||
|
||||
returns - size of buffer required to store encrypted data
|
||||
*/
|
||||
|
||||
int my_aes_get_size(int source_length);
|
||||
|
||||
C_MODE_END
|
59
dlls/csx_sql/extra/include/mysql/my_alarm.h
Executable file
59
dlls/csx_sql/extra/include/mysql/my_alarm.h
Executable file
@ -0,0 +1,59 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
File to include when we want to use alarm or a loop_counter to display
|
||||
some information when a program is running
|
||||
*/
|
||||
#ifndef _my_alarm_h
|
||||
#define _my_alarm_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int volatile my_have_got_alarm;
|
||||
extern ulong my_time_to_wait_for_lock;
|
||||
|
||||
#if defined(HAVE_ALARM) && !defined(NO_ALARM_LOOP)
|
||||
#include <signal.h>
|
||||
#define ALARM_VARIABLES uint alarm_old=0; \
|
||||
sig_return alarm_signal=0
|
||||
#define ALARM_INIT my_have_got_alarm=0 ; \
|
||||
alarm_old=(uint) alarm(MY_HOW_OFTEN_TO_ALARM); \
|
||||
alarm_signal=signal(SIGALRM,my_set_alarm_variable);
|
||||
#define ALARM_END VOID(signal(SIGALRM,alarm_signal)); \
|
||||
VOID(alarm(alarm_old));
|
||||
#define ALARM_TEST my_have_got_alarm
|
||||
#ifdef DONT_REMEMBER_SIGNAL
|
||||
#define ALARM_REINIT VOID(alarm(MY_HOW_OFTEN_TO_ALARM)); \
|
||||
VOID(signal(SIGALRM,my_set_alarm_variable));\
|
||||
my_have_got_alarm=0;
|
||||
#else
|
||||
#define ALARM_REINIT VOID(alarm((uint) MY_HOW_OFTEN_TO_ALARM)); \
|
||||
my_have_got_alarm=0;
|
||||
#endif /* DONT_REMEMBER_SIGNAL */
|
||||
#else
|
||||
#define ALARM_VARIABLES long alarm_pos=0,alarm_end_pos=MY_HOW_OFTEN_TO_WRITE-1
|
||||
#define ALARM_INIT
|
||||
#define ALARM_END
|
||||
#define ALARM_TEST (alarm_pos++ >= alarm_end_pos)
|
||||
#define ALARM_REINIT alarm_end_pos+=MY_HOW_OFTEN_TO_WRITE
|
||||
#endif /* HAVE_ALARM */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
52
dlls/csx_sql/extra/include/mysql/my_alloc.h
Executable file
52
dlls/csx_sql/extra/include/mysql/my_alloc.h
Executable file
@ -0,0 +1,52 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/*
|
||||
Data structures for mysys/my_alloc.c (root memory allocator)
|
||||
*/
|
||||
|
||||
#ifndef _my_alloc_h
|
||||
#define _my_alloc_h
|
||||
|
||||
#define ALLOC_MAX_BLOCK_TO_DROP 4096
|
||||
#define ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP 10
|
||||
|
||||
typedef struct st_used_mem
|
||||
{ /* struct for once_alloc (block) */
|
||||
struct st_used_mem *next; /* Next block in use */
|
||||
unsigned int left; /* memory left in block */
|
||||
unsigned int size; /* size of block */
|
||||
} USED_MEM;
|
||||
|
||||
|
||||
typedef struct st_mem_root
|
||||
{
|
||||
USED_MEM *free; /* blocks with free memory in it */
|
||||
USED_MEM *used; /* blocks almost without free memory */
|
||||
USED_MEM *pre_alloc; /* preallocated block */
|
||||
/* if block have less memory it will be put in 'used' list */
|
||||
unsigned int min_malloc;
|
||||
unsigned int block_size; /* initial block size */
|
||||
unsigned int block_num; /* allocated blocks counter */
|
||||
/*
|
||||
first free block in queue test counter (if it exceed
|
||||
MAX_BLOCK_USAGE_BEFORE_DROP block will be droped in 'used' list)
|
||||
*/
|
||||
unsigned int first_block_usage;
|
||||
|
||||
void (*error_handler)(void);
|
||||
} MEM_ROOT;
|
||||
#endif
|
342
dlls/csx_sql/extra/include/mysql/my_base.h
Executable file
342
dlls/csx_sql/extra/include/mysql/my_base.h
Executable file
@ -0,0 +1,342 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
/* This file includes constants used with all databases */
|
||||
/* Author: Michael Widenius */
|
||||
|
||||
#ifndef _my_base_h
|
||||
#define _my_base_h
|
||||
|
||||
#ifndef stdin /* Included first in handler */
|
||||
#define USES_TYPES /* my_dir with sys/types is included */
|
||||
#define CHSIZE_USED
|
||||
#include <my_global.h>
|
||||
#include <my_dir.h> /* This includes types */
|
||||
#include <my_sys.h>
|
||||
#include <m_string.h>
|
||||
#include <errno.h>
|
||||
#ifdef MSDOS
|
||||
#include <share.h> /* Neaded for sopen() */
|
||||
#endif
|
||||
#if !defined(USE_MY_FUNC) && !defined(THREAD)
|
||||
#include <my_nosys.h> /* For faster code, after test */
|
||||
#endif /* USE_MY_FUNC */
|
||||
#endif /* stdin */
|
||||
#include <my_list.h>
|
||||
|
||||
/* The following is bits in the flag parameter to ha_open() */
|
||||
|
||||
#define HA_OPEN_ABORT_IF_LOCKED 0 /* default */
|
||||
#define HA_OPEN_WAIT_IF_LOCKED 1
|
||||
#define HA_OPEN_IGNORE_IF_LOCKED 2
|
||||
#define HA_OPEN_TMP_TABLE 4 /* Table is a temp table */
|
||||
#define HA_OPEN_DELAY_KEY_WRITE 8 /* Don't update index */
|
||||
#define HA_OPEN_ABORT_IF_CRASHED 16
|
||||
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
|
||||
|
||||
/* The following is parameter to ha_rkey() how to use key */
|
||||
|
||||
/* We define a complete-field prefix of a key value as a prefix where the
|
||||
last included field in the prefix contains the full field, not just some bytes
|
||||
from the start of the field. A partial-field prefix is allowed to
|
||||
contain only a few first bytes from the last included field.
|
||||
|
||||
Below HA_READ_KEY_EXACT, ..., HA_READ_BEFORE_KEY can take a
|
||||
complete-field prefix of a key value as the search key. HA_READ_PREFIX
|
||||
and HA_READ_PREFIX_LAST could also take a partial-field prefix, but
|
||||
currently (4.0.10) they are only used with complete-field prefixes. MySQL uses
|
||||
a padding trick to implement LIKE 'abc%' queries.
|
||||
|
||||
NOTE that in InnoDB HA_READ_PREFIX_LAST will NOT work with a partial-field
|
||||
prefix because InnoDB currently strips spaces from the end of varchar
|
||||
fields! */
|
||||
|
||||
enum ha_rkey_function {
|
||||
HA_READ_KEY_EXACT, /* Find first record else error */
|
||||
HA_READ_KEY_OR_NEXT, /* Record or next record */
|
||||
HA_READ_KEY_OR_PREV, /* Record or previous */
|
||||
HA_READ_AFTER_KEY, /* Find next rec. after key-record */
|
||||
HA_READ_BEFORE_KEY, /* Find next rec. before key-record */
|
||||
HA_READ_PREFIX, /* Key which as same prefix */
|
||||
HA_READ_PREFIX_LAST, /* Last key with the same prefix */
|
||||
HA_READ_MBR_CONTAIN,
|
||||
HA_READ_MBR_INTERSECT,
|
||||
HA_READ_MBR_WITHIN,
|
||||
HA_READ_MBR_DISJOINT,
|
||||
HA_READ_MBR_EQUAL
|
||||
};
|
||||
|
||||
/* Key algorithm types */
|
||||
|
||||
enum ha_key_alg {
|
||||
HA_KEY_ALG_UNDEF= 0, /* Not specified (old file) */
|
||||
HA_KEY_ALG_BTREE= 1, /* B-tree, default one */
|
||||
HA_KEY_ALG_RTREE= 2, /* R-tree, for spatial searches */
|
||||
HA_KEY_ALG_HASH= 3, /* HASH keys (HEAP tables) */
|
||||
HA_KEY_ALG_FULLTEXT= 4 /* FULLTEXT (MyISAM tables) */
|
||||
};
|
||||
|
||||
/* The following is parameter to ha_extra() */
|
||||
|
||||
enum ha_extra_function {
|
||||
HA_EXTRA_NORMAL=0, /* Optimize for space (def) */
|
||||
HA_EXTRA_QUICK=1, /* Optimize for speed */
|
||||
HA_EXTRA_RESET=2, /* Reset database to after open */
|
||||
HA_EXTRA_CACHE=3, /* Cash record in HA_rrnd() */
|
||||
HA_EXTRA_NO_CACHE=4, /* End cacheing of records (def) */
|
||||
HA_EXTRA_NO_READCHECK=5, /* No readcheck on update */
|
||||
HA_EXTRA_READCHECK=6, /* Use readcheck (def) */
|
||||
HA_EXTRA_KEYREAD=7, /* Read only key to database */
|
||||
HA_EXTRA_NO_KEYREAD=8, /* Normal read of records (def) */
|
||||
HA_EXTRA_NO_USER_CHANGE=9, /* No user is allowed to write */
|
||||
HA_EXTRA_KEY_CACHE=10,
|
||||
HA_EXTRA_NO_KEY_CACHE=11,
|
||||
HA_EXTRA_WAIT_LOCK=12, /* Wait until file is avalably (def) */
|
||||
HA_EXTRA_NO_WAIT_LOCK=13, /* If file is locked, return quickly */
|
||||
HA_EXTRA_WRITE_CACHE=14, /* Use write cache in ha_write() */
|
||||
HA_EXTRA_FLUSH_CACHE=15, /* flush write_record_cache */
|
||||
HA_EXTRA_NO_KEYS=16, /* Remove all update of keys */
|
||||
HA_EXTRA_KEYREAD_CHANGE_POS=17, /* Keyread, but change pos */
|
||||
/* xxxxchk -r must be used */
|
||||
HA_EXTRA_REMEMBER_POS=18, /* Remember pos for next/prev */
|
||||
HA_EXTRA_RESTORE_POS=19,
|
||||
HA_EXTRA_REINIT_CACHE=20, /* init cache from current record */
|
||||
HA_EXTRA_FORCE_REOPEN=21, /* Datafile have changed on disk */
|
||||
HA_EXTRA_FLUSH, /* Flush tables to disk */
|
||||
HA_EXTRA_NO_ROWS, /* Don't write rows */
|
||||
HA_EXTRA_RESET_STATE, /* Reset positions */
|
||||
HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/
|
||||
HA_EXTRA_NO_IGNORE_DUP_KEY,
|
||||
HA_EXTRA_DONT_USE_CURSOR_TO_UPDATE, /* Cursor will not be used for update */
|
||||
HA_EXTRA_PREPARE_FOR_DELETE,
|
||||
HA_EXTRA_PREPARE_FOR_UPDATE /* Remove read cache if problems */
|
||||
};
|
||||
|
||||
/* The following is parameter to ha_panic() */
|
||||
|
||||
enum ha_panic_function {
|
||||
HA_PANIC_CLOSE, /* Close all databases */
|
||||
HA_PANIC_WRITE, /* Unlock and write status */
|
||||
HA_PANIC_READ /* Lock and read keyinfo */
|
||||
};
|
||||
|
||||
/* The following is parameter to ha_create(); keytypes */
|
||||
|
||||
enum ha_base_keytype {
|
||||
HA_KEYTYPE_END=0,
|
||||
HA_KEYTYPE_TEXT=1, /* Key is sorted as letters */
|
||||
HA_KEYTYPE_BINARY=2, /* Key is sorted as unsigned chars */
|
||||
HA_KEYTYPE_SHORT_INT=3,
|
||||
HA_KEYTYPE_LONG_INT=4,
|
||||
HA_KEYTYPE_FLOAT=5,
|
||||
HA_KEYTYPE_DOUBLE=6,
|
||||
HA_KEYTYPE_NUM=7, /* Not packed num with pre-space */
|
||||
HA_KEYTYPE_USHORT_INT=8,
|
||||
HA_KEYTYPE_ULONG_INT=9,
|
||||
HA_KEYTYPE_LONGLONG=10,
|
||||
HA_KEYTYPE_ULONGLONG=11,
|
||||
HA_KEYTYPE_INT24=12,
|
||||
HA_KEYTYPE_UINT24=13,
|
||||
HA_KEYTYPE_INT8=14,
|
||||
HA_KEYTYPE_VARTEXT=15, /* Key is sorted as letters */
|
||||
HA_KEYTYPE_VARBINARY=16 /* Key is sorted as unsigned chars */
|
||||
};
|
||||
|
||||
#define HA_MAX_KEYTYPE 31 /* Must be log2-1 */
|
||||
|
||||
/* These flags kan be OR:ed to key-flag */
|
||||
|
||||
#define HA_NOSAME 1 /* Set if not dupplicated records */
|
||||
#define HA_PACK_KEY 2 /* Pack string key to previous key */
|
||||
#define HA_AUTO_KEY 16
|
||||
#define HA_BINARY_PACK_KEY 32 /* Packing of all keys to prev key */
|
||||
#define HA_FULLTEXT 128 /* SerG: for full-text search */
|
||||
#define HA_UNIQUE_CHECK 256 /* Check the key for uniqueness */
|
||||
#define HA_SPATIAL 1024 /* Alex Barkov: for spatial search */
|
||||
#define HA_NULL_ARE_EQUAL 2048 /* NULL in key are cmp as equal */
|
||||
|
||||
|
||||
/* Automatic bits in key-flag */
|
||||
|
||||
#define HA_SPACE_PACK_USED 4 /* Test for if SPACE_PACK used */
|
||||
#define HA_VAR_LENGTH_KEY 8
|
||||
#define HA_NULL_PART_KEY 64
|
||||
#ifndef ISAM_LIBRARY
|
||||
#define HA_SORT_ALLOWS_SAME 512 /* Intern bit when sorting records */
|
||||
#else
|
||||
/* poor old NISAM has 8-bit flags :-( */
|
||||
#define HA_SORT_ALLOWS_SAME 128 /* Intern bit when sorting records */
|
||||
#endif
|
||||
/*
|
||||
Key has a part that can have end space. If this is an unique key
|
||||
we have to handle it differently from other unique keys as we can find
|
||||
many matching rows for one key (becaue end space are not compared)
|
||||
*/
|
||||
#define HA_END_SPACE_KEY 4096
|
||||
|
||||
/* These flags can be added to key-seg-flag */
|
||||
|
||||
#define HA_SPACE_PACK 1 /* Pack space in key-seg */
|
||||
#define HA_PART_KEY_SEG 4 /* Used by MySQL for part-key-cols */
|
||||
#define HA_VAR_LENGTH 8
|
||||
#define HA_NULL_PART 16
|
||||
#define HA_BLOB_PART 32
|
||||
#define HA_SWAP_KEY 64
|
||||
#define HA_REVERSE_SORT 128 /* Sort key in reverse order */
|
||||
#define HA_NO_SORT 256 /* do not bother sorting on this keyseg */
|
||||
|
||||
/* optionbits for database */
|
||||
#define HA_OPTION_PACK_RECORD 1
|
||||
#define HA_OPTION_PACK_KEYS 2
|
||||
#define HA_OPTION_COMPRESS_RECORD 4
|
||||
#define HA_OPTION_LONG_BLOB_PTR 8 /* new ISAM format */
|
||||
#define HA_OPTION_TMP_TABLE 16
|
||||
#define HA_OPTION_CHECKSUM 32
|
||||
#define HA_OPTION_DELAY_KEY_WRITE 64
|
||||
#define HA_OPTION_NO_PACK_KEYS 128 /* Reserved for MySQL */
|
||||
#define HA_OPTION_TEMP_COMPRESS_RECORD ((uint) 16384) /* set by isamchk */
|
||||
#define HA_OPTION_READ_ONLY_DATA ((uint) 32768) /* Set by isamchk */
|
||||
|
||||
/* Bits in flag to create() */
|
||||
|
||||
#define HA_DONT_TOUCH_DATA 1 /* Don't empty datafile (isamchk) */
|
||||
#define HA_PACK_RECORD 2 /* Request packed record format */
|
||||
#define HA_CREATE_TMP_TABLE 4
|
||||
#define HA_CREATE_CHECKSUM 8
|
||||
#define HA_CREATE_DELAY_KEY_WRITE 64
|
||||
|
||||
/* Bits in flag to _status */
|
||||
|
||||
#define HA_STATUS_POS 1 /* Return position */
|
||||
#define HA_STATUS_NO_LOCK 2 /* Don't use external lock */
|
||||
#define HA_STATUS_TIME 4 /* Return update time */
|
||||
#define HA_STATUS_CONST 8 /* Return constants values */
|
||||
#define HA_STATUS_VARIABLE 16
|
||||
#define HA_STATUS_ERRKEY 32
|
||||
#define HA_STATUS_AUTO 64
|
||||
|
||||
/* Errorcodes given by functions */
|
||||
|
||||
/* opt_sum_query() assumes these codes are > 1 */
|
||||
#define HA_ERR_KEY_NOT_FOUND 120 /* Didn't find key on read or update */
|
||||
#define HA_ERR_FOUND_DUPP_KEY 121 /* Dupplicate key on write */
|
||||
#define HA_ERR_RECORD_CHANGED 123 /* Uppdate with is recoverable */
|
||||
#define HA_ERR_WRONG_INDEX 124 /* Wrong index given to function */
|
||||
#define HA_ERR_CRASHED 126 /* Indexfile is crashed */
|
||||
#define HA_ERR_WRONG_IN_RECORD 127 /* Record-file is crashed */
|
||||
#define HA_ERR_OUT_OF_MEM 128 /* Record-file is crashed */
|
||||
#define HA_ERR_NOT_A_TABLE 130 /* not a MYI file - no signature */
|
||||
#define HA_ERR_WRONG_COMMAND 131 /* Command not supported */
|
||||
#define HA_ERR_OLD_FILE 132 /* old databasfile */
|
||||
#define HA_ERR_NO_ACTIVE_RECORD 133 /* No record read in update() */
|
||||
#define HA_ERR_RECORD_DELETED 134 /* Intern error-code */
|
||||
#define HA_ERR_RECORD_FILE_FULL 135 /* No more room in file */
|
||||
#define HA_ERR_INDEX_FILE_FULL 136 /* No more room in file */
|
||||
#define HA_ERR_END_OF_FILE 137 /* end in next/prev/first/last */
|
||||
#define HA_ERR_UNSUPPORTED 138 /* unsupported extension used */
|
||||
#define HA_ERR_TO_BIG_ROW 139 /* Too big row */
|
||||
#define HA_WRONG_CREATE_OPTION 140 /* Wrong create option */
|
||||
#define HA_ERR_FOUND_DUPP_UNIQUE 141 /* Dupplicate unique on write */
|
||||
#define HA_ERR_UNKNOWN_CHARSET 142 /* Can't open charset */
|
||||
#define HA_ERR_WRONG_MRG_TABLE_DEF 143 /* conflicting MyISAM tables in MERGE */
|
||||
#define HA_ERR_CRASHED_ON_REPAIR 144 /* Last (automatic?) repair failed */
|
||||
#define HA_ERR_CRASHED_ON_USAGE 145 /* Table must be repaired */
|
||||
#define HA_ERR_LOCK_WAIT_TIMEOUT 146
|
||||
#define HA_ERR_LOCK_TABLE_FULL 147
|
||||
#define HA_ERR_READ_ONLY_TRANSACTION 148 /* Updates not allowed */
|
||||
#define HA_ERR_LOCK_DEADLOCK 149
|
||||
#define HA_ERR_CANNOT_ADD_FOREIGN 150 /* Cannot add a foreign key constr. */
|
||||
#define HA_ERR_NO_REFERENCED_ROW 151 /* Cannot add a child row */
|
||||
#define HA_ERR_ROW_IS_REFERENCED 152 /* Cannot delete a parent row */
|
||||
#define HA_ERR_NO_SAVEPOINT 153 /* No savepoint with that name */
|
||||
|
||||
/* Other constants */
|
||||
|
||||
#define HA_NAMELEN 64 /* Max length of saved filename */
|
||||
#define NO_SUCH_KEY ((uint)~0) /* used as a key no. */
|
||||
|
||||
/* Intern constants in databases */
|
||||
|
||||
/* bits in _search */
|
||||
#define SEARCH_FIND 1
|
||||
#define SEARCH_NO_FIND 2
|
||||
#define SEARCH_SAME 4
|
||||
#define SEARCH_BIGGER 8
|
||||
#define SEARCH_SMALLER 16
|
||||
#define SEARCH_SAVE_BUFF 32
|
||||
#define SEARCH_UPDATE 64
|
||||
#define SEARCH_PREFIX 128
|
||||
#define SEARCH_LAST 256
|
||||
#define MBR_CONTAIN 512
|
||||
#define MBR_INTERSECT 1024
|
||||
#define MBR_WITHIN 2048
|
||||
#define MBR_DISJOINT 4096
|
||||
#define MBR_EQUAL 8192
|
||||
#define MBR_DATA 16384
|
||||
#define SEARCH_NULL_ARE_EQUAL 32768 /* NULL in keys are equal */
|
||||
#define SEARCH_NULL_ARE_NOT_EQUAL 65536 /* NULL in keys are not equal */
|
||||
|
||||
/* bits in opt_flag */
|
||||
#define QUICK_USED 1
|
||||
#define READ_CACHE_USED 2
|
||||
#define READ_CHECK_USED 4
|
||||
#define KEY_READ_USED 8
|
||||
#define WRITE_CACHE_USED 16
|
||||
#define OPT_NO_ROWS 32
|
||||
|
||||
/* bits in update */
|
||||
#define HA_STATE_CHANGED 1 /* Database has changed */
|
||||
#define HA_STATE_AKTIV 2 /* Has a current record */
|
||||
#define HA_STATE_WRITTEN 4 /* Record is written */
|
||||
#define HA_STATE_DELETED 8
|
||||
#define HA_STATE_NEXT_FOUND 16 /* Next found record (record before) */
|
||||
#define HA_STATE_PREV_FOUND 32 /* Prev found record (record after) */
|
||||
#define HA_STATE_NO_KEY 64 /* Last read didn't find record */
|
||||
#define HA_STATE_KEY_CHANGED 128
|
||||
#define HA_STATE_WRITE_AT_END 256 /* set in _ps_find_writepos */
|
||||
#define HA_STATE_BUFF_SAVED 512 /* If current keybuff is info->buff */
|
||||
#define HA_STATE_ROW_CHANGED 1024 /* To invalide ROW cache */
|
||||
#define HA_STATE_EXTEND_BLOCK 2048
|
||||
|
||||
enum en_fieldtype {
|
||||
FIELD_LAST=-1,FIELD_NORMAL,FIELD_SKIP_ENDSPACE,FIELD_SKIP_PRESPACE,
|
||||
FIELD_SKIP_ZERO,FIELD_BLOB,FIELD_CONSTANT,FIELD_INTERVALL,FIELD_ZERO,
|
||||
FIELD_VARCHAR,FIELD_CHECK
|
||||
};
|
||||
|
||||
enum data_file_type {
|
||||
STATIC_RECORD,DYNAMIC_RECORD,COMPRESSED_RECORD
|
||||
};
|
||||
|
||||
/* For number of records */
|
||||
#ifdef BIG_TABLES
|
||||
#define rows2double(A) ulonglong2double(A)
|
||||
typedef my_off_t ha_rows;
|
||||
#else
|
||||
#define rows2double(A) (double) (A)
|
||||
typedef ulong ha_rows;
|
||||
#endif
|
||||
|
||||
#define HA_POS_ERROR (~ (ha_rows) 0)
|
||||
#define HA_OFFSET_ERROR (~ (my_off_t) 0)
|
||||
|
||||
#if SYSTEM_SIZEOF_OFF_T == 4
|
||||
#define MAX_FILE_SIZE INT_MAX32
|
||||
#else
|
||||
#define MAX_FILE_SIZE LONGLONG_MAX
|
||||
#endif
|
||||
|
||||
#endif /* _my_base_h */
|
55
dlls/csx_sql/extra/include/mysql/my_bitmap.h
Executable file
55
dlls/csx_sql/extra/include/mysql/my_bitmap.h
Executable file
@ -0,0 +1,55 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _my_bitmap_h_
|
||||
#define _my_bitmap_h_
|
||||
|
||||
#include <my_pthread.h>
|
||||
|
||||
#define MY_BIT_NONE (~(uint) 0)
|
||||
|
||||
typedef struct st_bitmap
|
||||
{
|
||||
uchar *bitmap;
|
||||
uint bitmap_size;
|
||||
my_bool thread_safe; /* set if several threads access the bitmap */
|
||||
/*
|
||||
mutex will be acquired for the duration of each bitmap operation if
|
||||
thread_safe flag is set. Otherwise, we optimize by not acquiring the
|
||||
mutex
|
||||
*/
|
||||
#ifdef THREAD
|
||||
pthread_mutex_t mutex;
|
||||
#endif
|
||||
} MY_BITMAP;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern my_bool bitmap_init(MY_BITMAP *bitmap, uint bitmap_size,
|
||||
my_bool thread_safe);
|
||||
extern void bitmap_free(MY_BITMAP *bitmap);
|
||||
extern void bitmap_set_bit(MY_BITMAP *bitmap, uint bitmap_bit);
|
||||
extern uint bitmap_set_next(MY_BITMAP *bitmap);
|
||||
extern void bitmap_set_all(MY_BITMAP* bitmap);
|
||||
extern my_bool bitmap_is_set(MY_BITMAP* bitmap, uint bitmap_bit);
|
||||
extern void bitmap_clear_all(MY_BITMAP* bitmap);
|
||||
extern void bitmap_clear_bit(MY_BITMAP *bitmap, uint bitmap_bit);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _my_bitmap_h_ */
|
882
dlls/csx_sql/extra/include/mysql/my_config.h
Executable file
882
dlls/csx_sql/extra/include/mysql/my_config.h
Executable file
@ -0,0 +1,882 @@
|
||||
/* config.h. Generated by configure. */
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
/* #undef C_ALLOCA */
|
||||
|
||||
/* #undef CRAY_STACKSEG_END */
|
||||
|
||||
/* Version of .frm files */
|
||||
#define DOT_FRM_VERSION 6
|
||||
|
||||
/* If LOAD DATA LOCAL INFILE should be enabled by default */
|
||||
#define ENABLED_LOCAL_INFILE 1
|
||||
|
||||
/* READLINE: */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* READLINE: Define if your system defines TIOCGWINSZ in sys/ioctl.h. */
|
||||
#define GWINSZ_IN_SYS_IOCTL 1
|
||||
|
||||
/* Handing of large files on Solaris 2.6 */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Do we have FIONREAD */
|
||||
#define FIONREAD_IN_SYS_IOCTL 1
|
||||
|
||||
/* Do we need to define _GNU_SOURCE */
|
||||
/* #undef _GNU_SOURCE */
|
||||
|
||||
/* atomic_add() from <asm/atomic.h> (Linux only) */
|
||||
#define HAVE_ATOMIC_ADD 1
|
||||
|
||||
/* atomic_sub() from <asm/atomic.h> (Linux only) */
|
||||
#define HAVE_ATOMIC_SUB 1
|
||||
|
||||
/* If we have a working alloca() implementation */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* bool is not defined by all C++ compilators */
|
||||
#define HAVE_BOOL 1
|
||||
|
||||
/* Have berkeley db installed */
|
||||
#define HAVE_BERKELEY_DB 1
|
||||
|
||||
/* DSB style signals ? */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* Can netinet be included */
|
||||
/* #undef HAVE_BROKEN_NETINET_INCLUDES */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_BSD_SIGNALS */
|
||||
|
||||
/* ZLIB and compress: */
|
||||
#define HAVE_COMPRESS 1
|
||||
|
||||
/* Define if we are using OSF1 DEC threads */
|
||||
/* #undef HAVE_DEC_THREADS */
|
||||
|
||||
/* Define if we are using OSF1 DEC threads on 3.2 */
|
||||
/* #undef HAVE_DEC_3_2_THREADS */
|
||||
|
||||
/* fp_except from ieeefp.h */
|
||||
/* #undef HAVE_FP_EXCEPT */
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_GETPW_DECLS */
|
||||
|
||||
/* Solaris define gethostbyname_r with 5 arguments. glibc2 defines
|
||||
this with 6 arguments */
|
||||
#define HAVE_GETHOSTBYNAME_R_GLIBC2_STYLE 1
|
||||
|
||||
/* In OSF 4.0f the 3'd argument to gethostname_r is hostent_data * */
|
||||
/* #undef HAVE_GETHOSTBYNAME_R_RETURN_INT */
|
||||
|
||||
/* Define if int8, int16 and int32 types exist */
|
||||
/* #undef HAVE_INT_8_16_32 */
|
||||
|
||||
/* Using Innobase DB */
|
||||
#define HAVE_INNOBASE_DB 1
|
||||
|
||||
/* Using old ISAM tables */
|
||||
#define HAVE_ISAM 1
|
||||
|
||||
/* Define if we have GNU readline */
|
||||
/* #undef HAVE_LIBREADLINE */
|
||||
|
||||
/* Define if have -lwrap */
|
||||
/* #undef HAVE_LIBWRAP */
|
||||
|
||||
/* Define if we are using Xavier Leroy's LinuxThreads */
|
||||
#define HAVE_LINUXTHREADS 1
|
||||
|
||||
/* Do we have lstat */
|
||||
#define HAVE_LSTAT 1
|
||||
|
||||
/* Do we use user level threads */
|
||||
/* #undef HAVE_mit_thread */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_GETSPECIFIC */
|
||||
|
||||
/* For some non posix threads */
|
||||
/* #undef HAVE_NONPOSIX_PTHREAD_MUTEX_INIT */
|
||||
|
||||
/* READLINE: */
|
||||
#define HAVE_POSIX_SIGNALS 1
|
||||
|
||||
/* Well.. */
|
||||
/* #undef HAVE_POSIX_SIGSETJMP */
|
||||
|
||||
/* sigwait with one argument */
|
||||
/* #undef HAVE_NONPOSIX_SIGWAIT */
|
||||
|
||||
/* ORBIT */
|
||||
/* #undef HAVE_ORBIT */
|
||||
|
||||
/* pthread_attr_setscope */
|
||||
#define HAVE_PTHREAD_ATTR_SETSCOPE 1
|
||||
|
||||
/* pthread_yield that doesn't take any arguments */
|
||||
#define HAVE_PTHREAD_YIELD_ZERO_ARG 1
|
||||
|
||||
/* pthread_yield function with one argument */
|
||||
/* #undef HAVE_PTHREAD_YIELD_ONE_ARG */
|
||||
|
||||
/* POSIX readdir_r */
|
||||
#define HAVE_READDIR_R 1
|
||||
|
||||
/* Have Gemini db installed */
|
||||
/* #undef HAVE_GEMINI_DB */
|
||||
|
||||
/* POSIX sigwait */
|
||||
#define HAVE_SIGWAIT 1
|
||||
|
||||
/* crypt */
|
||||
#define HAVE_CRYPT 1
|
||||
|
||||
/* If we want to have query cache */
|
||||
#define HAVE_QUERY_CACHE 1
|
||||
|
||||
/* Solaris define gethostbyaddr_r with 7 arguments. glibc2 defines
|
||||
this with 8 arguments */
|
||||
/* #undef HAVE_SOLARIS_STYLE_GETHOST */
|
||||
|
||||
/* MIT pthreads does not support connecting with unix sockets */
|
||||
/* #undef HAVE_THREADS_WITHOUT_SOCKETS */
|
||||
|
||||
/* Timespec has a ts_sec instead of tv_sev */
|
||||
/* #undef HAVE_TIMESPEC_TS_SEC */
|
||||
|
||||
/* Have the tzname variable */
|
||||
#define HAVE_TZNAME 1
|
||||
|
||||
/* Define if the system files define uchar */
|
||||
/* #undef HAVE_UCHAR */
|
||||
|
||||
/* Define if the system files define uint */
|
||||
#define HAVE_UINT 1
|
||||
|
||||
/* Define if the system files define ulong */
|
||||
#define HAVE_ULONG 1
|
||||
|
||||
/* Define if the system files define in_addr_t */
|
||||
#define HAVE_IN_ADDR_T 1
|
||||
|
||||
/* UNIXWARE7 threads are not posix */
|
||||
/* #undef HAVE_UNIXWARE7_THREADS */
|
||||
|
||||
/* new UNIXWARE7 threads that are not yet posix */
|
||||
/* #undef HAVE_UNIXWARE7_POSIX */
|
||||
|
||||
/* OpenSSL */
|
||||
#define HAVE_OPENSSL 1
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef HAVE_USG_SIGHOLD */
|
||||
|
||||
/* Virtual IO */
|
||||
#define HAVE_VIO 1
|
||||
|
||||
/* Handling of large files on Solaris 2.6 */
|
||||
/* #undef _LARGEFILE_SOURCE */
|
||||
|
||||
/* Handling of large files on Solaris 2.6 */
|
||||
/* #undef _LARGEFILE64_SOURCE */
|
||||
|
||||
/* Define if want -lwrap */
|
||||
/* #undef LIBWRAP */
|
||||
|
||||
/* Define to machine type name eg sun10 */
|
||||
#define MACHINE_TYPE "i686"
|
||||
|
||||
/* #undef MUST_REINSTALL_SIGHANDLERS */
|
||||
|
||||
/* Defined to used character set */
|
||||
/* #undef MY_CHARSET_CURRENT */
|
||||
|
||||
/* READLINE: no sys file*/
|
||||
/* #undef NO_SYS_FILE */
|
||||
|
||||
/* Program name */
|
||||
#define PACKAGE "mysql"
|
||||
|
||||
/* mysql client protocoll version */
|
||||
#define PROTOCOL_VERSION 10
|
||||
|
||||
/* Define if qsort returns void */
|
||||
#define QSORT_TYPE_IS_VOID 1
|
||||
|
||||
/* Define as the return type of qsort (int or void). */
|
||||
#define RETQSORTTYPE void
|
||||
|
||||
/* Size of off_t */
|
||||
#define SIZEOF_OFF_T 8
|
||||
|
||||
/* Define as the base type of the last arg to accept */
|
||||
#define SOCKET_SIZE_TYPE socklen_t
|
||||
|
||||
/* Last argument to get/setsockopt */
|
||||
/* #undef SOCKOPT_OPTLEN_TYPE */
|
||||
|
||||
/* #undef SPEED_T_IN_SYS_TYPES */
|
||||
/* #undef SPRINTF_RETURNS_PTR */
|
||||
#define SPRINTF_RETURNS_INT 1
|
||||
/* #undef SPRINTF_RETURNS_GARBAGE */
|
||||
|
||||
/* Needed to get large file support on HPUX 10.20 */
|
||||
/* #undef __STDC_EXT__ */
|
||||
|
||||
#define STACK_DIRECTION -1
|
||||
|
||||
/* #undef STRCOLL_BROKEN */
|
||||
|
||||
/* #undef STRUCT_DIRENT_HAS_D_FILENO */
|
||||
#define STRUCT_DIRENT_HAS_D_INO 1
|
||||
|
||||
/* #undef STRUCT_WINSIZE_IN_SYS_IOCTL */
|
||||
/* #undef STRUCT_WINSIZE_IN_TERMIOS */
|
||||
|
||||
/* Define to name of system eg solaris*/
|
||||
#define SYSTEM_TYPE "pc-linux"
|
||||
|
||||
/* Define if you want to have threaded code. This may be undef on client code */
|
||||
#define THREAD 1
|
||||
|
||||
/* Should be client be thread safe */
|
||||
#define THREAD_SAFE_CLIENT 1
|
||||
|
||||
/* READLINE: */
|
||||
/* #undef TIOCSTAT_IN_SYS_IOCTL */
|
||||
|
||||
/* Use multi-byte character routines */
|
||||
#define USE_MB 1
|
||||
#define USE_MB_IDENT 1
|
||||
|
||||
/* the pstack backtrace library */
|
||||
/* #undef USE_PSTACK */
|
||||
|
||||
/* Use MySQL RAID */
|
||||
#define USE_RAID 1
|
||||
|
||||
/* Use strcoll() functions when comparing and sorting. */
|
||||
#define USE_STRCOLL 1
|
||||
|
||||
/* Program version */
|
||||
#define VERSION "4.0.18"
|
||||
|
||||
/* READLINE: */
|
||||
#define VOID_SIGHANDLER 1
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
||||
|
||||
/* Define to 1 if you have the `alarm' function. */
|
||||
#define HAVE_ALARM 1
|
||||
|
||||
/* Define to 1 if you have the <alloca.h> header file. */
|
||||
#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
#define HAVE_ARPA_INET_H 1
|
||||
|
||||
/* Define to 1 if you have the <asm/termbits.h> header file. */
|
||||
#define HAVE_ASM_TERMBITS_H 1
|
||||
|
||||
/* Define to 1 if you have the `atod' function. */
|
||||
/* #undef HAVE_ATOD */
|
||||
|
||||
/* Define to 1 if you have the `bcmp' function. */
|
||||
#define HAVE_BCMP 1
|
||||
|
||||
/* Define to 1 if you have the `bfill' function. */
|
||||
/* #undef HAVE_BFILL */
|
||||
|
||||
/* Define to 1 if you have the `bmove' function. */
|
||||
/* #undef HAVE_BMOVE */
|
||||
|
||||
/* Define to 1 if you have the `bzero' function. */
|
||||
#define HAVE_BZERO 1
|
||||
|
||||
/* Define to 1 if you have the `chsize' function. */
|
||||
/* #undef HAVE_CHSIZE */
|
||||
|
||||
/* Define to 1 if you have the <crypt.h> header file. */
|
||||
#define HAVE_CRYPT_H 1
|
||||
|
||||
/* Define to 1 if you have the <curses.h> header file. */
|
||||
#define HAVE_CURSES_H 1
|
||||
|
||||
/* Define to 1 if you have the `cuserid' function. */
|
||||
#define HAVE_CUSERID 1
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file. */
|
||||
#define HAVE_DIRENT_H 1
|
||||
|
||||
/* Define to 1 if you have the `dlerror' function. */
|
||||
#define HAVE_DLERROR 1
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#define HAVE_DLFCN_H 1
|
||||
|
||||
/* Define to 1 if you have the `dlopen' function. */
|
||||
#define HAVE_DLOPEN 1
|
||||
|
||||
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
|
||||
/* #undef HAVE_DOPRNT */
|
||||
|
||||
/* Define to 1 if you have the `fchmod' function. */
|
||||
#define HAVE_FCHMOD 1
|
||||
|
||||
/* Define to 1 if you have the `fcntl' function. */
|
||||
#define HAVE_FCNTL 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `fconvert' function. */
|
||||
/* #undef HAVE_FCONVERT */
|
||||
|
||||
/* Define to 1 if you have the `fdatasync' function. */
|
||||
#define HAVE_FDATASYNC 1
|
||||
|
||||
/* Define to 1 if you have the `finite' function. */
|
||||
#define HAVE_FINITE 1
|
||||
|
||||
/* Define to 1 if you have the <floatingpoint.h> header file. */
|
||||
/* #undef HAVE_FLOATINGPOINT_H */
|
||||
|
||||
/* Define to 1 if you have the <float.h> header file. */
|
||||
#define HAVE_FLOAT_H 1
|
||||
|
||||
/* Define to 1 if you have the `fpresetsticky' function. */
|
||||
/* #undef HAVE_FPRESETSTICKY */
|
||||
|
||||
/* Define to 1 if you have the `fpsetmask' function. */
|
||||
/* #undef HAVE_FPSETMASK */
|
||||
|
||||
/* Define to 1 if you have the `fseeko' function. */
|
||||
#define HAVE_FSEEKO 1
|
||||
|
||||
/* Define to 1 if you have the `fsync' function. */
|
||||
#define HAVE_FSYNC 1
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
#define HAVE_FTRUNCATE 1
|
||||
|
||||
/* Define to 1 if you have the `getcwd' function. */
|
||||
#define HAVE_GETCWD 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyaddr_r' function. */
|
||||
#define HAVE_GETHOSTBYADDR_R 1
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname_r' function. */
|
||||
#define HAVE_GETHOSTBYNAME_R 1
|
||||
|
||||
/* Define to 1 if you have the `getpagesize' function. */
|
||||
#define HAVE_GETPAGESIZE 1
|
||||
|
||||
/* Define to 1 if you have the `getpass' function. */
|
||||
#define HAVE_GETPASS 1
|
||||
|
||||
/* Define to 1 if you have the `getpassphrase' function. */
|
||||
/* #undef HAVE_GETPASSPHRASE */
|
||||
|
||||
/* Define to 1 if you have the `getpwnam' function. */
|
||||
#define HAVE_GETPWNAM 1
|
||||
|
||||
/* Define to 1 if you have the `getpwuid' function. */
|
||||
#define HAVE_GETPWUID 1
|
||||
|
||||
/* Define to 1 if you have the `getrlimit' function. */
|
||||
#define HAVE_GETRLIMIT 1
|
||||
|
||||
/* Define to 1 if you have the `getrusage' function. */
|
||||
#define HAVE_GETRUSAGE 1
|
||||
|
||||
/* Define to 1 if you have the `getwd' function. */
|
||||
#define HAVE_GETWD 1
|
||||
|
||||
/* Define to 1 if you have the <grp.h> header file. */
|
||||
#define HAVE_GRP_H 1
|
||||
|
||||
/* Define to 1 if you have the <ieeefp.h> header file. */
|
||||
/* #undef HAVE_IEEEFP_H */
|
||||
|
||||
/* Define to 1 if you have the `index' function. */
|
||||
#define HAVE_INDEX 1
|
||||
|
||||
/* Define to 1 if you have the `initgroups' function. */
|
||||
#define HAVE_INITGROUPS 1
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `isnan' function. */
|
||||
#define HAVE_ISNAN 1
|
||||
|
||||
/* Define to 1 if you have the `bind' library (-lbind). */
|
||||
/* #undef HAVE_LIBBIND */
|
||||
|
||||
/* Define to 1 if you have the `compat' library (-lcompat). */
|
||||
/* #undef HAVE_LIBCOMPAT */
|
||||
|
||||
/* Define to 1 if you have the `crypt' library (-lcrypt). */
|
||||
#define HAVE_LIBCRYPT 1
|
||||
|
||||
/* Define to 1 if you have the `c_r' library (-lc_r). */
|
||||
/* #undef HAVE_LIBC_R */
|
||||
|
||||
/* Define to 1 if you have the `dl' library (-ldl). */
|
||||
#define HAVE_LIBDL 1
|
||||
|
||||
/* Define to 1 if you have the `gen' library (-lgen). */
|
||||
/* #undef HAVE_LIBGEN */
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#define HAVE_LIBM 1
|
||||
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
#define HAVE_LIBNSL 1
|
||||
|
||||
/* Define to 1 if you have the `nsl_r' library (-lnsl_r). */
|
||||
/* #undef HAVE_LIBNSL_R */
|
||||
|
||||
/* Define to 1 if you have the `posix4' library (-lposix4). */
|
||||
/* #undef HAVE_LIBPOSIX4 */
|
||||
|
||||
/* Define to 1 if you have the `pthread' library (-lpthread). */
|
||||
#define HAVE_LIBPTHREAD 1
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the <linux/config.h> header file. */
|
||||
#define HAVE_LINUX_CONFIG_H 1
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#define HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime_r' function. */
|
||||
#define HAVE_LOCALTIME_R 1
|
||||
|
||||
/* Define to 1 if you have the `locking' function. */
|
||||
/* #undef HAVE_LOCKING */
|
||||
|
||||
/* Define to 1 if you have the `longjmp' function. */
|
||||
#define HAVE_LONGJMP 1
|
||||
|
||||
/* Define to 1 if you have the `lrand48' function. */
|
||||
#define HAVE_LRAND48 1
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#define HAVE_LSTAT 1
|
||||
|
||||
/* Define to 1 if you have the `madvise' function. */
|
||||
#define HAVE_MADVISE 1
|
||||
|
||||
/* Define to 1 if you have the `mallinfo' function. */
|
||||
#define HAVE_MALLINFO 1
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#define HAVE_MALLOC_H 1
|
||||
|
||||
/* Define to 1 if you have the `memcpy' function. */
|
||||
#define HAVE_MEMCPY 1
|
||||
|
||||
/* Define to 1 if you have the `memmove' function. */
|
||||
#define HAVE_MEMMOVE 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#define HAVE_MKSTEMP 1
|
||||
|
||||
/* Define to 1 if you have the `mlockall' function. */
|
||||
#define HAVE_MLOCKALL 1
|
||||
|
||||
/* Define to 1 if you have a working `mmap' system call. */
|
||||
#define HAVE_MMAP 1
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
#define HAVE_NETINET_IN_H 1
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#define HAVE_PATHS_H 1
|
||||
|
||||
/* Define to 1 if you have the `perror' function. */
|
||||
#define HAVE_PERROR 1
|
||||
|
||||
/* Define to 1 if you have the `poll' function. */
|
||||
#define HAVE_POLL 1
|
||||
|
||||
/* Define to 1 if you have the `pread' function. */
|
||||
#define HAVE_PREAD 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_attr_create' function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_CREATE */
|
||||
|
||||
/* Define to 1 if you have the `pthread_attr_getstacksize' function. */
|
||||
#define HAVE_PTHREAD_ATTR_GETSTACKSIZE 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_attr_setprio' function. */
|
||||
/* #undef HAVE_PTHREAD_ATTR_SETPRIO */
|
||||
|
||||
/* Define to 1 if you have the `pthread_attr_setschedparam' function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETSCHEDPARAM 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_attr_setstacksize' function. */
|
||||
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_condattr_create' function. */
|
||||
/* #undef HAVE_PTHREAD_CONDATTR_CREATE */
|
||||
|
||||
/* Define to 1 if you have the `pthread_getsequence_np' function. */
|
||||
/* #undef HAVE_PTHREAD_GETSEQUENCE_NP */
|
||||
|
||||
/* Define to 1 if you have the `pthread_init' function. */
|
||||
/* #undef HAVE_PTHREAD_INIT */
|
||||
|
||||
/* Define to 1 if you have the `pthread_key_delete' function. */
|
||||
#define HAVE_PTHREAD_KEY_DELETE 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_rwlock_rdlock' function. */
|
||||
#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_setprio' function. */
|
||||
/* #undef HAVE_PTHREAD_SETPRIO */
|
||||
|
||||
/* Define to 1 if you have the `pthread_setprio_np' function. */
|
||||
/* #undef HAVE_PTHREAD_SETPRIO_NP */
|
||||
|
||||
/* Define to 1 if you have the `pthread_setschedparam' function. */
|
||||
#define HAVE_PTHREAD_SETSCHEDPARAM 1
|
||||
|
||||
/* Define to 1 if you have the `pthread_sigmask' function. */
|
||||
#define HAVE_PTHREAD_SIGMASK 1
|
||||
|
||||
/* Define to 1 if you have the `putenv' function. */
|
||||
#define HAVE_PUTENV 1
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#define HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
#define HAVE_READLINK 1
|
||||
|
||||
/* Define to 1 if you have the `realpath' function. */
|
||||
#define HAVE_REALPATH 1
|
||||
|
||||
/* Define to 1 if you have the `rename' function. */
|
||||
#define HAVE_RENAME 1
|
||||
|
||||
/* Define to 1 if system calls automatically restart after interruption by a
|
||||
signal. */
|
||||
#define HAVE_RESTARTABLE_SYSCALLS 1
|
||||
|
||||
/* Define to 1 if you have the `rint' function. */
|
||||
#define HAVE_RINT 1
|
||||
|
||||
/* Define to 1 if you have the `rwlock_init' function. */
|
||||
/* #undef HAVE_RWLOCK_INIT */
|
||||
|
||||
/* Define to 1 if you have the <sched.h> header file. */
|
||||
#define HAVE_SCHED_H 1
|
||||
|
||||
/* Define to 1 if you have the `select' function. */
|
||||
#define HAVE_SELECT 1
|
||||
|
||||
/* Define to 1 if you have the <select.h> header file. */
|
||||
/* #undef HAVE_SELECT_H */
|
||||
|
||||
/* Define to 1 if you have the <semaphore.h> header file. */
|
||||
#define HAVE_SEMAPHORE_H 1
|
||||
|
||||
/* Define to 1 if you have the `setenv' function. */
|
||||
#define HAVE_SETENV 1
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#define HAVE_SETLOCALE 1
|
||||
|
||||
/* Define to 1 if you have the `setupterm' function. */
|
||||
/* #undef HAVE_SETUPTERM */
|
||||
|
||||
/* Define to 1 if you have the `sighold' function. */
|
||||
#define HAVE_SIGHOLD 1
|
||||
|
||||
/* Define to 1 if you have the `sigset' function. */
|
||||
#define HAVE_SIGSET 1
|
||||
|
||||
/* Define to 1 if you have the `sigthreadmask' function. */
|
||||
/* #undef HAVE_SIGTHREADMASK */
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#define HAVE_SOCKET 1
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define to 1 if you have the <stddef.h> header file. */
|
||||
#define HAVE_STDDEF_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the `stpcpy' function. */
|
||||
#define HAVE_STPCPY 1
|
||||
|
||||
/* Define to 1 if you have the `strcasecmp' function. */
|
||||
#define HAVE_STRCASECMP 1
|
||||
|
||||
/* Define to 1 if you have the `strcoll' function. */
|
||||
#define HAVE_STRCOLL 1
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strnlen' function. */
|
||||
#define HAVE_STRNLEN 1
|
||||
|
||||
/* Define to 1 if you have the `strpbrk' function. */
|
||||
#define HAVE_STRPBRK 1
|
||||
|
||||
/* Define to 1 if you have the `strstr' function. */
|
||||
#define HAVE_STRSTR 1
|
||||
|
||||
/* Define to 1 if you have the `strtok_r' function. */
|
||||
#define HAVE_STRTOK_R 1
|
||||
|
||||
/* Define to 1 if you have the `strtol' function. */
|
||||
#define HAVE_STRTOL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoll' function. */
|
||||
#define HAVE_STRTOLL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoul' function. */
|
||||
#define HAVE_STRTOUL 1
|
||||
|
||||
/* Define to 1 if you have the `strtoull' function. */
|
||||
#define HAVE_STRTOULL 1
|
||||
|
||||
/* Define to 1 if `st_rdev' is member of `struct stat'. */
|
||||
#define HAVE_STRUCT_STAT_ST_RDEV 1
|
||||
|
||||
/* Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use
|
||||
`HAVE_STRUCT_STAT_ST_RDEV' instead. */
|
||||
#define HAVE_ST_RDEV 1
|
||||
|
||||
/* Define to 1 if you have the <synch.h> header file. */
|
||||
/* #undef HAVE_SYNCH_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file. */
|
||||
#define HAVE_SYS_DIR_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#define HAVE_SYS_FILE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ioctl.h> header file. */
|
||||
#define HAVE_SYS_IOCTL_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/malloc.h> header file. */
|
||||
/* #undef HAVE_SYS_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
||||
#define HAVE_SYS_MMAN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file. */
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/ptem.h> header file. */
|
||||
/* #undef HAVE_SYS_PTEM_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/pte.h> header file. */
|
||||
/* #undef HAVE_SYS_PTE_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
#define HAVE_SYS_SELECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#define HAVE_SYS_SOCKET_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stream.h> header file. */
|
||||
/* #undef HAVE_SYS_STREAM_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/timeb.h> header file. */
|
||||
#define HAVE_SYS_TIMEB_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/un.h> header file. */
|
||||
#define HAVE_SYS_UN_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/utime.h> header file. */
|
||||
/* #undef HAVE_SYS_UTIME_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/vadvise.h> header file. */
|
||||
/* #undef HAVE_SYS_VADVISE_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
|
||||
/* Define to 1 if you have the `tcgetattr' function. */
|
||||
#define HAVE_TCGETATTR 1
|
||||
|
||||
/* Define to 1 if you have the `tell' function. */
|
||||
/* #undef HAVE_TELL */
|
||||
|
||||
/* Define to 1 if you have the `tempnam' function. */
|
||||
#define HAVE_TEMPNAM 1
|
||||
|
||||
/* Define to 1 if you have the <termbits.h> header file. */
|
||||
/* #undef HAVE_TERMBITS_H */
|
||||
|
||||
/* Define to 1 if you have the <termcap.h> header file. */
|
||||
#define HAVE_TERMCAP_H 1
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#define HAVE_TERMIOS_H 1
|
||||
|
||||
/* Define to 1 if you have the <termio.h> header file. */
|
||||
#define HAVE_TERMIO_H 1
|
||||
|
||||
/* Define to 1 if you have the <term.h> header file. */
|
||||
#define HAVE_TERM_H 1
|
||||
|
||||
/* Define to 1 if you have the `thr_setconcurrency' function. */
|
||||
/* #undef HAVE_THR_SETCONCURRENCY */
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the <utime.h> header file. */
|
||||
#define HAVE_UTIME_H 1
|
||||
|
||||
/* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
|
||||
#define HAVE_UTIME_NULL 1
|
||||
|
||||
/* Define to 1 if you have the <varargs.h> header file. */
|
||||
#define HAVE_VARARGS_H 1
|
||||
|
||||
/* Define to 1 if you have the `vidattr' function. */
|
||||
/* #undef HAVE_VIDATTR */
|
||||
|
||||
/* Define to 1 if you have the `vprintf' function. */
|
||||
#define HAVE_VPRINTF 1
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "mysql"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME ""
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING ""
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION ""
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#define RETSIGTYPE void
|
||||
|
||||
/* The size of a `char', as computed by sizeof. */
|
||||
#define SIZEOF_CHAR 1
|
||||
|
||||
/* The size of a `char*', as computed by sizeof. */
|
||||
#define SIZEOF_CHARP 4
|
||||
|
||||
/* The size of a `int', as computed by sizeof. */
|
||||
#define SIZEOF_INT 4
|
||||
|
||||
/* The size of a `long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG 4
|
||||
|
||||
/* The size of a `long long', as computed by sizeof. */
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
/* #undef STAT_MACROS_BROKEN */
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#define TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "4.0.18"
|
||||
|
||||
/* Define to 1 if your processor stores words with the most significant byte
|
||||
first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
/* #undef WORDS_BIGENDIAN */
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
/* Define to make fseeko etc. visible, on some hosts. */
|
||||
/* #undef _LARGEFILE_SOURCE */
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
/* #undef _LARGE_FILES */
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
/* #undef const */
|
||||
|
||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||
if it is not supported. */
|
||||
/* #undef inline */
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
/* #undef off_t */
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
/* #undef size_t */
|
93
dlls/csx_sql/extra/include/mysql/my_dbug.h
Executable file
93
dlls/csx_sql/extra/include/mysql/my_dbug.h
Executable file
@ -0,0 +1,93 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _dbug_h
|
||||
#define _dbug_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#if !defined(DBUG_OFF) && !defined(_lint)
|
||||
extern int _db_on_,_no_db_;
|
||||
extern FILE *_db_fp_;
|
||||
extern char *_db_process_;
|
||||
extern int _db_keyword_(const char *keyword);
|
||||
extern void _db_setjmp_(void);
|
||||
extern void _db_longjmp_(void);
|
||||
extern void _db_push_(const char *control);
|
||||
extern void _db_pop_(void);
|
||||
extern void _db_enter_(const char *_func_,const char *_file_,uint _line_,
|
||||
const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_, char ***);
|
||||
extern void _db_return_(uint _line_,const char **_sfunc_,const char **_sfile_,
|
||||
uint *_slevel_);
|
||||
extern void _db_pargs_(uint _line_,const char *keyword);
|
||||
extern void _db_doprnt_ _VARARGS((const char *format,...));
|
||||
extern void _db_dump_(uint _line_,const char *keyword,const char *memory,
|
||||
uint length);
|
||||
extern void _db_lock_file();
|
||||
extern void _db_unlock_file();
|
||||
|
||||
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
|
||||
char **_db_framep_; \
|
||||
_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_, \
|
||||
&_db_framep_)
|
||||
#define DBUG_LEAVE \
|
||||
(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
|
||||
#define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}
|
||||
#define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
|
||||
#define DBUG_EXECUTE(keyword,a1) \
|
||||
{if (_db_on_) {if (_db_keyword_ (keyword)) { a1 }}}
|
||||
#define DBUG_PRINT(keyword,arglist) \
|
||||
{if (_db_on_) {_db_pargs_(__LINE__,keyword); _db_doprnt_ arglist;}}
|
||||
#define DBUG_PUSH(a1) _db_push_ (a1)
|
||||
#define DBUG_POP() _db_pop_ ()
|
||||
#define DBUG_PROCESS(a1) (_db_process_ = a1)
|
||||
#define DBUG_FILE (_db_fp_)
|
||||
#define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
|
||||
#define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
|
||||
#define DBUG_DUMP(keyword,a1,a2)\
|
||||
{if (_db_on_) {_db_dump_(__LINE__,keyword,a1,a2);}}
|
||||
#define DBUG_IN_USE (_db_fp_ && _db_fp_ != stderr)
|
||||
#define DEBUGGER_OFF _no_db_=1;_db_on_=0;
|
||||
#define DEBUGGER_ON _no_db_=0
|
||||
#define DBUG_LOCK_FILE { _db_lock_file(); }
|
||||
#define DBUG_UNLOCK_FILE { _db_unlock_file(); }
|
||||
#define DBUG_ASSERT(A) assert(A)
|
||||
#else /* No debugger */
|
||||
|
||||
#define DBUG_ENTER(a1)
|
||||
#define DBUG_RETURN(a1) return(a1)
|
||||
#define DBUG_VOID_RETURN return
|
||||
#define DBUG_EXECUTE(keyword,a1) {}
|
||||
#define DBUG_PRINT(keyword,arglist) {}
|
||||
#define DBUG_PUSH(a1) {}
|
||||
#define DBUG_POP() {}
|
||||
#define DBUG_PROCESS(a1) {}
|
||||
#define DBUG_FILE (stderr)
|
||||
#define DBUG_SETJMP setjmp
|
||||
#define DBUG_LONGJMP longjmp
|
||||
#define DBUG_DUMP(keyword,a1,a2) {}
|
||||
#define DBUG_IN_USE 0
|
||||
#define DEBUGGER_OFF
|
||||
#define DEBUGGER_ON
|
||||
#define DBUG_LOCK_FILE
|
||||
#define DBUG_UNLOCK_FILE
|
||||
#define DBUG_ASSERT(A) {}
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
106
dlls/csx_sql/extra/include/mysql/my_dir.h
Executable file
106
dlls/csx_sql/extra/include/mysql/my_dir.h
Executable file
@ -0,0 +1,106 @@
|
||||
/* Copyright (C) 2000 MySQL AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
#ifndef _my_dir_h
|
||||
#define _my_dir_h
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef MY_DIR_H
|
||||
#define MY_DIR_H
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
/* Defines for my_dir and my_stat */
|
||||
|
||||
#define MY_S_IFMT S_IFMT /* type of file */
|
||||
#define MY_S_IFDIR S_IFDIR /* directory */
|
||||
#define MY_S_IFCHR S_IFCHR /* character special */
|
||||
#define MY_S_IFBLK S_IFBLK /* block special */
|
||||
#define MY_S_IFREG S_IFREG /* regular */
|
||||
#define MY_S_IFIFO S_IFIFO /* fifo */
|
||||
#define MY_S_ISUID S_ISUID /* set user id on execution */
|
||||
#define MY_S_ISGID S_ISGID /* set group id on execution */
|
||||
#define MY_S_ISVTX S_ISVTX /* save swapped text even after use */
|
||||
#define MY_S_IREAD S_IREAD /* read permission, owner */
|
||||
#define MY_S_IWRITE S_IWRITE /* write permission, owner */
|
||||
#define MY_S_IEXEC S_IEXEC /* execute/search permission, owner */
|
||||
|
||||
#define MY_S_ISDIR(m) (((m) & MY_S_IFMT) == MY_S_IFDIR)
|
||||
#define MY_S_ISCHR(m) (((m) & MY_S_IFMT) == MY_S_IFCHR)
|
||||
#define MY_S_ISBLK(m) (((m) & MY_S_IFMT) == MY_S_IFBLK)
|
||||
#define MY_S_ISREG(m) (((m) & MY_S_IFMT) == MY_S_IFREG)
|
||||
#define MY_S_ISFIFO(m) (((m) & MY_S_IFMT) == MY_S_IFIFO)
|
||||
|
||||
#define MY_DONT_SORT 512 /* my_lib; Don't sort files */
|
||||
#define MY_WANT_STAT 1024 /* my_lib; stat files */
|
||||
|
||||
/* typedefs for my_dir & my_stat */
|
||||
|
||||
#ifdef USE_MY_STAT_STRUCT
|
||||
|
||||
typedef struct my_stat
|
||||
{
|
||||
dev_t st_dev; /* major & minor device numbers */
|
||||
ino_t st_ino; /* inode number */
|
||||
ushort st_mode; /* file permissons (& suid sgid .. bits) */
|
||||
short st_nlink; /* number of links to file */
|
||||
ushort st_uid; /* user id */
|
||||
ushort st_gid; /* group id */
|
||||
dev_t st_rdev; /* more major & minor device numbers (???) */
|
||||
off_t st_size; /* size of file */
|
||||
time_t st_atime; /* time for last read */
|
||||
time_t st_mtime; /* time for last contens modify */
|
||||
time_t st_ctime; /* time for last inode or contents modify */
|
||||
} MY_STAT;
|
||||
|
||||
#else
|
||||
|
||||
#define MY_STAT struct stat /* Orginal struct have what we need */
|
||||
|
||||
#endif /* USE_MY_STAT_STRUCT */
|
||||
|
||||
/* Struct describing one file returned from my_dir */
|
||||
typedef struct fileinfo
|
||||
{
|
||||
char *name;
|
||||
MY_STAT *mystat;
|
||||
} FILEINFO;
|
||||
|
||||
typedef struct st_my_dir /* Struct returned from my_dir */
|
||||
{
|
||||
/*
|
||||
These members are just copies of parts of DYNAMIC_ARRAY structure,
|
||||
which is allocated right after the end of MY_DIR structure (MEM_ROOT
|
||||
for storing names is also resides there). We've left them here because
|
||||
we don't want to change code that uses my_dir.
|
||||
*/
|
||||
struct fileinfo *dir_entry;
|
||||
uint number_off_files;
|
||||
} MY_DIR;
|
||||
|
||||
extern MY_DIR *my_dir(const char *path,myf MyFlags);
|
||||
extern void my_dirend(MY_DIR *buffer);
|
||||
extern MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags);
|
||||
extern int my_fstat(int filenr, MY_STAT *stat_area, myf MyFlags);
|
||||
|
||||
#endif /* MY_DIR_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
54
dlls/csx_sql/extra/include/mysql/my_getopt.h
Executable file
54
dlls/csx_sql/extra/include/mysql/my_getopt.h
Executable file
@ -0,0 +1,54 @@
|
||||
/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||
|
||||
C_MODE_START
|
||||
|
||||
enum get_opt_var_type { GET_NO_ARG, GET_BOOL, GET_INT, GET_UINT, GET_LONG,
|
||||
GET_ULONG, GET_LL, GET_ULL, GET_STR, GET_STR_ALLOC };
|
||||
enum get_opt_arg_type { NO_ARG, OPT_ARG, REQUIRED_ARG };
|
||||
|
||||
struct my_option
|
||||
{
|
||||
const char *name; /* Name of the option */
|
||||
int id; /* unique id or short option */
|
||||
const char *comment; /* option comment, for autom. --help */
|
||||
gptr *value; /* The variable value */
|
||||
gptr *u_max_value; /* The user def. max variable value */
|
||||
const char **str_values; /* Pointer to possible values */
|
||||
enum get_opt_var_type var_type;
|
||||
enum get_opt_arg_type arg_type;
|
||||
longlong def_value; /* Default value */
|
||||
longlong min_value; /* Min allowed value */
|
||||
longlong max_value; /* Max allowed value */
|
||||
longlong sub_size; /* Subtract this from given value */
|
||||
long block_size; /* Value should be a mult. of this */
|
||||
int app_type; /* To be used by an application */
|
||||
};
|
||||
|
||||
extern char *disabled_my_option;
|
||||
extern my_bool my_getopt_print_errors;
|
||||
|
||||
extern int handle_options (int *argc, char ***argv,
|
||||
const struct my_option *longopts,
|
||||
my_bool (*get_one_option)(int,
|
||||
const struct my_option *,
|
||||
char *));
|
||||
extern void my_print_help(const struct my_option *options);
|
||||
extern void my_print_variables(const struct my_option *options);
|
||||
|
||||
ulonglong getopt_ull_limit_value(ulonglong num, const struct my_option *optp);
|
||||
my_bool getopt_compare_strings(const char *s, const char *t, uint length);
|
||||
C_MODE_END
|
1138
dlls/csx_sql/extra/include/mysql/my_global.h
Executable file
1138
dlls/csx_sql/extra/include/mysql/my_global.h
Executable file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user