Added macro so that ConCommands created with the SDK's CON_COMMAND and CON_COMMAND_F macros can be properly registered and unregisterd
1 /* ======== SourceMM ========
2 * Copyright (C) 2004-2005 Metamod:Source Development Team
3 * No warranties of any kind
7 * Author(s): David "BAILOPAN" Anderson
8 * ============================
11 #ifndef _INCLUDE_UTIL_H
12 #define _INCLUDE_UTIL_H
15 * @brief Utility functons
19 const char *UTIL_GetExtension(const char *file);
21 #define META_INTERFACE_MACRO(type, final) \
23 void *mret=NULL, *d; \
24 META_RES mres, high=MRES_IGNORED; \
25 g_SmmAPI.SetLastMetaReturn(MRES_IGNORED); \
26 for (i=g_PluginMngr._begin(); i!=g_PluginMngr._end(); i++) \
28 if ( (*i) && (*i)->fac_list. type ) \
30 d = ((*i)->fac_list. type)(name, ret); \
31 mres = g_SmmAPI.GetLastMetaReturn(); \
34 if (mres >= MRES_OVERRIDE) \
38 if (high == MRES_OVERRIDE) \
42 } else if (high == MRES_SUPERCEDE) { \
45 return (final)(name, ret); \
48 #endif //_INCLUDE_UTIL_H