profile_verifier.h (3687B)
1 #ifndef PROFILE_VERIFIER_H 2 #define PROFILE_VERIFIER_H 3 4 /* Generated by flatcc 0.6.1 FlatBuffers schema compiler for C by dvide.com */ 5 6 #ifndef PROFILE_READER_H 7 #include "profile_reader.h" 8 #endif 9 #include "flatcc/flatcc_verifier.h" 10 #include "flatcc/flatcc_prologue.h" 11 12 static int NdbProfile_verify_table(flatcc_table_verifier_descriptor_t *td); 13 static int NdbProfileRecord_verify_table(flatcc_table_verifier_descriptor_t *td); 14 15 static int NdbProfile_verify_table(flatcc_table_verifier_descriptor_t *td) 16 { 17 int ret; 18 if ((ret = flatcc_verify_string_field(td, 0, 0) /* name */)) return ret; 19 if ((ret = flatcc_verify_string_field(td, 1, 0) /* website */)) return ret; 20 if ((ret = flatcc_verify_string_field(td, 2, 0) /* about */)) return ret; 21 if ((ret = flatcc_verify_string_field(td, 3, 0) /* lud16 */)) return ret; 22 if ((ret = flatcc_verify_string_field(td, 4, 0) /* banner */)) return ret; 23 if ((ret = flatcc_verify_string_field(td, 5, 0) /* display_name */)) return ret; 24 if ((ret = flatcc_verify_field(td, 6, 1, 1) /* reactions */)) return ret; 25 if ((ret = flatcc_verify_string_field(td, 7, 0) /* picture */)) return ret; 26 if ((ret = flatcc_verify_string_field(td, 8, 0) /* nip05 */)) return ret; 27 if ((ret = flatcc_verify_field(td, 9, 4, 4) /* damus_donation */)) return ret; 28 if ((ret = flatcc_verify_field(td, 10, 4, 4) /* damus_donation_v2 */)) return ret; 29 if ((ret = flatcc_verify_string_field(td, 11, 0) /* lud06 */)) return ret; 30 return flatcc_verify_ok; 31 } 32 33 static inline int NdbProfile_verify_as_root(const void *buf, size_t bufsiz) 34 { 35 return flatcc_verify_table_as_root(buf, bufsiz, NdbProfile_identifier, &NdbProfile_verify_table); 36 } 37 38 static inline int NdbProfile_verify_as_typed_root(const void *buf, size_t bufsiz) 39 { 40 return flatcc_verify_table_as_root(buf, bufsiz, NdbProfile_type_identifier, &NdbProfile_verify_table); 41 } 42 43 static inline int NdbProfile_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) 44 { 45 return flatcc_verify_table_as_root(buf, bufsiz, fid, &NdbProfile_verify_table); 46 } 47 48 static inline int NdbProfile_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) 49 { 50 return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &NdbProfile_verify_table); 51 } 52 53 static int NdbProfileRecord_verify_table(flatcc_table_verifier_descriptor_t *td) 54 { 55 int ret; 56 if ((ret = flatcc_verify_table_field(td, 0, 0, &NdbProfile_verify_table) /* profile */)) return ret; 57 if ((ret = flatcc_verify_field(td, 1, 8, 8) /* received_at */)) return ret; 58 if ((ret = flatcc_verify_field(td, 2, 8, 8) /* note_key */)) return ret; 59 if ((ret = flatcc_verify_string_field(td, 3, 0) /* lnurl */)) return ret; 60 return flatcc_verify_ok; 61 } 62 63 static inline int NdbProfileRecord_verify_as_root(const void *buf, size_t bufsiz) 64 { 65 return flatcc_verify_table_as_root(buf, bufsiz, NdbProfileRecord_identifier, &NdbProfileRecord_verify_table); 66 } 67 68 static inline int NdbProfileRecord_verify_as_typed_root(const void *buf, size_t bufsiz) 69 { 70 return flatcc_verify_table_as_root(buf, bufsiz, NdbProfileRecord_type_identifier, &NdbProfileRecord_verify_table); 71 } 72 73 static inline int NdbProfileRecord_verify_as_root_with_identifier(const void *buf, size_t bufsiz, const char *fid) 74 { 75 return flatcc_verify_table_as_root(buf, bufsiz, fid, &NdbProfileRecord_verify_table); 76 } 77 78 static inline int NdbProfileRecord_verify_as_root_with_type_hash(const void *buf, size_t bufsiz, flatbuffers_thash_t thash) 79 { 80 return flatcc_verify_table_as_typed_root(buf, bufsiz, thash, &NdbProfileRecord_verify_table); 81 } 82 83 #include "flatcc/flatcc_epilogue.h" 84 #endif /* PROFILE_VERIFIER_H */