public/mms_sample_ext/sm_sdk_config.cpp
author Scott Ehlert <ds@alliedmods.net>
Sun Mar 30 07:00:22 2008 +0000 (2008-03-30)
changeset 1952 b7aa2b626807
child 1990 de135d1f05b1
permissions -rw-r--r--
Spring Cleaning, Part Ichi (1)
Various minor things done to project files
Updated sample extension project file and updated makefile to the new unified version (more changes likely on the way)
Updated regex project file and makefile
ds@1952
     1
#include "sm_sdk_config.h"
ds@1952
     2
ds@1952
     3
using namespace SourceMod;
ds@1952
     4
ds@1952
     5
bool SM_AcquireInterfaces(char *error, size_t maxlength)
ds@1952
     6
{
ds@1952
     7
	SM_FIND_IFACE_OR_FAIL(SOURCEMOD, sm_main, error, maxlength);
ds@1952
     8
ds@1952
     9
#if defined SMEXT_ENABLE_FORWARDSYS
ds@1952
    10
	SM_FIND_IFACE_OR_FAIL(FORWARDMANAGER, sm_forwards, error, maxlength);
ds@1952
    11
#endif
ds@1952
    12
#if defined SMEXT_ENABLE_HANDLESYS
ds@1952
    13
	SM_FIND_IFACE_OR_FAIL(HANDLESYSTEM, sm_handlesys, error, maxlength);
ds@1952
    14
#endif
ds@1952
    15
#if defined SMEXT_ENABLE_PLAYERHELPERS
ds@1952
    16
	SM_FIND_IFACE_OR_FAIL(PLAYERMANAGER, sm_players, error, maxlength);
ds@1952
    17
#endif
ds@1952
    18
#if defined SMEXT_ENABLE_DBMANAGER
ds@1952
    19
	SM_FIND_IFACE_OR_FAIL(DBI, sm_dbi, error, maxlength);
ds@1952
    20
#endif 
ds@1952
    21
#if defined SMEXT_ENABLE_GAMECONF
ds@1952
    22
	SM_FIND_IFACE_OR_FAIL(GAMECONFIG, sm_gameconfs, error, maxlength);
ds@1952
    23
#endif
ds@1952
    24
#if defined SMEXT_ENABLE_MEMUTILS
ds@1952
    25
	SM_FIND_IFACE_OR_FAIL(MEMORYUTILS, sm_memutils, error, maxlength);
ds@1952
    26
#endif
ds@1952
    27
#if defined SMEXT_ENABLE_GAMEHELPERS
ds@1952
    28
	SM_FIND_IFACE_OR_FAIL(GAMEHELPERS, sm_gamehelpers, error, maxlength);
ds@1952
    29
#endif
ds@1952
    30
#if defined SMEXT_ENABLE_TIMERSYS
ds@1952
    31
	SM_FIND_IFACE_OR_FAIL(TIMERSYS, sm_timersys, error, maxlength);
ds@1952
    32
#endif
ds@1952
    33
#if defined SMEXT_ENABLE_THREADER
ds@1952
    34
	SM_FIND_IFACE_OR_FAIL(THREADER, sm_threader, error, maxlength);
ds@1952
    35
#endif
ds@1952
    36
#if defined SMEXT_ENABLE_LIBSYS
ds@1952
    37
	SM_FIND_IFACE_OR_FAIL(LIBRARYSYS, sm_libsys, error, maxlength);
ds@1952
    38
#endif
ds@1952
    39
#if defined SMEXT_ENABLE_PLUGINSYS
ds@1952
    40
	SM_FIND_IFACE_OR_FAIL(PLUGINSYSTEM, sm_plsys, error, maxlength);
ds@1952
    41
#endif 
ds@1952
    42
#if defined SMEXT_ENABLE_MENUS
ds@1952
    43
	SM_FIND_IFACE_OR_FAIL(MENUMANAGER, sm_menus, error, maxlength);
ds@1952
    44
#endif
ds@1952
    45
#if defined SMEXT_ENABLE_ADMINSYS
ds@1952
    46
	SM_FIND_IFACE_OR_FAIL(ADMINSYS, sm_adminsys, error, maxlength);
ds@1952
    47
#endif
ds@1952
    48
#if defined SMEXT_ENABLE_TEXTPARSERS
ds@1952
    49
	SM_FIND_IFACE_OR_FAIL(TEXTPARSERS, sm_text, error, maxlength);
ds@1952
    50
#endif
ds@1952
    51
ds@1952
    52
	return true;
ds@1952
    53
}
ds@1952
    54
ds@1952
    55
