1 /******************************************************************************
2 *
3 * Copyright (C) 2006, The Gentee Group. All rights reserved.
4 * This file is part of the Gentee open source project - http://www.gentee.com.
5 *
6 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE GENTEE LICENSE ("AGREEMENT").
7 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES RECIPIENTS
8 * ACCEPTANCE OF THE AGREEMENT.
9 *
10 * ID: ge 18.10.06 0.0.A.
11 *
12 * Author: Alexey Krivonogov ( gentee )
13 *
14 * Summary: The format of the compiled byte-code. Also, this is a format of
15 .ge files.
16 *
17 ******************************************************************************/
18
19 #ifndef _GE_
20 #define _GE_
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif // __cplusplus
25
26
27
28 /*-----------------------------------------------------------------------------
29 * Summary: The GE defines
30 -----------------------------------------------------------------------------*/
31
32 #define GE_STRING 0x00004547 // 'GE' string
33 #define GEVER_MAJOR 4
34 #define GEVER_MINOR 0
35
36 /*-----------------------------------------------------------------------------
37 * Summary: The header of GE data
38 -----------------------------------------------------------------------------*/
39 #pragma pack(push, 1)
40 typedef struct
41 {
42 uint idname; // 'GE' string. It must equal GE_STRING
43 uint flags; // The GE flags.
44 uint crc; // CRC from the next byte to the end
45 uint headsize; // The size of the header data
46 uint size; // The summary size of this GE. It includes this header
47 ubyte vermajor; // The major version of .ge format. The virtual machine
48 // can load the byte code only with the same major version
49 ubyte verminor; // The minor version of .ge format.
50 } gehead, * pgehead;
51 #pragma pack(pop)
52
53
54 // Флаги для VAR DWORD MODE
55
56 #define VAR_NAME 0x01 // Есть имя
57 #define VAR_OFTYPE 0x02 // Есть of type
58 #define VAR_DIM 0x04 // Есть размерность [,,,]
59 #define VAR_IDNAME 0x08 // For define if macro has IDNAME type
60 // В этом случае, тип строка, но она содержит имя идентификатора
61 #define VAR_PARAM 0x10 // Параметр функции или подфункции
62 #define VAR_DATA 0x20 // Имеются данные
63
64 // Parameters for 'mode' of load_bytecode
65 #define VMLOAD_GE 0 // Loading from GE
66 #define VMLOAD_G 1 // Loading from G
67 #define VMLOAD_EXTERN 1 // Extern description
68
69 pvmobj STDCALL load_exfunc( pvmEngine pThis, pubyte* input, uint over );
70 pvmobj STDCALL load_type( pvmEngine pThis, pubyte* input );
71 pvmobj STDCALL load_stack( pvmEngine pThis, int top, int cmd, void* pseudo );
72 uint STDCALL ge_load( pvmEngine pThis, char* fileName);
73 uint STDCALL ge_save( pvmEngine pThis, char* fileName, char* isSave);
74
75 //--------------------------------------------------------------------------
76
77 #ifdef __cplusplus
78 }
79 #endif // __cplusplus
80
81 #endif // _GE_
82
83
Редактировать