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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: examples/example.proto */
#ifndef PROTOBUF_C_examples_2fexample_2eproto__INCLUDED
#define PROTOBUF_C_examples_2fexample_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1004001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct SomethingWithUINTs SomethingWithUINTs;
typedef struct SomethingMore SomethingMore;
typedef struct EvenMore EvenMore;
/* --- enums --- */
typedef enum _SomethingMore__Errors {
SOMETHING_MORE__ERRORS__SUCCESS = 200,
SOMETHING_MORE__ERRORS__ERROR_BAD_REQUEST = 400,
SOMETHING_MORE__ERRORS__ERROR_NOT_FOUND = 404,
SOMETHING_MORE__ERRORS__ERROR_SERVER_ERROR = 500,
SOMETHING_MORE__ERRORS__ERROR_SERVICE_UNAVAILABLE = 503
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(SOMETHING_MORE__ERRORS)
} SomethingMore__Errors;
typedef enum _EvenMore__SomeEnum {
EVEN_MORE__SOME_ENUM__FIRST = 254,
EVEN_MORE__SOME_ENUM__SECOND = 255
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(EVEN_MORE__SOME_ENUM)
} EvenMore__SomeEnum;
/* --- messages --- */
struct SomethingWithUINTs
{
ProtobufCMessage base;
protobuf_c_boolean has_id;
uint32_t id;
protobuf_c_boolean has_ip_address;
uint32_t ip_address;
protobuf_c_boolean has_port_num;
uint32_t port_num;
};
#define SOMETHING_WITH_UINTS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&something_with_uints__descriptor) \
, 0, 0, 0, 0, 0, 0 }
struct SomethingMore
{
ProtobufCMessage base;
protobuf_c_boolean has_error_code;
SomethingMore__Errors error_code;
SomethingWithUINTs *uints;
};
#define SOMETHING_MORE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&something_more__descriptor) \
, 0, SOMETHING_MORE__ERRORS__SUCCESS, NULL }
struct EvenMore
{
ProtobufCMessage base;
EvenMore__SomeEnum enum_value;
size_t n_uints;
SomethingWithUINTs **uints;
ProtobufCBinaryData name;
ProtobufCBinaryData value;
char *s;
};
#define EVEN_MORE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&even_more__descriptor) \
, EVEN_MORE__SOME_ENUM__FIRST, 0,NULL, {0,NULL}, {0,NULL}, NULL }
/* SomethingWithUINTs methods */
void something_with_uints__init
(SomethingWithUINTs *message);
size_t something_with_uints__get_packed_size
(const SomethingWithUINTs *message);
size_t something_with_uints__pack
(const SomethingWithUINTs *message,
uint8_t *out);
size_t something_with_uints__pack_to_buffer
(const SomethingWithUINTs *message,
ProtobufCBuffer *buffer);
SomethingWithUINTs *
something_with_uints__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void something_with_uints__free_unpacked
(SomethingWithUINTs *message,
ProtobufCAllocator *allocator);
/* SomethingMore methods */
void something_more__init
(SomethingMore *message);
size_t something_more__get_packed_size
(const SomethingMore *message);
size_t something_more__pack
(const SomethingMore *message,
uint8_t *out);
size_t something_more__pack_to_buffer
(const SomethingMore *message,
ProtobufCBuffer *buffer);
SomethingMore *
something_more__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void something_more__free_unpacked
(SomethingMore *message,
ProtobufCAllocator *allocator);
/* EvenMore methods */
void even_more__init
(EvenMore *message);
size_t even_more__get_packed_size
(const EvenMore *message);
size_t even_more__pack
(const EvenMore *message,
uint8_t *out);
size_t even_more__pack_to_buffer
(const EvenMore *message,
ProtobufCBuffer *buffer);
EvenMore *
even_more__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void even_more__free_unpacked
(EvenMore *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*SomethingWithUINTs_Closure)
(const SomethingWithUINTs *message,
void *closure_data);
typedef void (*SomethingMore_Closure)
(const SomethingMore *message,
void *closure_data);
typedef void (*EvenMore_Closure)
(const EvenMore *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor something_with_uints__descriptor;
extern const ProtobufCMessageDescriptor something_more__descriptor;
extern const ProtobufCEnumDescriptor something_more__errors__descriptor;
extern const ProtobufCMessageDescriptor even_more__descriptor;
extern const ProtobufCEnumDescriptor even_more__some_enum__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_examples_2fexample_2eproto__INCLUDED */
|