Classes | Defines | Typedefs

public/sourcepawn/sp_vm_types.h File Reference

Contains all run-time SourcePawn structures. More...

#include "sp_file_headers.h"
#include "sp_typeutil.h"
Include dependency graph for sp_vm_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sp_public_s
 Offsets and names to a public function. More...
struct  sp_pubvar_s
 Offsets and names to public variables. More...
struct  sp_native_s
 Native lookup table, by default names point back to the sp_plugin_infotab_t structure. More...
struct  sp_nativeinfo_s
 Used for setting natives from modules/host apps. More...
struct  sp_debug_file_s
 Run-time debug file table. More...
struct  sp_debug_line_s
 Contains run-time debug line table. More...
struct  sp_debug_symbol_s
 The majority of this struct is already located in the parent block. Thus, only the relocated portions are required. More...

Defines

#define SP_MAX_EXEC_PARAMS   32
#define SP_JITCONF_DEBUG   "debug"
#define SP_JITCONF_PROFILE   "profile"
#define SP_PROF_NATIVES   (1<<0)
#define SP_PROF_CALLBACKS   (1<<1)
#define SP_PROF_FUNCTIONS   (1<<2)
#define SP_ERROR_NONE   0
 Error codes for SourcePawn routines.
#define SP_ERROR_FILE_FORMAT   1
#define SP_ERROR_DECOMPRESSOR   2
#define SP_ERROR_HEAPLOW   3
#define SP_ERROR_PARAM   4
#define SP_ERROR_INVALID_ADDRESS   5
#define SP_ERROR_NOT_FOUND   6
#define SP_ERROR_INDEX   7
#define SP_ERROR_STACKLOW   8
#define SP_ERROR_NOTDEBUGGING   9
#define SP_ERROR_INVALID_INSTRUCTION   10
#define SP_ERROR_MEMACCESS   11
#define SP_ERROR_STACKMIN   12
#define SP_ERROR_HEAPMIN   13
#define SP_ERROR_DIVIDE_BY_ZERO   14
#define SP_ERROR_ARRAY_BOUNDS   15
#define SP_ERROR_INSTRUCTION_PARAM   16
#define SP_ERROR_STACKLEAK   17
#define SP_ERROR_HEAPLEAK   18
#define SP_ERROR_ARRAY_TOO_BIG   19
#define SP_ERROR_TRACKER_BOUNDS   20
#define SP_ERROR_INVALID_NATIVE   21
#define SP_ERROR_PARAMS_MAX   22
#define SP_ERROR_NATIVE   23
#define SP_ERROR_NOT_RUNNABLE   24
#define SP_ERROR_ABORTED   25
#define SP_ERROR_CODE_TOO_OLD   26
#define SP_ERROR_CODE_TOO_NEW   27
#define SP_NATIVE_UNBOUND   (0)
#define SP_NATIVE_BOUND   (1)
#define SP_NTVFLAG_OPTIONAL   (1<<0)

Typedefs

typedef uint32_t ucell_t
typedef int32_t cell_t
typedef uint32_t funcid_t
typedef cell_t(* SPVM_NATIVE_FUNC )(SourcePawn::IPluginContext *, const cell_t *)
 Native callback prototype, passed a context and a parameter stack (0=count, 1+=args). A cell must be returned.
typedef cell_t(* SPVM_FAKENATIVE_FUNC )(SourcePawn::IPluginContext *, const cell_t *, void *)
 Fake native callback prototype, passed a context, parameter stack, and private data. A cell must be returned.
typedef struct sp_public_s sp_public_t
 Offsets and names to a public function.
typedef struct sp_pubvar_s sp_pubvar_t
 Offsets and names to public variables.
typedef struct sp_native_s sp_native_t
 Native lookup table, by default names point back to the sp_plugin_infotab_t structure.
typedef struct sp_nativeinfo_s sp_nativeinfo_t
 Used for setting natives from modules/host apps.
typedef struct sp_debug_file_s sp_debug_file_t
 Run-time debug file table.
typedef struct sp_debug_line_s sp_debug_line_t
 Contains run-time debug line table.
typedef sp_fdbg_arraydim_t sp_debug_arraydim_t
 These structures are equivalent.
typedef struct sp_debug_symbol_s sp_debug_symbol_t
 The majority of this struct is already located in the parent block. Thus, only the relocated portions are required.

Detailed Description

Contains all run-time SourcePawn structures.

vim: set ts=4 : ============================================================================= SourcePawn Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. =============================================================================

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3.0, as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

As a special exception, AlliedModders LLC gives you permission to link the code of this program (as well as its derivative works) to "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software by the Valve Corporation. You must obey the GNU General Public License in all respects for all other code used. Additionally, AlliedModders LLC grants this exception to all derivative works. AlliedModders LLC defines further exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), or <http://www.sourcemod.net/license.php>.

Version: $Id$

Definition in file sp_vm_types.h.


Define Documentation

#define SP_MAX_EXEC_PARAMS   32

Maximum number of parameters in a function

Definition at line 48 of file sp_vm_types.h.

#define SP_JITCONF_DEBUG   "debug"

Configuration option for debugging.

Definition at line 50 of file sp_vm_types.h.

