1.1 --- a/core/smn_core.cpp Thu Sep 13 16:46:36 2007 +0000
1.2 +++ b/core/smn_core.cpp Thu Sep 13 17:21:41 2007 +0000
1.3 @@ -41,6 +41,7 @@
1.4 #include "TimerSys.h"
1.5 #include "ForwardSys.h"
1.6 #include "Logger.h"
1.7 +#include "ExtensionSys.h"
1.8
1.9 #if defined PLATFORM_WINDOWS
1.10 #include <windows.h>
1.11 @@ -549,6 +550,33 @@
1.12 return 1;
1.13 }
1.14
1.15 +static cell_t GetExtensionFileStatus(IPluginContext *pContext, const cell_t *params)
1.16 +{
1.17 + char *str;
1.18 + pContext->LocalToString(params[1], &str);
1.19 +
1.20 + IExtension *pExtension = g_Extensions.FindExtensionByFile(str);
1.21 +
1.22 + if (!pExtension)
1.23 + {
1.24 + return -2;
1.25 + }
1.26 +
1.27 + if (!pExtension->IsLoaded())
1.28 + {
1.29 + return -1;
1.30 + }
1.31 +
1.32 + char *error;
1.33 + pContext->LocalToString(params[2], &error);
1.34 + if (!pExtension->IsRunning(error, params[3]))
1.35 + {
1.36 + return 0;
1.37 + }
1.38 +
1.39 + return 1;
1.40 +}
1.41 +
1.42 REGISTER_NATIVES(coreNatives)
1.43 {
1.44 {"AutoExecConfig", AutoExecConfig},
1.45 @@ -570,5 +598,7 @@
1.46 {"LogAction", sm_LogAction},
1.47 {"LogToFile", LogToFile},
1.48 {"LogToFileEx", LogToFileEx},
1.49 + {"GetExtensionFileStatus", GetExtensionFileStatus},
1.50 {NULL, NULL},
1.51 };
1.52 +