-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugincommon.h
118 lines (103 loc) · 3.49 KB
/
plugincommon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//----------------------------------------------------------
//
// SA-MP Multiplayer Modification For GTA:SA
// Copyright 2004-2009 SA-MP Team
//
//----------------------------------------------------------
#pragma once
//----------------------------------------------------------
#define SAMP_PLUGIN_VERSION 0x0200
//----------------------------------------------------------
#ifdef __cplusplus
#define PLUGIN_EXTERN_C extern "C"
#else
#define PLUGIN_EXTERN_C
#endif
#if defined(__LINUX__) || defined(__FreeBSD__) || defined(__OpenBSD__)
#ifndef __GNUC__
#pragma message "Warning: Not using a GNU compiler."
#endif
#define PLUGIN_CALL
#ifndef SAMPSVR
// Compile code with -fvisibility=hidden to hide non-exported functions.
#define PLUGIN_EXPORT PLUGIN_EXTERN_C __attribute__((visibility("default")))
#else
#define PLUGIN_EXPORT PLUGIN_EXTERN_C
#endif
#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#ifndef _MSC_VER
#pragma message "Warning: Not using a VC++ compiler."
#endif
#define PLUGIN_CALL __stdcall
#define PLUGIN_EXPORT PLUGIN_EXTERN_C
#else
#error "You must define one of WIN32, LINUX or FREEBSD"
#endif
//----------------------------------------------------------
enum SUPPORTS_FLAGS
{
SUPPORTS_VERSION = SAMP_PLUGIN_VERSION,
SUPPORTS_VERSION_MASK = 0xffff,
SUPPORTS_AMX_NATIVES = 0x10000,
SUPPORTS_PROCESS_TICK = 0x20000
};
//----------------------------------------------------------
enum PLUGIN_DATA_TYPE
{
// For some debugging
PLUGIN_DATA_LOGPRINTF = 0x00, // void (*logprintf)(char* format, ...)
// AMX
PLUGIN_DATA_AMX_EXPORTS = 0x10, // void* AmxFunctionTable[] (see PLUGIN_AMX_EXPORT)
PLUGIN_DATA_CALLPUBLIC_FS = 0x11, // int (*AmxCallPublicFilterScript)(char *szFunctionName)
PLUGIN_DATA_CALLPUBLIC_GM = 0x12, // int (*AmxCallPublicGameMode)(char *szFunctionName)
};
//----------------------------------------------------------
enum PLUGIN_AMX_EXPORT
{
PLUGIN_AMX_EXPORT_Align16 = 0,
PLUGIN_AMX_EXPORT_Align32 = 1,
PLUGIN_AMX_EXPORT_Align64 = 2,
PLUGIN_AMX_EXPORT_Allot = 3,
PLUGIN_AMX_EXPORT_Callback = 4,
PLUGIN_AMX_EXPORT_Cleanup = 5,
PLUGIN_AMX_EXPORT_Clone = 6,
PLUGIN_AMX_EXPORT_Exec = 7,
PLUGIN_AMX_EXPORT_FindNative = 8,
PLUGIN_AMX_EXPORT_FindPublic = 9,
PLUGIN_AMX_EXPORT_FindPubVar = 10,
PLUGIN_AMX_EXPORT_FindTagId = 11,
PLUGIN_AMX_EXPORT_Flags = 12,
PLUGIN_AMX_EXPORT_GetAddr = 13,
PLUGIN_AMX_EXPORT_GetNative = 14,
PLUGIN_AMX_EXPORT_GetPublic = 15,
PLUGIN_AMX_EXPORT_GetPubVar = 16,
PLUGIN_AMX_EXPORT_GetString = 17,
PLUGIN_AMX_EXPORT_GetTag = 18,
PLUGIN_AMX_EXPORT_GetUserData = 19,
PLUGIN_AMX_EXPORT_Init = 20,
PLUGIN_AMX_EXPORT_InitJIT = 21,
PLUGIN_AMX_EXPORT_MemInfo = 22,
PLUGIN_AMX_EXPORT_NameLength = 23,
PLUGIN_AMX_EXPORT_NativeInfo = 24,
PLUGIN_AMX_EXPORT_NumNatives = 25,
PLUGIN_AMX_EXPORT_NumPublics = 26,
PLUGIN_AMX_EXPORT_NumPubVars = 27,
PLUGIN_AMX_EXPORT_NumTags = 28,
PLUGIN_AMX_EXPORT_Push = 29,
PLUGIN_AMX_EXPORT_PushArray = 30,
PLUGIN_AMX_EXPORT_PushString = 31,
PLUGIN_AMX_EXPORT_RaiseError = 32,
PLUGIN_AMX_EXPORT_Register = 33,
PLUGIN_AMX_EXPORT_Release = 34,
PLUGIN_AMX_EXPORT_SetCallback = 35,
PLUGIN_AMX_EXPORT_SetDebugHook = 36,
PLUGIN_AMX_EXPORT_SetString = 37,
PLUGIN_AMX_EXPORT_SetUserData = 38,
PLUGIN_AMX_EXPORT_StrLen = 39,
PLUGIN_AMX_EXPORT_UTF8Check = 40,
PLUGIN_AMX_EXPORT_UTF8Get = 41,
PLUGIN_AMX_EXPORT_UTF8Len = 42,
PLUGIN_AMX_EXPORT_UTF8Put = 43,
};
//----------------------------------------------------------
// EOF