#define SP_JITCONF_PROFILE   "profile"

Configuration option for profiling.

Definition at line 51 of file sp_vm_types.h.

#define SP_PROF_NATIVES   (1<<0)

Profile natives.

Definition at line 53 of file sp_vm_types.h.

#define SP_PROF_CALLBACKS   (1<<1)

Profile callbacks.

Definition at line 54 of file sp_vm_types.h.

#define SP_PROF_FUNCTIONS   (1<<2)

Profile functions.

Definition at line 55 of file sp_vm_types.h.

#define SP_ERROR_NONE   0

Error codes for SourcePawn routines.

No error occurred

Definition at line 60 of file sp_vm_types.h.

#define SP_ERROR_FILE_FORMAT   1

File format unrecognized

Definition at line 61 of file sp_vm_types.h.

#define SP_ERROR_DECOMPRESSOR   2

A decompressor was not found

Definition at line 62 of file sp_vm_types.h.

#define SP_ERROR_HEAPLOW   3

Not enough space left on the heap

Definition at line 63 of file sp_vm_types.h.

#define SP_ERROR_PARAM   4

Invalid parameter or parameter type

Definition at line 64 of file sp_vm_types.h.

#define SP_ERROR_INVALID_ADDRESS   5

A memory address was not valid

Definition at line 65 of file sp_vm_types.h.

#define SP_ERROR_NOT_FOUND   6

The object in question was not found

Definition at line 66 of file sp_vm_types.h.

#define SP_ERROR_INDEX   7

Invalid index parameter

Definition at line 67 of file sp_vm_types.h.

#define SP_ERROR_STACKLOW   8

Not enough space left on the stack

Definition at line 68 of file sp_vm_types.h.

#define SP_ERROR_NOTDEBUGGING   9

Debug mode was not on or debug section not found

Definition at line 69 of file sp_vm_types.h.

#define SP_ERROR_INVALID_INSTRUCTION   10

Invalid instruction was encountered

Definition at line 70 of file sp_vm_types.h.

#define SP_ERROR_MEMACCESS   11

Invalid memory access

Definition at line 71 of file sp_vm_types.h.

#define SP_ERROR_STACKMIN   12

Stack went beyond its minimum value

Definition at line 72 of file sp_vm_types.h.

#define SP_ERROR_HEAPMIN   13

Heap went beyond its minimum value

Definition at line 73 of file sp_vm_types.h.

#define SP_ERROR_DIVIDE_BY_ZERO   14

Division by zero

Definition at line 74 of file sp_vm_types.h.

#define SP_ERROR_ARRAY_BOUNDS   15

Array index is out of bounds

Definition at line 75 of file sp_vm_types.h.

#define SP_ERROR_INSTRUCTION_PARAM   16

Instruction had an invalid parameter

Definition at line 76 of file sp_vm_types.h.

#define SP_ERROR_STACKLEAK   17

A native leaked an item on the stack

Definition at line 77 of file sp_vm_types.h.

#define SP_ERROR_HEAPLEAK   18

A native leaked an item on the heap

Definition at line 78 of file sp_vm_types.h.

#define SP_ERROR_ARRAY_TOO_BIG   19

A dynamic array is too big

Definition at line 79 of file sp_vm_types.h.

#define SP_ERROR_TRACKER_BOUNDS   20

Tracker stack is out of bounds

Definition at line 80 of file sp_vm_types.h.

#define SP_ERROR_INVALID_NATIVE   21

Native was pending or invalid

Definition at line 81 of file sp_vm_types.h.

#define SP_ERROR_PARAMS_MAX   22

Maximum number of parameters reached

Definition at line 82 of file sp_vm_types.h.

#define SP_ERROR_NATIVE   23

Error originates from a native

Definition at line 83 of file sp_vm_types.h.

#define SP_ERROR_NOT_RUNNABLE   24

Function or plugin is not runnable

Definition at line 84 of file sp_vm_types.h.

#define SP_ERROR_ABORTED   25

Function call was aborted

Definition at line 85 of file sp_vm_types.h.

#define SP_ERROR_CODE_TOO_OLD   26

Code is too old for this VM

Definition at line 86 of file sp_vm_types.h.

#define SP_ERROR_CODE_TOO_NEW   27

Code is too new for this VM

Definition at line 87 of file sp_vm_types.h.

#define SP_NATIVE_UNBOUND   (0)

Native is undefined

Definition at line 144 of file sp_vm_types.h.

#define SP_NATIVE_BOUND   (1)

Native is bound

Definition at line 145 of file sp_vm_types.h.

#define SP_NTVFLAG_OPTIONAL   (1<<0)

Native is optional

Definition at line 147 of file sp_vm_types.h.


Typedef Documentation

typedef uint32_t ucell_t

Unsigned 32bit integer

Definition at line 42 of file sp_vm_types.h.

typedef int32_t cell_t

Basic 32bit signed integer type for plugins

Definition at line 43 of file sp_vm_types.h.

typedef uint32_t funcid_t

Function index code

Definition at line 44 of file sp_vm_types.h.

typedef struct sp_pubvar_s sp_pubvar_t

Offsets and names to public variables.

The offset is relocated and the name by default points back to the sp_plugin_infotab_t structure.