-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathData.h
More file actions
73 lines (62 loc) · 1.53 KB
/
Data.h
File metadata and controls
73 lines (62 loc) · 1.53 KB
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
#ifndef _DATA_H
#define _DATA_H
#include "Symbol.h"
typedef union _DataNode_Value
{
int intVal;
float floatVal;
int *dataArray;
int *object;
char *string;
} DataNode_Value;
typedef enum _DataNode_Type
{
INT_VALUE = 0,
FLOAT_VALUE = 1,
VAR = 2,
FUNC = 3,
OBJECT = 4,
SYMBOL = 5,
EMPTY = 6,
IFDEF = 7,
ELSE = 8,
ENDIF = 9,
ARRAY = 16,
COMMAND = 17,
STRING_VALUE = 18,
OBJECT_PROP_REF = 19,
GLOB = 20,
DEFINE = 32,
INCLUDE = 33,
MERGE = 34,
IFNDEF = 35,
AUTORUN = 36,
UNDEF = 37
} DataNode_Type;
typedef struct _DataNode
{
DataNode_Value value;
DataNode_Type type;
} DataNode;
typedef struct _DataNodes
{
DataNode n[1];
} DataNodes;
typedef struct _DataArray
{
DataNodes *mNodes;
Symbol mFile; /* Sometimes this is a Symbol, sometimes a type */
short mNodeCount;
short mRefCount;
short mLine;
short mDeprecated; // assuming this is for them to mark scripts or functions as being deprecated and etc.?
} DataArray;
// gets a pointer to the addr of a DTA function
// if there is no function in the list with the symbol's name
// return a pointer to a new entry that you overwrite with your own function ptr
extern int *HmxFactoryFuncAt(int *gDataFuncs, Symbol *sym);
extern DataNode *DataNodeEvaluate(DataNode *ret);
extern DataArray *DataReadFile(char *file, int dtb);
extern DataArray *DataFindArray(DataArray *data, Symbol name);
extern int DataFindData(DataArray *data, Symbol name, DataNode *out);
#endif // _DATA_H