205 # define PROTOBUF_C__BEGIN_DECLS extern "C" { 206 # define PROTOBUF_C__END_DECLS } 208 # define PROTOBUF_C__BEGIN_DECLS 209 # define PROTOBUF_C__END_DECLS 212 PROTOBUF_C__BEGIN_DECLS
214 #if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) 215 # ifdef PROTOBUF_C_EXPORT 216 # define PROTOBUF_C__API __declspec(dllexport) 218 # define PROTOBUF_C__API __declspec(dllimport) 221 # define PROTOBUF_C__API 224 #if !defined(PROTOBUF_C__NO_DEPRECATED) && \ 225 ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) 226 # define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__)) 228 # define PROTOBUF_C__DEPRECATED 231 #ifndef PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE 232 #define PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(enum_name) \ 233 , _##enum_name##_IS_INT_SIZE = INT_MAX 236 #define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3 237 #define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9 238 #define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af 326 PROTOBUF_C_WIRE_TYPE_VARINT = 0,
327 PROTOBUF_C_WIRE_TYPE_64BIT = 1,
328 PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED = 2,
330 PROTOBUF_C_WIRE_TYPE_32BIT = 5,
368 typedef void (*ProtobufCClosure)(
const ProtobufCMessage *,
void *closure_data);
369 typedef void (*ProtobufCMessageInit)(ProtobufCMessage *);
370 typedef void (*ProtobufCServiceDestroy)(ProtobufCService *);
375 struct ProtobufCAllocator {
393 struct ProtobufCBinaryData {
433 struct ProtobufCBuffer {
435 void (*append)(ProtobufCBuffer *buffer,
437 const uint8_t *data);
468 struct ProtobufCBufferSimple {
486 struct ProtobufCEnumDescriptor {
527 struct ProtobufCEnumValue {
541 struct ProtobufCEnumValueIndex {
551 struct ProtobufCFieldDescriptor {
615 struct ProtobufCIntRange {
640 struct ProtobufCMessage {
652 struct ProtobufCMessageDescriptor {
684 ProtobufCMessageInit message_init;
697 struct ProtobufCMessageUnknownField {
711 struct ProtobufCMethodDescriptor {
715 const ProtobufCMessageDescriptor *
input;
717 const ProtobufCMessageDescriptor *
output;
723 struct ProtobufCService {
727 void (*invoke)(ProtobufCService *service,
728 unsigned method_index,
729 const ProtobufCMessage *input,
730 ProtobufCClosure closure,
733 void (*destroy)(ProtobufCService *service);
739 struct ProtobufCServiceDescriptor {
784 #define PROTOBUF_C_VERSION "1.1.1" 790 #define PROTOBUF_C_VERSION_NUMBER 1001001 796 #define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 812 const ProtobufCEnumValue *
814 const ProtobufCEnumDescriptor *desc,
833 const ProtobufCEnumValue *
835 const ProtobufCEnumDescriptor *desc,
852 const ProtobufCFieldDescriptor *
854 const ProtobufCMessageDescriptor *desc,
871 const ProtobufCFieldDescriptor *
873 const ProtobufCMessageDescriptor *desc,
924 const ProtobufCMessage *message,
925 ProtobufCBuffer *buffer);
947 const ProtobufCMessageDescriptor *descriptor,
948 ProtobufCAllocator *allocator,
950 const uint8_t *data);
967 ProtobufCMessage *message,
968 ProtobufCAllocator *allocator);
986 #define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL } 999 const ProtobufCMessageDescriptor *descriptor,
1026 const ProtobufCMethodDescriptor *
1028 const ProtobufCServiceDescriptor *desc,
1034 #define PROTOBUF_C_BUFFER_SIMPLE_INIT(array_of_bytes) \ 1036 { protobuf_c_buffer_simple_append }, \ 1037 sizeof(array_of_bytes), \ 1047 #define PROTOBUF_C_BUFFER_SIMPLE_CLEAR(simp_buf) \ 1049 if ((simp_buf)->must_free_data) { \ 1050 if ((simp_buf)->allocator != NULL) \ 1051 (simp_buf)->allocator->free( \ 1052 (simp_buf)->allocator, \ 1053 (simp_buf)->data); \ 1055 free((simp_buf)->data); \ 1073 ProtobufCBuffer *buffer,
1075 const unsigned char *data);
1079 protobuf_c_service_generated_init(
1080 ProtobufCService *service,
1081 const ProtobufCServiceDescriptor *descriptor,
1082 ProtobufCServiceDestroy destroy);
1086 protobuf_c_service_invoke_internal(
1087 ProtobufCService *service,
1088 unsigned method_index,
1089 const ProtobufCMessage *input,
1090 ProtobufCClosure closure,
1091 void *closure_data);
1095 PROTOBUF_C__END_DECLS
void * reserved3
Definition: protobuf-c.h:691
PROTOBUF_C__API void protobuf_c_message_init(const ProtobufCMessageDescriptor *descriptor, void *message)
Definition: protobuf-c.c:3254
void * reserved1
Definition: protobuf-c.h:687
const char * c_name
Definition: protobuf-c.h:495
void * reserved3
Definition: protobuf-c.h:604
ProtobufCLabel label
Definition: protobuf-c.h:559
void * allocator_data
Definition: protobuf-c.h:383
Definition: protobuf-c.h:302
Definition: protobuf-c.h:307
Definition: protobuf-c.h:711
PROTOBUF_C__API ProtobufCMessage * protobuf_c_message_unpack(const ProtobufCMessageDescriptor *descriptor, ProtobufCAllocator *allocator, size_t len, const uint8_t *data)
Definition: protobuf-c.c:2871
unsigned n_unknown_fields
Definition: protobuf-c.h:644
PROTOBUF_C__API const ProtobufCFieldDescriptor * protobuf_c_message_descriptor_get_field(const ProtobufCMessageDescriptor *desc, unsigned value)
Definition: protobuf-c.c:3454
const char * c_name
Definition: protobuf-c.h:532
Definition: protobuf-c.h:279
Definition: protobuf-c.h:468
PROTOBUF_C__API uint32_t protobuf_c_version_number(void)
Definition: protobuf-c.c:139
protobuf_c_boolean must_free_data
Definition: protobuf-c.h:478
Definition: protobuf-c.h:393
Definition: protobuf-c.h:314
const ProtobufCServiceDescriptor * descriptor
Definition: protobuf-c.h:725
Definition: protobuf-c.h:312
size_t alloced
Definition: protobuf-c.h:472
const char * name
Definition: protobuf-c.h:553
unsigned offset
Definition: protobuf-c.h:575
ProtobufCWireType
Definition: protobuf-c.h:325
const void * default_value
Definition: protobuf-c.h:591
ProtobufCLabel
Definition: protobuf-c.h:271
Definition: protobuf-c.h:723
uint32_t id
Definition: protobuf-c.h:556
Definition: protobuf-c.h:551
void * reserved2
Definition: protobuf-c.h:602
Definition: protobuf-c.h:305
Definition: protobuf-c.h:286
const char * name
Definition: protobuf-c.h:657
PROTOBUF_C__API void protobuf_c_message_free_unpacked(ProtobufCMessage *message, ProtobufCAllocator *allocator)
Definition: protobuf-c.c:3165
const unsigned * method_indices_by_name
Definition: protobuf-c.h:756
const ProtobufCIntRange * field_ranges
Definition: protobuf-c.h:681
const char * short_name
Definition: protobuf-c.h:746
Definition: protobuf-c.h:303
PROTOBUF_C__API void protobuf_c_buffer_simple_append(ProtobufCBuffer *buffer, size_t len, const unsigned char *data)
Definition: protobuf-c.c:185
Definition: protobuf-c.h:311
uint8_t * data
Definition: protobuf-c.h:395
const ProtobufCIntRange * value_ranges
Definition: protobuf-c.h:512
Definition: protobuf-c.h:298
Definition: protobuf-c.h:301
uint32_t tag
Definition: protobuf-c.h:699
PROTOBUF_C__API const char * protobuf_c_version(void)
Definition: protobuf-c.c:133
const char * c_name
Definition: protobuf-c.h:661
const ProtobufCMessageDescriptor * descriptor
Definition: protobuf-c.h:642
size_t len
Definition: protobuf-c.h:474
Definition: protobuf-c.h:306
ProtobufCType
Definition: protobuf-c.h:297
const ProtobufCFieldDescriptor * fields
Definition: protobuf-c.h:674
ProtobufCWireType wire_type
Definition: protobuf-c.h:701
void(* free)(void *allocator_data, void *pointer)
Definition: protobuf-c.h:380
const char * name
Definition: protobuf-c.h:744
Definition: protobuf-c.h:300
const char * name
Definition: protobuf-c.h:713
Definition: protobuf-c.h:309
Definition: protobuf-c.h:299
const ProtobufCMethodDescriptor * methods
Definition: protobuf-c.h:754
const char * package_name
Definition: protobuf-c.h:663
const ProtobufCEnumValue * values
Definition: protobuf-c.h:502
Definition: protobuf-c.h:310
Definition: protobuf-c.h:375
unsigned reserved_flags
Definition: protobuf-c.h:600
Definition: protobuf-c.h:254
PROTOBUF_C__API size_t protobuf_c_message_get_packed_size(const ProtobufCMessage *message)
Definition: protobuf-c.c:640
size_t len
Definition: protobuf-c.h:394
PROTOBUF_C__API size_t protobuf_c_message_pack_to_buffer(const ProtobufCMessage *message, ProtobufCBuffer *buffer)
Definition: protobuf-c.c:1823
PROTOBUF_C__API size_t protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out)
Definition: protobuf-c.c:1369
Definition: protobuf-c.h:527
const ProtobufCEnumValueIndex * values_by_name
Definition: protobuf-c.h:507
PROTOBUF_C__API protobuf_c_boolean protobuf_c_message_check(const ProtobufCMessage *)
Definition: protobuf-c.c:3261
Definition: protobuf-c.h:615
Definition: protobuf-c.h:486
Definition: protobuf-c.h:640
uint32_t flags
Definition: protobuf-c.h:597
Definition: protobuf-c.h:304
const char * short_name
Definition: protobuf-c.h:659
const ProtobufCMessageDescriptor * output
Definition: protobuf-c.h:717
Definition: protobuf-c.h:739
const ProtobufCMessageDescriptor * input
Definition: protobuf-c.h:715
const char * package
Definition: protobuf-c.h:750
ProtobufCMessageUnknownField * unknown_fields
Definition: protobuf-c.h:646
unsigned n_value_ranges
Definition: protobuf-c.h:510
size_t sizeof_message
Definition: protobuf-c.h:669
unsigned quantifier_offset
Definition: protobuf-c.h:569
const char * c_name
Definition: protobuf-c.h:748
Definition: protobuf-c.h:313
ProtobufCFieldFlag
Definition: protobuf-c.h:252
Definition: protobuf-c.h:652
Definition: protobuf-c.h:308
const unsigned * fields_sorted_by_name
Definition: protobuf-c.h:676
Definition: protobuf-c.h:260
size_t len
Definition: protobuf-c.h:703
ProtobufCBuffer base
Definition: protobuf-c.h:470
unsigned n_value_names
Definition: protobuf-c.h:505
PROTOBUF_C__API const ProtobufCEnumValue * protobuf_c_enum_descriptor_get_value_by_name(const ProtobufCEnumDescriptor *desc, const char *name)
Definition: protobuf-c.c:3390
const void * descriptor
Definition: protobuf-c.h:588
unsigned n_methods
Definition: protobuf-c.h:752
unsigned n_fields
Definition: protobuf-c.h:672
uint32_t magic
Definition: protobuf-c.h:654
void * reserved1
Definition: protobuf-c.h:515
ProtobufCAllocator * allocator
Definition: protobuf-c.h:480
uint32_t magic
Definition: protobuf-c.h:488
const char * package_name
Definition: protobuf-c.h:497
uint8_t * data
Definition: protobuf-c.h:476
const char * name
Definition: protobuf-c.h:491
uint32_t magic
Definition: protobuf-c.h:741
ProtobufCType type
Definition: protobuf-c.h:562
Definition: protobuf-c.h:433
Definition: protobuf-c.h:697
Definition: protobuf-c.h:257
void * reserved2
Definition: protobuf-c.h:517
PROTOBUF_C__API const ProtobufCEnumValue * protobuf_c_enum_descriptor_get_value(const ProtobufCEnumDescriptor *desc, int value)
Definition: protobuf-c.c:3415
PROTOBUF_C__API const ProtobufCFieldDescriptor * protobuf_c_message_descriptor_get_field_by_name(const ProtobufCMessageDescriptor *desc, const char *name)
Definition: protobuf-c.c:3425
Definition: protobuf-c.h:541
PROTOBUF_C__API void protobuf_c_service_destroy(ProtobufCService *service)
Definition: protobuf-c.c:3382
unsigned n_values
Definition: protobuf-c.h:500
Definition: protobuf-c.h:273
void * reserved2
Definition: protobuf-c.h:689
PROTOBUF_C__API const ProtobufCMethodDescriptor * protobuf_c_service_descriptor_get_method_by_name(const ProtobufCServiceDescriptor *desc, const char *name)
Definition: protobuf-c.c:3464
const char * name
Definition: protobuf-c.h:543
void * reserved4
Definition: protobuf-c.h:521
unsigned n_field_ranges
Definition: protobuf-c.h:679
uint8_t * data
Definition: protobuf-c.h:705
void * reserved3
Definition: protobuf-c.h:519
const char * name
Definition: protobuf-c.h:529
unsigned index
Definition: protobuf-c.h:545
int protobuf_c_boolean
Definition: protobuf-c.h:366
int value
Definition: protobuf-c.h:535
const char * short_name
Definition: protobuf-c.h:493