-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzl_vars.h
168 lines (148 loc) · 3.36 KB
/
zl_vars.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#ifndef _VARS_H_
#define _VARS_H_
// move to cl
typedef struct _cl_var_node
{
char *name;
unsigned long flags;
unsigned long level;
unsigned long offset;
unsigned long dimension;
// for arrays
unsigned long rows; // count elements in size (array[0][1]...[rows])
unsigned long size[1024]; //1024
// global vars
unsigned long references;
unsigned long reference_offsets[1024]; //1024
unsigned long dimensions[1024]; //1024
struct _cl_var_node *next_node;
} cl_var_node;
typedef struct _cl_label_node
{
char *name;
char *library;
unsigned long flags;
//??unsigned long level;
unsigned long offset;
unsigned long dimension;
unsigned long references;
unsigned long reference_offsets[1024];
unsigned long dimensions[1024]; //1024
unsigned long params;
struct _cl_label_node *next_node;
} cl_label_node;
typedef struct _cl_var_label_func_node
{
char *name;
unsigned long flags;
unsigned long offset;
union
{
// for vars
unsigned long level; // scope
// for imported funcs
char *library;
};
union
{
// for arrays
unsigned long rows; // count elements in size (array[0][1]...[rows]) = dimensions
// for funcs
unsigned long params_count;
};
union
{
// for arrays
unsigned long size[1024]; //1024
// for funcs
unsigned long params[1024]; //1024
};
// global vars, labels, functions
unsigned long references;
unsigned long reference_offsets[1024]; //1024
struct _cl_var_label_func_node *next_node;
} cl_var_label_func_node;
typedef struct _cl_data_node
{
char *data;
unsigned long size;
unsigned long references;
unsigned long reference_offsets[1024];
unsigned long dimensions[1024];
struct _cl_data_node *next_node;
} cl_data_node;
typedef struct _zl_map_section
{
unsigned long flags;
char name[100];
char library[256];
} zl_map_section;
typedef struct _zl_export_section
{
unsigned long offset;
unsigned long params;
char name[100];
} zl_export_section;
/*
typedef struct _zl_names_map
{
char *name;
unsigned long flags;
unsigned long offset;
unsigned long size;
struct _zl_names_map *elements;
struct _zl_names_map *struct_el;
struct _zl_names_map *next_node;
} zl_names_map;
*/
typedef struct _zl_funcs_list
{
char *name;
void *proc;
} zl_funcs_list;
/* revision 1
typedef struct _zl_funcs_list
{
char *name;
unsigned long params;
void *proc;
unsigned long flags; // êòî ÷èñòèò ñòåê? âûçûâàåìàÿ ôóíêöèÿ èëè âûçûâàþùàÿ.
} zl_funcs_list;
*/
typedef struct _zl_opcodes_list
{
unsigned char opcode;
unsigned long group;
unsigned long arg1;
unsigned long arg2;
} zl_opcodes_list;
typedef struct _zl_val
{
union
{
signed long value;
unsigned long uvalue;
double dvalue;
float fvalue;
void *data;
char *string;
//signed __int64 value64;
//unsigned __int64 uvalue64;
};
unsigned long size;
unsigned long fill;
//char *name; // îí èñïîëüçóåòñÿ? óäàëèòü?
//union
//{
// struct _zl_val *next_node;
// struct _zl_names_map *var_info;
//};
// revision 2
struct _cl_var_node *var; // äëÿ îáëåã÷åíèÿ ñòðóêòóðû ïåðåäåëàòü â *óêàçàòåëü
unsigned long flags;
unsigned long rows;
} zlval;
//zlval *zl_val_alloc(zlval **zl_tree);
//zlval *zl_val_find(zlval *zl_tree, char *name);
//unsigned long zl_val_free(zlval **zl_tree);
#endif // _VARS_H_