void SM_UnsetInterfaces()
ds@1952
    56
{
ds@1952
    57
	myself = NULL;
ds@1952
    58
	smexts = NULL;
ds@1952
    59
	sharesys = NULL;
ds@1952
    60
	sm_main = NULL;
ds@1952
    61
#if defined SMEXT_ENABLE_FORWARDSYS
ds@1952
    62
	sm_forwards = NULL;
ds@1952
    63
#endif
ds@1952
    64
#if defined SMEXT_ENABLE_HANDLESYS
ds@1952
    65
	sm_handlesys = NULL;
ds@1952
    66
#endif
ds@1952
    67
#if defined SMEXT_ENABLE_PLAYERHELPERS
ds@1952
    68
	sm_players = NULL;
ds@1952
    69
#endif
ds@1952
    70
#if defined SMEXT_ENABLE_DBMANAGER
ds@1952
    71
	sm_dbi = NULL;
ds@1952
    72
#endif 
ds@1952
    73
#if defined SMEXT_ENABLE_GAMECONF
ds@1952
    74
	sm_gameconfs = NULL;
ds@1952
    75
#endif
ds@1952
    76
#if defined SMEXT_ENABLE_MEMUTILS
ds@1952
    77
	sm_memutils = NULL;
ds@1952
    78
#endif
ds@1952
    79
#if defined SMEXT_ENABLE_GAMEHELPERS
ds@1952
    80
	sm_gamehelpers = NULL;
ds@1952
    81
#endif
ds@1952
    82
#if defined SMEXT_ENABLE_TIMERSYS
ds@1952
    83
	sm_timersys = NULL;
ds@1952
    84
#endif
ds@1952
    85
#if defined SMEXT_ENABLE_THREADER
ds@1952
    86
	sm_threader = NULL;
ds@1952
    87
#endif
ds@1952
    88
#if defined SMEXT_ENABLE_LIBSYS
ds@1952
    89
	sm_libsys = NULL;
ds@1952
    90
#endif
ds@1952
    91
#if defined SMEXT_ENABLE_PLUGINSYS
ds@1952
    92
	sm_plsys = NULL;
ds@1952
    93
#endif 
ds@1952
    94
#if defined SMEXT_ENABLE_MENUS
ds@1952
    95
	sm_menus = NULL;
ds@1952
    96
#endif
ds@1952
    97
#if defined SMEXT_ENABLE_ADMINSYS
ds@1952
    98
	sm_adminsys = NULL;
ds@1952
    99
#endif
ds@1952
   100
#if defined SMEXT_ENABLE_TEXTPARSERS
ds@1952
   101
	sm_text = NULL;
ds@1952
   102
#endif
ds@1952
   103
}
ds@1952
   104
ds@1952
   105
IExtension *myself = NULL;
ds@1952
   106
IExtensionManager *smexts = NULL;
ds@1952
   107
IShareSys *sharesys = NULL;
ds@1952
   108
SourceMod::ISourceMod *sm_main = NULL;
ds@1952
   109
#if defined SMEXT_ENABLE_FORWARDSYS
ds@1952
   110
SourceMod::IForwardManager *sm_forwards = NULL;
ds@1952
   111
#endif
ds@1952
   112
#if defined SMEXT_ENABLE_HANDLESYS
ds@1952
   113
SourceMod::IHandleSys *sm_handlesys = NULL;
ds@1952
   114
#endif
ds@1952
   115
#if defined SMEXT_ENABLE_PLAYERHELPERS
ds@1952
   116
SourceMod::IPlayerManager *sm_players = NULL;
ds@1952
   117
#endif
ds@1952
   118
#if defined SMEXT_ENABLE_DBMANAGER
ds@1952
   119
SourceMod::IDBManager *sm_dbi = NULL;
ds@1952
   120
#endif 
ds@1952
   121
#if defined SMEXT_ENABLE_GAMECONF
ds@1952
   122
SourceMod::IGameConfigManager *sm_gameconfs = NULL;
ds@1952
   123
#endif
ds@1952
   124
#if defined SMEXT_ENABLE_MEMUTILS
ds@1952
   125
SourceMod::IMemoryUtils *sm_memutils = NULL;
ds@1952
   126
#endif
ds@1952
   127
#if defined SMEXT_ENABLE_GAMEHELPERS
ds@1952
   128
SourceMod::IGameHelpers *sm_gamehelpers = NULL;
ds@1952
   129
#endif
ds@1952
   130
#if defined SMEXT_ENABLE_TIMERSYS
ds@1952
   131
SourceMod::ITimerSystem *sm_timersys = NULL;
ds@1952
   132
#endif
ds@1952
   133
#if defined SMEXT_ENABLE_THREADER
ds@1952
   134
SourceMod::IThreader *sm_threader = NULL;
ds@1952
   135
#endif
ds@1952
   136
#if defined SMEXT_ENABLE_LIBSYS
ds@1952
   137
SourceMod::ILibrarySys *sm_libsys = NULL;
ds@1952
   138
#endif
ds@1952
   139
#if defined SMEXT_ENABLE_PLUGINSYS
ds@1952
   140
SourceMod::IPluginManager *sm_plsys = NULL;
ds@1952
   141
#endif 
ds@1952
   142
#if defined SMEXT_ENABLE_MENUS
ds@1952
   143
SourceMod::IMenuManager *sm_menus = NULL;
ds@1952
   144
#endif
ds@1952
   145
#if defined SMEXT_ENABLE_ADMINSYS
ds@1952
   146
SourceMod::IAdminSystem *sm_adminsys = NULL;
ds@1952
   147
#endif
ds@1952
   148
#if defined SMEXT_ENABLE_TEXTPARSERS
ds@1952
   149
SourceMod::ITextParsers *sm_text = NULL;
ds@1952
   150
#endif
ds@1952
   151