Pol  Revision:3cfda13
filefmt.h
Go to the documentation of this file.
1 
12 #ifndef __BSCRIPT_FILEFMT_H
13 #define __BSCRIPT_FILEFMT_H
14 
15 namespace Pol
16 {
17 namespace Bscript
18 {
19 #pragma pack( push, 1 )
20 
21 #define BSCRIPT_FILE_MAGIC0 'C'
22 #define BSCRIPT_FILE_MAGIC1 'E'
23 #define ESCRIPT_FILE_VER_0000_obs 0x0000
24 #define ESCRIPT_FILE_VER_0001_obs 0x0001
25 #define ESCRIPT_FILE_VER_0002_obs 0x0002
26 #define ESCRIPT_FILE_VER_0003 0x0003
27 #define ESCRIPT_FILE_VER_0004 0x0004
28 #define ESCRIPT_FILE_VER_0005 0x0005
29 #define ESCRIPT_FILE_VER_0006 0x0006
30 #define ESCRIPT_FILE_VER_0007 0x0007
31 #define ESCRIPT_FILE_VER_0008 0x0008
32 #define ESCRIPT_FILE_VER_0009 0x0009
33 #define ESCRIPT_FILE_VER_000A 0x000A
34 #define ESCRIPT_FILE_VER_000B 0x000B
35 #define ESCRIPT_FILE_VER_000C 0x000C
36 #define ESCRIPT_FILE_VER_000D 0x000D
37 
38 /*
39  NOTE: Update ESCRIPT_FILE_VER_CURRENT when you make a
40  new escript file version, to force recompile of scripts
41  and report this to users when an older compiled version
42  is attempted to be executed - TJ
43  */
44 #define ESCRIPT_FILE_VER_CURRENT ( ESCRIPT_FILE_VER_000D )
45 
47 {
48  char magic2[2];
49  unsigned short version;
50  unsigned short globals;
51 };
52 static_assert( sizeof( BSCRIPT_FILE_HDR ) == 6, "size missmatch" );
53 
55 {
56  unsigned short type;
57  unsigned int length;
58 };
59 static_assert( sizeof( BSCRIPT_SECTION_HDR ) == 6, "size missmatch" );
60 
62 {
69 };
70 
71 
73 {
74  char modulename[14];
75  unsigned int nfuncs;
76 };
77 static_assert( sizeof( BSCRIPT_MODULE_HDR ) == 18, "size missmatch" );
78 
80 {
81  char funcname[33];
82  unsigned char nargs;
83 };
84 static_assert( sizeof( BSCRIPT_MODULE_FUNCTION ) == 34, "size missmatch" );
85 
87 {
88  unsigned expectedArgs;
89  unsigned char rfu[12];
90 };
91 static_assert( sizeof( BSCRIPT_PROGDEF_HDR ) == 16, "size missmatch" );
92 
94 {
95  unsigned nGlobalVars;
96 };
97 static_assert( sizeof( BSCRIPT_GLOBALVARNAMES_HDR ) == 4, "size missmatch" );
99 {
100  unsigned namelen;
101 };
102 static_assert( sizeof( BSCRIPT_GLOBALVARNAME_HDR ) == 4, "size missmatch" );
103 
105 {
106  unsigned filenum;
107  unsigned linenum;
108  unsigned blocknum;
109  unsigned statementbegin;
110  unsigned rfu1;
111  unsigned rfu2;
112 };
113 static_assert( sizeof( BSCRIPT_DBG_INSTRUCTION ) == 24, "size missmatch" );
114 
116 {
117  char funcname[33];
118  unsigned nargs;
119  unsigned PC;
120 };
121 static_assert( sizeof( BSCRIPT_EXPORTED_FUNCTION ) == 41, "size missmatch" );
122 
123 #pragma pack( pop )
124 }
125 }
126 #endif
unsigned short globals
Definition: filefmt.h:50
unsigned short version
Definition: filefmt.h:49
Definition: berror.cpp:12