Classes | Defines | Typedefs

public/sourcepawn/sp_file_headers.h File Reference

Defines the structure present in a SourcePawn compiled binary. More...

#include <stddef.h>
Include dependency graph for sp_file_headers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sp_file_section_s
 File section header format. More...
struct  sp_file_hdr_s
 File header format. If compression is 0, then disksize may be 0 to mean that only the imagesize is needed. More...
struct  sp_file_code_s
 File-encoded format of the ".code" section. More...
struct  sp_file_data_s
 File-encoded format of the ".data" section. More...
struct  sp_file_publics_s
 File-encoded format of the ".publics" section. More...
struct  sp_file_natives_s
 File-encoded format of the ".natives" section. More...
struct  sp_file_pubvars_s
 File-encoded format of the ".pubvars" section. More...
struct  sp_file_tag_s
 File-encoded tag info. More...
struct  sp_fdbg_info_s
 File-encoded debug information table. More...
struct  sp_fdbg_file_s
 File-encoded debug file table. More...
struct  sp_fdbg_line_s
 File-encoded debug line table. More...
struct  sp_fdbg_symbol_s
 File-encoded debug symbol information. More...
struct  sp_fdbg_arraydim_s
 File-encoded debug symbol array dimension info. More...
struct  sp_fdbg_ntvtab_s
 File encoding for the dbg.natives table. More...
struct  sp_fdbg_native_s
 File encoding of native debug info. More...
struct  fp_fdbg_ntvarg_s
 File encoding of native arguments. More...
struct  sp_u_fdbg_arraydim_s
 Unpacked file-encoded debug symbol array dimension info. More...
struct  sp_u_fdbg_symbol_s
 Unpacked file-encoded debug symbol information. More...

Defines

#define SPFILE_MAGIC   0x53504646
#define SPFILE_VERSION   0x0102
#define SPFILE_COMPRESSION_NONE   0
#define SPFILE_COMPRESSION_GZ   1
#define SP_FLAG_DEBUG   (1<<0)
#define SP_CODEVERS_JIT1   9
#define SP_CODEVERS_JIT2   10
#define SP_SYM_VARIABLE   1
#define SP_SYM_REFERENCE   2
#define SP_SYM_ARRAY   3
#define SP_SYM_REFARRAY   4
#define SP_SYM_FUNCTION   9
#define SP_SYM_VARARGS   11
#define SP_NTVDBG_VARARGS   (1<<0)

Typedefs

typedef unsigned __int64 uint64_t
typedef __int64 int64_t
typedef unsigned __int32 uint32_t
typedef __int32 int32_t
typedef unsigned __int16 uint16_t
typedef __int16 int16_t
typedef unsigned __int8 uint8_t
typedef __int8 int8_t
typedef struct sp_file_section_s sp_file_section_t
 File section header format.
typedef struct sp_file_hdr_s sp_file_hdr_t
 File header format. If compression is 0, then disksize may be 0 to mean that only the imagesize is needed.
typedef struct sp_file_code_s sp_file_code_t
 File-encoded format of the ".code" section.
typedef struct sp_file_data_s sp_file_data_t
 File-encoded format of the ".data" section.
typedef struct sp_file_publics_s sp_file_publics_t
 File-encoded format of the ".publics" section.
typedef struct sp_file_natives_s sp_file_natives_t
 File-encoded format of the ".natives" section.
typedef struct sp_file_pubvars_s sp_file_pubvars_t
 File-encoded format of the ".pubvars" section.
typedef struct sp_file_tag_s sp_file_tag_t
 File-encoded tag info.
typedef struct sp_fdbg_info_s sp_fdbg_info_t
 File-encoded debug information table.
typedef struct sp_fdbg_file_s sp_fdbg_file_t
 File-encoded debug file table.
typedef struct sp_fdbg_line_s sp_fdbg_line_t
 File-encoded debug line table.
typedef struct sp_fdbg_symbol_s sp_fdbg_symbol_t
 File-encoded debug symbol information.
typedef struct sp_fdbg_arraydim_s sp_fdbg_arraydim_t
 File-encoded debug symbol array dimension info.
typedef char * sp_file_nametab_t
typedef struct sp_fdbg_ntvtab_s sp_fdbg_ntvtab_t
 File encoding for the dbg.natives table.
