Fixed warning when building stub_mm plugin.
4 // trace_api.h - (main) description of HL API tracing operations
9 * This file is part of Metamod.
11 * Metamod is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the
13 * Free Software Foundation; either version 2 of the License, or (at
14 * your option) any later version.
16 * Metamod is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with Metamod; if not, write to the Free Software Foundation,
23 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * In addition, as a special exception, the author gives permission to
26 * link the code of this program with the Half-Life Game Engine ("HL
27 * Engine") and Modified Game Libraries ("MODs") developed by Valve,
28 * L.L.C ("Valve"). You must obey the GNU General Public License in all
29 * respects for all of the code used other than the HL Engine and MODs
30 * from Valve. If you modify this file, you may extend this exception
31 * to your version of the file, but you are not obligated to do so. If
32 * you do not wish to do so, delete this exception statement from your
40 #include <time.h> // time()
42 #include <enginecallback.h> // ALERT()
43 #include <sdk_util.h> // UTIL_VarArgs()
47 #define API_TRACE(api_info_table, cvar_trace, api_str, pfnName, post, args) \
48 do { if((cvar_trace->value >= api_info_table.pfnName.loglevel || api_info_table.pfnName.trace) && (unlimit_trace->value || (last_trace_log != time(NULL)))) { \
49 ALERT(at_logged, "[%s] %s(%d): called: %s%s; %s\n", \
50 Plugin_info.logtag, api_str, \
51 api_info_table.pfnName.loglevel, \
52 api_info_table.pfnName.name, \
53 (post ? "_Post" : ""), \
54 UTIL_VarArgs args ); \
55 last_trace_log=time(NULL); \
59 #define DLL_TRACE(pfnName, post, args) \
60 API_TRACE(dllapi_info, dllapi_trace, "dllapi", pfnName, post, args)
62 #define NEWDLL_TRACE(pfnName, post, args) \
63 API_TRACE(newapi_info, newapi_trace, "newapi", pfnName, post, args)
65 #define ENGINE_TRACE(pfnName, post, args) \
66 API_TRACE(engine_info, engine_trace, "engine", pfnName, post, args)
74 #define MAX_REG_MESSAGES 256
76 extern time_t last_trace_log;
78 extern const char *msg_dest_types[32];
80 extern cvar_t init_dllapi_trace;
81 extern cvar_t init_newapi_trace;
82 extern cvar_t init_engine_trace;
83 extern cvar_t init_unlimit_trace;
85 extern cvar_t *dllapi_trace;
86 extern cvar_t *newapi_trace;
87 extern cvar_t *engine_trace;
88 extern cvar_t *unlimit_trace;
90 void trace_init(void);
93 void cmd_trace_usage(void);
94 void cmd_trace_version(void);
95 void cmd_trace_set(void);
96 void cmd_trace_unset(void);
97 void cmd_trace_show(void);
98 void cmd_trace_list(void);
100 TRACE_RESULT trace_setflag(const char **pfn_string, mBOOL flagval, const char **api);
102 #endif /* TRACE_API_H */