-
Notifications
You must be signed in to change notification settings - Fork 0
/
think_hooks.inc
54 lines (48 loc) · 1.17 KB
/
think_hooks.inc
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
/*
**
*/
#if defined _think_hooks_included
#endinput
#endif
#define _think_hooks_included
#define THINK_HOOKS_LIB_NAME "think_hooks" /**< You can use this macro to check ``LibraryExists(THINK_HOOKS_LIB_NAME)`` */
/**
* Called before every server think. Note that you should avoid
* doing expensive computations or declaring large local arrays.
*
*/
forward void OnServerThink();
/**
* Defines a RequestThink Callback.
*
* @param a_data Data passed to the RequestThink native.
*/
typedef RequestThinkCallback = function void (any a_data);
/**
* Creates a single use Next Think hook.
*
* @param f_function Function to call on the next think call.
* @param a_data Value to be passed on the invocation of the Function.
*/
native void RequestThink(RequestThinkCallback f_function, any a_data = 0);
#if !defined REQUIRE_EXTENSIONS
public __ext_think_hooks_SetNTVOptional()
{
MarkNativeAsOptional("RequestThink");
}
#endif
public Extension __ext_think_hooks =
{
name = THINK_HOOKS_LIB_NAME,
file = THINK_HOOKS_LIB_NAME...".ext",
#if defined AUTOLOAD_EXTENSIONS
autoload = 1,
#else
autoload = 0,
#endif
#if defined REQUIRE_EXTENSIONS
required = 1,
#else
required = 0,
#endif
};