1.1 --- a/core/vm/sp_vm_basecontext.h Fri Jan 19 05:48:08 2007 +0000
1.2 +++ b/core/vm/sp_vm_basecontext.h Fri Jan 19 08:22:44 2007 +0000
1.3 @@ -2,6 +2,11 @@
1.4 #define _INCLUDE_SOURCEPAWN_BASECONTEXT_H_
1.5
1.6 #include "sp_vm_api.h"
1.7 +#include "sp_vm_function.h"
1.8 +
1.9 +/**
1.10 + * :TODO: Make functions allocate as a lump instead of individual allocations!
1.11 + */
1.12
1.13 namespace SourcePawn
1.14 {
1.15 @@ -11,6 +16,7 @@
1.16 {
1.17 public:
1.18 BaseContext(sp_context_t *ctx);
1.19 + ~BaseContext();
1.20 public: //IPluginContext
1.21 IVirtualMachine *GetVirtualMachine();
1.22 sp_context_t *GetContext();
1.23 @@ -44,9 +50,13 @@
1.24 virtual int Execute(funcid_t funcid, cell_t *result);
1.25 virtual void ThrowNativeErrorEx(int error, const char *msg, ...);
1.26 virtual cell_t ThrowNativeError(const char *msg, ...);
1.27 + virtual IPluginFunction *GetFunctionByName(const char *public_name);
1.28 + virtual IPluginFunction *GetFunctionById(funcid_t func_id);
1.29 #if defined SOURCEMOD_BUILD
1.30 virtual SourceMod::IdentityToken_t *GetIdentity();
1.31 void SetIdentity(SourceMod::IdentityToken_t *token);
1.32 + bool IsRunnable();
1.33 + void SetRunnable(bool runnable);
1.34 #endif
1.35 public: //IPluginDebugInfo
1.36 virtual int LookupFile(ucell_t addr, const char **filename);
1.37 @@ -56,6 +66,7 @@
1.38 void SetContext(sp_context_t *_ctx);
1.39 private:
1.40 void SetErrorMessage(const char *msg, va_list ap);
1.41 + void FlushFunctionCache();
1.42 private:
1.43 sp_context_t *ctx;
1.44 #if defined SOURCEMOD_BUILD
1.45 @@ -64,6 +75,10 @@
1.46 char m_MsgCache[1024];
1.47 bool m_CustomMsg;
1.48 bool m_InExec;
1.49 + bool m_Runnable;
1.50 + unsigned int m_funcsnum;
1.51 + CFunction **m_priv_funcs;
1.52 + CFunction **m_pub_funcs;
1.53 };
1.54 };
1.55