1 #ifndef _INCLUDE_SOURCEMOD_BASEFUNCTION_H_
2 #define _INCLUDE_SOURCEMOD_BASEFUNCTION_H_
4 #include <IPluginFunction.h>
5 #include "sm_globals.h"
9 int flags; /* Copy-back flags */
10 bool marked; /* Whether this is marked as being used */
11 cell_t local_addr; /* Local address to free */
12 cell_t *phys_addr; /* Physical address of our copy */
13 cell_t *orig_addr; /* Original address to copy back to */
14 ucell_t size; /* Size of array in cells */
19 class CFunction : public IPluginFunction
22 CFunction(funcid_t funcid, CPlugin *plugin);
24 virtual int PushCell(cell_t cell);
25 virtual int PushCellByRef(cell_t *cell, int flags);
26 virtual int PushFloat(float number);
27 virtual int PushFloatByRef(float *number, int flags);
28 virtual int PushCells(cell_t array[], unsigned int numcells, bool each);
29 virtual int PushArray(cell_t *inarray, unsigned int cells, cell_t **phys_addr, int copyback);
30 virtual int PushString(const char *string);
31 virtual int PushStringByRef(char *string, int flags);
32 virtual cell_t *GetAddressOfPushedParam(unsigned int param);
33 virtual int Execute(cell_t *result, IFunctionCopybackReader *reader);
34 virtual void Cancel();
35 virtual int CallFunction(const cell_t *params, unsigned int num_params, cell_t *result);
36 virtual IPlugin *GetParentPlugin();
38 void Set(funcid_t funcid, CPlugin *plugin);
40 int _PushString(const char *string, int flags);
41 inline int SetError(int err)
49 cell_t m_params[SP_MAX_EXEC_PARAMS];
50 ParamInfo m_info[SP_MAX_EXEC_PARAMS];
51 unsigned int m_curparam;
55 #endif //_INCLUDE_SOURCEMOD_BASEFUNCTION_H_