aboutsummaryrefslogtreecommitdiffstats
path: root/code/4ed_api_definition.h
blob: 3253b5e7191f991ee07b1b68f270e1bba2acf434 (plain) (blame)
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
/*
 * Mr. 4th Dimention - Allen Webster
 *
 * 03.10.2019
 *
 * System API definition types.
 *
 */

// TOP

#if !defined(FRED_API_DEFINITION_H)
#define FRED_API_DEFINITION_H

struct API_Param{
    API_Param *next;
    String_Const_u8 type_name;
    String_Const_u8 name;
};

struct API_Param_List{
    API_Param *first;
    API_Param *last;
    i32 count;
};

struct API_Call{
    API_Call *next;
    String_Const_u8 name;
    String_Const_u8 return_type;
    String_Const_u8 location_string;
    API_Param_List params;
};

typedef i32 API_Type_Structure_Kind;
enum{
    APITypeStructureKind_Struct,
    APITypeStructureKind_Union,
};
struct API_Type_Structure{
    API_Type_Structure_Kind kind;
    List_String_Const_u8 member_names;
    String_Const_u8 definition_string;
};

struct API_Enum_Value{
    API_Enum_Value *next;
    String_Const_u8 name;
    String_Const_u8 val;
};
struct API_Type_Enum{
    String_Const_u8 type_name;
    API_Enum_Value *first_val;
    API_Enum_Value *last_val;
    i32 val_count;
};

struct API_Type_Typedef{
    String_Const_u8 name;
    String_Const_u8 definition_text;
};

typedef i32 API_Type_Kind;
enum{
    APITypeKind_Structure,
    APITypeKind_Enum,
    APITypeKind_Typedef,
};
struct API_Type{
    API_Type *next;
    API_Type_Kind kind;
    String_Const_u8 name;
    String_Const_u8 location_string;
    union{
        API_Type_Structure struct_type;
        API_Type_Enum enum_type;
        API_Type_Typedef typedef_type;
    };
};

struct API_Definition{
    API_Definition *next;
    
    API_Call *first_call;
    API_Call *last_call;
    i32 call_count;
    
    API_Type *first_type;
    API_Type *last_type;
    i32 type_count;
    
    String_Const_u8 name;
};

struct API_Definition_List{
    API_Definition *first;
    API_Definition *last;
    i32 count;
};

typedef u32 API_Generation_Flag;
enum{
    APIGeneration_NoAPINameOnCallables = 1,
};

typedef u32 API_Check_Flag;
enum{
    APICheck_ReportMissingAPI = 1,
    APICheck_ReportExtraAPI = 2,
    APICheck_ReportMismatchAPI = 4,
};
enum{
    APICheck_ReportAll = APICheck_ReportMissingAPI|APICheck_ReportExtraAPI|APICheck_ReportMismatchAPI,
};

#endif

// BOTTOM