typedef struct sp_fdbg_native_s sp_fdbg_native_t
 File encoding of native debug info.
typedef struct fp_fdbg_ntvarg_s sp_fdbg_ntvarg_t
 File encoding of native arguments.
typedef struct sp_u_fdbg_arraydim_s sp_u_fdbg_arraydim_t
 Unpacked file-encoded debug symbol array dimension info.
typedef struct sp_u_fdbg_symbol_s sp_u_fdbg_symbol_t
 Unpacked file-encoded debug symbol information.

Detailed Description

Defines the structure present in a SourcePawn compiled binary.

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$

Note: These structures should be 1-byte packed to match the file format.

Definition in file sp_file_headers.h.


Define Documentation

#define SPFILE_MAGIC   0x53504646

Source Pawn File Format (SPFF)

Definition at line 59 of file sp_file_headers.h.

#define SPFILE_VERSION   0x0102

File format version

Definition at line 60 of file sp_file_headers.h.

#define SPFILE_COMPRESSION_NONE   0

No compression in file

Definition at line 70 of file sp_file_headers.h.

#define SPFILE_COMPRESSION_GZ   1

GZ compression

Definition at line 71 of file sp_file_headers.h.

#define SP_FLAG_DEBUG   (1<<0)

Debug information is present in the file

Definition at line 99 of file sp_file_headers.h.

#define SP_CODEVERS_JIT1   9

Code version for JIT1

Definition at line 101 of file sp_file_headers.h.

#define SP_CODEVERS_JIT2   10

Code version for JIT2

Definition at line 102 of file sp_file_headers.h.

#define SP_SYM_VARIABLE   1

Cell that has an address and that can be fetched directly (lvalue)

Definition at line 191 of file sp_file_headers.h.

#define SP_SYM_REFERENCE   2

VARIABLE, but must be dereferenced

Definition at line 192 of file sp_file_headers.h.

#define SP_SYM_ARRAY   3

Symbol is an array

Definition at line 193 of file sp_file_headers.h.

#define SP_SYM_REFARRAY   4

An array passed by reference (i.e. a pointer)

Definition at line 194 of file sp_file_headers.h.

#define SP_SYM_FUNCTION   9

Symbol is a function

Definition at line 195 of file sp_file_headers.h.

#define SP_SYM_VARARGS   11

Variadic argument start.

Definition at line 196 of file sp_file_headers.h.

#define SP_NTVDBG_VARARGS   (1<<0)

Formal args are followed by '...'

Definition at line 235 of file sp_file_headers.h.


Typedef Documentation

typedef unsigned __int64 uint64_t

64bit unsigned integer

Definition at line 47 of file sp_file_headers.h.

typedef __int64 int64_t

64bit signed integer

Definition at line 48 of file sp_file_headers.h.

typedef unsigned __int32 uint32_t

32bit unsigned integer

Definition at line 49 of file sp_file_headers.h.

typedef __int32 int32_t

32bit signed integer

Definition at line 50 of file sp_file_headers.h.

typedef unsigned __int16 uint16_t

16bit unsigned integer

Definition at line 51 of file sp_file_headers.h.

typedef __int16 int16_t

16bit signed integer

Definition at line 52 of file sp_file_headers.h.

typedef unsigned __int8 uint8_t

8bit unsigned integer

Definition at line 53 of file sp_file_headers.h.

typedef __int8 int8_t

8bit signed integer

Definition at line 54 of file sp_file_headers.h.

typedef char* sp_file_nametab_t

Typedef for .names table

Definition at line 223 of file sp_file_headers.h.

File encoding for the dbg.natives table.

This header is followed by variable length entries of sp_fdbg_native.

File encoding of native debug info.

Each entry is followed by an sp_fdbg_ntvarg_t for each narg.

File encoding of native arguments.

Each entry is followed by an sp_fdbg_arraydim_t for each dimcount.

Unpacked file-encoded debug symbol array dimension info.

Okay, my mistake here. I apologize. I changed the packing by accident and there is no version bump aside from the presence of the native debug table. Cat's out of the bag for SourceMod and we have no choice but to shim compat for the old version. For people parsing plugins on their own, use the presence of the native debug table to decide this. If there are no natives (really, there is a very very low chance of this), heuristics might be necessary. I've bumped the version to 0x0102 but there may have been plugins in the 0x0101 window with no natives.