SourcePawn::ISourcePawnEngine Class Reference

#include <sp_vm_api.h>

List of all members.


Detailed Description

Contains helper functions used by VMs and the host app.

Definition at line 438 of file sp_vm_api.h.

Public Member Functions

virtual sp_plugin_tLoadFromFilePointer (FILE *fp, int *err)=0
 Loads a named file from a file pointer. Note: Using this means the memory will be allocated by the VM.
virtual sp_plugin_tLoadFromMemory (void *base, sp_plugin_t *plugin, int *err)=0
 Loads a file from a base memory address.
virtual int FreeFromMemory (sp_plugin_t *plugin)=0
virtual void * BaseAlloc (size_t size)=0
 Allocates large blocks of temporary memory.
virtual void BaseFree (void *memory)=0
 Frees memory allocated with BaseAlloc.
virtual void * ExecAlloc (size_t size)=0
 Allocates executable memory.
virtual void ExecFree (void *address)=0
 Frees executable memory.
virtual IDebugListenerSetDebugListener (IDebugListener *listener)=0
 Sets the debug listener. This should only be called once. If called successively (using manual chaining), only the last function should attempt to call back into the same plugin. Otherwise, globally cached states can be accidentally overwritten.
virtual unsigned int GetContextCallCount ()=0
 Returns the number of plugins on the call stack.


Member Function Documentation

virtual sp_plugin_t* SourcePawn::ISourcePawnEngine::LoadFromFilePointer ( FILE *  fp,
int *  err 
) [pure virtual]

Loads a named file from a file pointer. Note: Using this means the memory will be allocated by the VM.

Parameters:
fp File pointer. May be at any offset. Not closed on return.
err Optional error code pointer.
Returns:
A new plugin structure.

virtual sp_plugin_t* SourcePawn::ISourcePawnEngine::LoadFromMemory ( void *  base,
sp_plugin_t plugin,
int *  err 
) [pure virtual]

Loads a file from a base memory address.

Parameters:
base Base address of the plugin's memory region.
plugin If NULL, a new plugin pointer is returned. Otherwise, the passed pointer is used.
err Optional error code pointer.
Returns:
The resulting plugin pointer.

virtual int SourcePawn::ISourcePawnEngine::FreeFromMemory ( sp_plugin_t plugin  )  [pure virtual]

Frees all of the memory associated with a plugin file. If allocated using SP_LoadFromMemory, the base and plugin pointer itself are not freed (so this may end up doing nothing).

virtual void* SourcePawn::ISourcePawnEngine::BaseAlloc ( size_t  size  )  [pure virtual]

Allocates large blocks of temporary memory.

Parameters:
size Size of memory to allocate.
Returns:
Pointer to memory, NULL if allocation failed.

virtual void SourcePawn::ISourcePawnEngine::BaseFree ( void *  memory  )  [pure virtual]

Frees memory allocated with BaseAlloc.

Parameters:
memory Memory address to free.

virtual void* SourcePawn::ISourcePawnEngine::ExecAlloc ( size_t  size  )  [pure virtual]

Allocates executable memory.

Parameters:
size Size of memory to allocate.
Returns:
Pointer to memory, NULL if allocation failed.

virtual void SourcePawn::ISourcePawnEngine::ExecFree ( void *  address  )  [pure virtual]

Frees executable memory.

Parameters:
address Address to free.

virtual IDebugListener* SourcePawn::ISourcePawnEngine::SetDebugListener ( IDebugListener listener  )  [pure virtual]

Sets the debug listener. This should only be called once. If called successively (using manual chaining), only the last function should attempt to call back into the same plugin. Otherwise, globally cached states can be accidentally overwritten.

Parameters:
listener Pointer to an IDebugListener.
Returns:
Old IDebugListener, or NULL if none.

virtual unsigned int SourcePawn::ISourcePawnEngine::GetContextCallCount (  )  [pure virtual]

Returns the number of plugins on the call stack.

Returns:
Number of contexts in the call stack.


The documentation for this class was generated from the following file:
Generated on Thu Jan 4 13:34:37 2007 for SourcePawn JIT by  doxygen 1.5.1-p1