nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

profile_builder.h (6118B)


      1 #ifndef PROFILE_BUILDER_H
      2 #define PROFILE_BUILDER_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 #ifndef FLATBUFFERS_COMMON_BUILDER_H
     10 #include "flatbuffers_common_builder.h"
     11 #endif
     12 #include "flatcc/flatcc_prologue.h"
     13 #ifndef flatbuffers_identifier
     14 #define flatbuffers_identifier 0
     15 #endif
     16 #ifndef flatbuffers_extension
     17 #define flatbuffers_extension "bin"
     18 #endif
     19 
     20 static const flatbuffers_voffset_t __NdbProfile_required[] = { 0 };
     21 typedef flatbuffers_ref_t NdbProfile_ref_t;
     22 static NdbProfile_ref_t NdbProfile_clone(flatbuffers_builder_t *B, NdbProfile_table_t t);
     23 __flatbuffers_build_table(flatbuffers_, NdbProfile, 12)
     24 
     25 static const flatbuffers_voffset_t __NdbProfileRecord_required[] = { 0 };
     26 typedef flatbuffers_ref_t NdbProfileRecord_ref_t;
     27 static NdbProfileRecord_ref_t NdbProfileRecord_clone(flatbuffers_builder_t *B, NdbProfileRecord_table_t t);
     28 __flatbuffers_build_table(flatbuffers_, NdbProfileRecord, 4)
     29 
     30 #define __NdbProfile_formal_args ,\
     31   flatbuffers_string_ref_t v0, flatbuffers_string_ref_t v1, flatbuffers_string_ref_t v2, flatbuffers_string_ref_t v3,\
     32   flatbuffers_string_ref_t v4, flatbuffers_string_ref_t v5, flatbuffers_bool_t v6, flatbuffers_string_ref_t v7,\
     33   flatbuffers_string_ref_t v8, int32_t v9, int32_t v10, flatbuffers_string_ref_t v11
     34 #define __NdbProfile_call_args ,\
     35   v0, v1, v2, v3,\
     36   v4, v5, v6, v7,\
     37   v8, v9, v10, v11
     38 static inline NdbProfile_ref_t NdbProfile_create(flatbuffers_builder_t *B __NdbProfile_formal_args);
     39 __flatbuffers_build_table_prolog(flatbuffers_, NdbProfile, NdbProfile_file_identifier, NdbProfile_type_identifier)
     40 
     41 #define __NdbProfileRecord_formal_args , NdbProfile_ref_t v0, uint64_t v1, uint64_t v2, flatbuffers_string_ref_t v3
     42 #define __NdbProfileRecord_call_args , v0, v1, v2, v3
     43 static inline NdbProfileRecord_ref_t NdbProfileRecord_create(flatbuffers_builder_t *B __NdbProfileRecord_formal_args);
     44 __flatbuffers_build_table_prolog(flatbuffers_, NdbProfileRecord, NdbProfileRecord_file_identifier, NdbProfileRecord_type_identifier)
     45 
     46 __flatbuffers_build_string_field(0, flatbuffers_, NdbProfile_name, NdbProfile)
     47 __flatbuffers_build_string_field(1, flatbuffers_, NdbProfile_website, NdbProfile)
     48 __flatbuffers_build_string_field(2, flatbuffers_, NdbProfile_about, NdbProfile)
     49 __flatbuffers_build_string_field(3, flatbuffers_, NdbProfile_lud16, NdbProfile)
     50 __flatbuffers_build_string_field(4, flatbuffers_, NdbProfile_banner, NdbProfile)
     51 __flatbuffers_build_string_field(5, flatbuffers_, NdbProfile_display_name, NdbProfile)
     52 __flatbuffers_build_scalar_field(6, flatbuffers_, NdbProfile_reactions, flatbuffers_bool, flatbuffers_bool_t, 1, 1, UINT8_C(1), NdbProfile)
     53 __flatbuffers_build_string_field(7, flatbuffers_, NdbProfile_picture, NdbProfile)
     54 __flatbuffers_build_string_field(8, flatbuffers_, NdbProfile_nip05, NdbProfile)
     55 __flatbuffers_build_scalar_field(9, flatbuffers_, NdbProfile_damus_donation, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbProfile)
     56 __flatbuffers_build_scalar_field(10, flatbuffers_, NdbProfile_damus_donation_v2, flatbuffers_int32, int32_t, 4, 4, INT32_C(0), NdbProfile)
     57 __flatbuffers_build_string_field(11, flatbuffers_, NdbProfile_lud06, NdbProfile)
     58 
     59 static inline NdbProfile_ref_t NdbProfile_create(flatbuffers_builder_t *B __NdbProfile_formal_args)
     60 {
     61     if (NdbProfile_start(B)
     62         || NdbProfile_name_add(B, v0)
     63         || NdbProfile_website_add(B, v1)
     64         || NdbProfile_about_add(B, v2)
     65         || NdbProfile_lud16_add(B, v3)
     66         || NdbProfile_banner_add(B, v4)
     67         || NdbProfile_display_name_add(B, v5)
     68         || NdbProfile_picture_add(B, v7)
     69         || NdbProfile_nip05_add(B, v8)
     70         || NdbProfile_damus_donation_add(B, v9)
     71         || NdbProfile_damus_donation_v2_add(B, v10)
     72         || NdbProfile_lud06_add(B, v11)
     73         || NdbProfile_reactions_add(B, v6)) {
     74         return 0;
     75     }
     76     return NdbProfile_end(B);
     77 }
     78 
     79 static NdbProfile_ref_t NdbProfile_clone(flatbuffers_builder_t *B, NdbProfile_table_t t)
     80 {
     81     __flatbuffers_memoize_begin(B, t);
     82     if (NdbProfile_start(B)
     83         || NdbProfile_name_pick(B, t)
     84         || NdbProfile_website_pick(B, t)
     85         || NdbProfile_about_pick(B, t)
     86         || NdbProfile_lud16_pick(B, t)
     87         || NdbProfile_banner_pick(B, t)
     88         || NdbProfile_display_name_pick(B, t)
     89         || NdbProfile_picture_pick(B, t)
     90         || NdbProfile_nip05_pick(B, t)
     91         || NdbProfile_damus_donation_pick(B, t)
     92         || NdbProfile_damus_donation_v2_pick(B, t)
     93         || NdbProfile_lud06_pick(B, t)
     94         || NdbProfile_reactions_pick(B, t)) {
     95         return 0;
     96     }
     97     __flatbuffers_memoize_end(B, t, NdbProfile_end(B));
     98 }
     99 
    100 __flatbuffers_build_table_field(0, flatbuffers_, NdbProfileRecord_profile, NdbProfile, NdbProfileRecord)
    101 __flatbuffers_build_scalar_field(1, flatbuffers_, NdbProfileRecord_received_at, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), NdbProfileRecord)
    102 __flatbuffers_build_scalar_field(2, flatbuffers_, NdbProfileRecord_note_key, flatbuffers_uint64, uint64_t, 8, 8, UINT64_C(0), NdbProfileRecord)
    103 __flatbuffers_build_string_field(3, flatbuffers_, NdbProfileRecord_lnurl, NdbProfileRecord)
    104 
    105 static inline NdbProfileRecord_ref_t NdbProfileRecord_create(flatbuffers_builder_t *B __NdbProfileRecord_formal_args)
    106 {
    107     if (NdbProfileRecord_start(B)
    108         || NdbProfileRecord_received_at_add(B, v1)
    109         || NdbProfileRecord_note_key_add(B, v2)
    110         || NdbProfileRecord_profile_add(B, v0)
    111         || NdbProfileRecord_lnurl_add(B, v3)) {
    112         return 0;
    113     }
    114     return NdbProfileRecord_end(B);
    115 }
    116 
    117 static NdbProfileRecord_ref_t NdbProfileRecord_clone(flatbuffers_builder_t *B, NdbProfileRecord_table_t t)
    118 {
    119     __flatbuffers_memoize_begin(B, t);
    120     if (NdbProfileRecord_start(B)
    121         || NdbProfileRecord_received_at_pick(B, t)
    122         || NdbProfileRecord_note_key_pick(B, t)
    123         || NdbProfileRecord_profile_pick(B, t)
    124         || NdbProfileRecord_lnurl_pick(B, t)) {
    125         return 0;
    126     }
    127     __flatbuffers_memoize_end(B, t, NdbProfileRecord_end(B));
    128 }
    129 
    130 #include "flatcc/flatcc_epilogue.h"
    131 #endif /* PROFILE_BUILDER_H */