1.1 --- a/sourcepawn/include/sp_vm_types.h Wed Nov 08 08:04:57 2006 +0000
1.2 +++ b/sourcepawn/include/sp_vm_types.h Wed Nov 08 08:41:18 2006 +0000
1.3 @@ -5,6 +5,7 @@
1.4
1.5 typedef uint32_t ucell_t;
1.6 typedef int32_t cell_t;
1.7 +typedef uint32_t funcid_t;
1.8
1.9 /**
1.10 * Error codes
1.11 @@ -17,20 +18,20 @@
1.12 #define SP_ERROR_INVALID_ADDRESS 5 /* A memory address was not valid */
1.13 #define SP_ERROR_NOT_FOUND 6 /* The object in question was not found */
1.14 #define SP_ERROR_INDEX 7 /* Invalid index parameter */
1.15 -#define SP_ERROR_NATIVE_PENDING 8 /* A script tried to exec an unbound native */
1.16 -#define SP_ERROR_STACKLOW 9 /* Nnot enough space left on the stack */
1.17 -#define SP_ERROR_NOTDEBUGGING 10 /* Debug mode was not on or debug section not found */
1.18 -#define SP_ERROR_INVALID_INSTRUCTION 11 /* Invalid instruction was encountered */
1.19 -#define SP_ERROR_MEMACCESS 12 /* Invalid memory access */
1.20 -#define SP_ERROR_STACKMIN 13 /* Stack went beyond its minimum value */
1.21 -#define SP_ERROR_HEAPMIN 14 /* Heap went beyond its minimum value */
1.22 -#define SP_ERROR_DIVIDE_BY_ZERO 15 /* Division by zero */
1.23 -#define SP_ERROR_ARRAY_BOUNDS 16 /* Array index is out of bounds */
1.24 -#define SP_ERROR_INSTRUCTION_PARAM 17 /* Instruction had an invalid parameter */
1.25 -#define SP_ERROR_STACKLEAK 18 /* A native leaked an item on the stack */
1.26 -#define SP_ERROR_HEAPLEAK 19 /* A native leaked an item on the heap */
1.27 -#define SP_ERROR_ARRAY_TOO_BIG 20 /* A dynamic array is too big */
1.28 -#define SP_ERROR_TRACKER_BOUNDS 21 /* Tracker stack is out of bounds */
1.29 +#define SP_ERROR_STACKLOW 8 /* Nnot enough space left on the stack */
1.30 +#define SP_ERROR_NOTDEBUGGING 9 /* Debug mode was not on or debug section not found */
1.31 +#define SP_ERROR_INVALID_INSTRUCTION 10 /* Invalid instruction was encountered */
1.32 +#define SP_ERROR_MEMACCESS 11 /* Invalid memory access */
1.33 +#define SP_ERROR_STACKMIN 12 /* Stack went beyond its minimum value */
1.34 +#define SP_ERROR_HEAPMIN 13 /* Heap went beyond its minimum value */
1.35 +#define SP_ERROR_DIVIDE_BY_ZERO 14 /* Division by zero */
1.36 +#define SP_ERROR_ARRAY_BOUNDS 15 /* Array index is out of bounds */
1.37 +#define SP_ERROR_INSTRUCTION_PARAM 16 /* Instruction had an invalid parameter */
1.38 +#define SP_ERROR_STACKLEAK 17 /* A native leaked an item on the stack */
1.39 +#define SP_ERROR_HEAPLEAK 18 /* A native leaked an item on the heap */
1.40 +#define SP_ERROR_ARRAY_TOO_BIG 19 /* A dynamic array is too big */
1.41 +#define SP_ERROR_TRACKER_BOUNDS 20 /* Tracker stack is out of bounds */
1.42 +#define SP_ERROR_INVALID_NATIVE 21 /* Native was pending or invalid */
1.43
1.44 /**********************************************
1.45 *** The following structures are reference structures.
1.46 @@ -117,7 +118,8 @@
1.47 */
1.48 typedef struct sp_public_s
1.49 {
1.50 - uint32_t offs; /* code offset */
1.51 + funcid_t funcid; /* encoded function id */
1.52 + uint32_t code_offs; /* code offset */
1.53 const char *name; /* name */
1.54 } sp_public_t;
1.55
1.56 @@ -132,9 +134,8 @@
1.57 const char *name; /* name */
1.58 } sp_pubvar_t;
1.59
1.60 -#define SP_NATIVE_NONE (0) /* Native is not yet found */
1.61 -#define SP_NATIVE_OKAY (1) /* Native has been added */
1.62 -#define SP_NATIVE_PENDING (2) /* Native is marked as usable but replaceable */
1.63 +#define SP_NATIVE_UNBOUND (0) /* Native is undefined */
1.64 +#define SP_NATIVE_BOUND (1) /* Native is bound */
1.65
1.66 /**
1.67 * Native lookup table, by default names