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
|
#ifndef MONSTER_VERIFIER_H
#define MONSTER_VERIFIER_H
/* Generated by flatcc 0.6.2 FlatBuffers schema compiler for C by dvide.com */
#ifndef MONSTER_READER_H
#include "monster_reader.h"
#endif
#include "flatcc/flatcc_verifier.h"
#include "flatcc/flatcc_prologue.h"
static int MyGame_Sample_Monster_verify_table(flatcc_table_verifier_descriptor_t *td);
static int MyGame_Sample_Weapon_verify_table(flatcc_table_verifier_descriptor_t *td);
static int MyGame_Sample_Equipment_union_verifier(flatcc_union_verifier_descriptor_t *ud)
{
switch (ud->type) {
case 1: return flatcc_verify_union_table(ud, MyGame_Sample_Weapon_verify_table); /* Weapon */
default: return flatcc_verify_ok;
}
}
static inline int MyGame_Sample_Vec3_verify_as_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_struct_as_root(buf, bufsiz, MyGame_Sample_Vec3_identifier, 12, 4);
}
static inline int MyGame_Sample_Vec3_verify_as_typed_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_struct_as_typed_root(buf, bufsiz, MyGame_Sample_Vec3_type_hash, 12, 4);
}
static inline int MyGame_Sample_Vec3_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash)
{
return flatcc_verify_struct_as_typed_root(buf, bufsiz, thash, 12, 4);
}
static inline int MyGame_Sample_Vec3_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid)
{
return flatcc_verify_struct_as_root(buf, bufsiz, fid, 12, 4);
}
static int MyGame_Sample_Monster_verify_table(flatcc_table_verifier_descriptor_t *td)
{
int ret;
if ((ret = flatcc_verify_field(td, 0, 12, 4) /* pos */)) return ret;
if ((ret = flatcc_verify_field(td, 1, 2, 2) /* mana */)) return ret;
if ((ret = flatcc_verify_field(td, 2, 2, 2) /* hp */)) return ret;
if ((ret = flatcc_verify_string_field(td, 3, 0) /* name */)) return ret;
if ((ret = flatcc_verify_vector_field(td, 5, 0, 1, 1, INT64_C(4294967295)) /* inventory */)) return ret;
if ((ret = flatcc_verify_field(td, 6, 1, 1) /* color */)) return ret;
if ((ret = flatcc_verify_table_vector_field(td, 7, 0, &MyGame_Sample_Weapon_verify_table) /* weapons */)) return ret;
if ((ret = flatcc_verify_union_field(td, 9, 0, &MyGame_Sample_Equipment_union_verifier) /* equipped */)) return ret;
return flatcc_verify_ok;
}
static inline int MyGame_Sample_Monster_verify_as_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_table_as_root(buf, bufsiz, MyGame_Sample_Monster_identifier, &MyGame_Sample_Monster_verify_table);
}
static inline int MyGame_Sample_Monster_verify_as_typed_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_table_as_root(buf, bufsiz, MyGame_Sample_Monster_type_identifier, &MyGame_Sample_Monster_verify_table);
}
static inline int MyGame_Sample_Monster_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid)
{
return flatcc_verify_table_as_root(buf, bufsiz, fid, &MyGame_Sample_Monster_verify_table);
}
static inline int MyGame_Sample_Monster_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash)
{
return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &MyGame_Sample_Monster_verify_table);
}
static int MyGame_Sample_Weapon_verify_table(flatcc_table_verifier_descriptor_t *td)
{
int ret;
if ((ret = flatcc_verify_string_field(td, 0, 0) /* name */)) return ret;
if ((ret = flatcc_verify_field(td, 1, 2, 2) /* damage */)) return ret;
return flatcc_verify_ok;
}
static inline int MyGame_Sample_Weapon_verify_as_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_table_as_root(buf, bufsiz, MyGame_Sample_Weapon_identifier, &MyGame_Sample_Weapon_verify_table);
}
static inline int MyGame_Sample_Weapon_verify_as_typed_root(const void *buf, size_t bufsiz)
{
return flatcc_verify_table_as_root(buf, bufsiz, MyGame_Sample_Weapon_type_identifier, &MyGame_Sample_Weapon_verify_table);
}
static inline int MyGame_Sample_Weapon_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid)
{
return flatcc_verify_table_as_root(buf, bufsiz, fid, &MyGame_Sample_Weapon_verify_table);
}
static inline int MyGame_Sample_Weapon_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash)
{
return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &MyGame_Sample_Weapon_verify_table);
}
#include "flatcc/flatcc_epilogue.h"
#endif /* MONSTER_VERIFIER_H */
|