New upstream release.
Debian Janitor
2 years ago
0 | protobuf-c (1.4.0) | |
1 | ||
2 | [ Robert Edmonds ] | |
3 | * Release 1.4.0. | |
4 | ||
5 | [ Ilya Lipnitsky ] | |
6 | * c_message.cc: Resolve name conflict between certain enums and oneofs | |
7 | (#427). | |
8 | * protobuf-c.h: Fix Windows DLL export issue with the | |
9 | protobuf_c_empty_string symbol (#428). | |
10 | * Standardize pkg-config for use by autotools and cmake, fix cmake tests | |
11 | (#425). | |
12 | * protobuf-c.c: Cast %lu args to unsigned long int (#429). | |
13 | * protoc-c: Remove leading underscores from structs (#430). | |
14 | * protoc-c: Fix shared lib build on windows, migrate from Travis CI to | |
15 | GitHub Actions (#459). | |
16 | * protobuf-c: Don't use ProtobufCWireType internally (#463). | |
17 | * protoc-c: Add custom options support (#466). | |
18 | * protobuf-c.c: Fix packed repeated bool parsing (#467). | |
19 | ||
20 | [ Markus Engel ] | |
21 | * Pack nested messages inline (#431). | |
22 | ||
23 | [ Daniel Axtens ] | |
24 | * Travis CI: Test on other platforms (#438). | |
25 | ||
26 | [ Adam Cozzette ] | |
27 | * Update the generator to fully qualify std::string (#443). | |
28 | ||
29 | [ Piotr Pietraszkiewicz ] | |
30 | * Install MSVC debug symbols alongside the protobuf-c.lib file (#456). | |
31 | ||
32 | [ ihsinme ] | |
33 | * Fix invalid unsigned arithmetic (#455). | |
34 | ||
35 | [ Wolfram Rösler ] | |
36 | * Avoid "unused function parameter" compiler warning (#453). | |
37 | ||
0 | 38 | protobuf-c (1.3.3) |
1 | 39 | |
2 | 40 | [ Robert Edmonds ] |
41 | 41 | protobuf-c/libprotobuf-c.la |
42 | 42 | |
43 | 43 | nobase_include_HEADERS += \ |
44 | protobuf-c/protobuf-c.h | |
44 | protobuf-c/protobuf-c.h \ | |
45 | protobuf-c/protobuf-c.proto | |
45 | 46 | |
46 | 47 | protobuf_c_libprotobuf_c_la_SOURCES = \ |
47 | 48 | protobuf-c/protobuf-c.c \ |
98 | 99 | protoc-c/c_service.h \ |
99 | 100 | protoc-c/c_string_field.cc \ |
100 | 101 | protoc-c/c_string_field.h \ |
102 | protobuf-c/protobuf-c.pb.cc \ | |
103 | protobuf-c/protobuf-c.pb.h \ | |
101 | 104 | protoc-c/main.cc |
102 | 105 | protoc_c_protoc_gen_c_CXXFLAGS = \ |
103 | 106 | $(AM_CXXFLAGS) \ |
106 | 109 | $(protobuf_LIBS) \ |
107 | 110 | -lprotoc |
108 | 111 | |
112 | protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h: @PROTOC@ $(top_srcdir)/protobuf-c/protobuf-c.proto | |
113 | $(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/protobuf-c/protobuf-c.proto | |
114 | ||
115 | BUILT_SOURCES += \ | |
116 | protobuf-c/protobuf-c.pb.cc \ | |
117 | protobuf-c/protobuf-c.pb.h | |
109 | 118 | # |
110 | 119 | # protoc-c compat link |
111 | 120 | # |
154 | 163 | |
155 | 164 | t_generated_code2_cxx_generate_packed_data_SOURCES = \ |
156 | 165 | t/generated-code2/cxx-generate-packed-data.cc \ |
157 | t/test-full.pb.cc | |
166 | t/test-full.pb.cc \ | |
167 | protobuf-c/protobuf-c.pb.cc | |
158 | 168 | $(t_generated_code2_cxx_generate_packed_data_OBJECTS): t/test-full.pb.h |
159 | 169 | t_generated_code2_cxx_generate_packed_data_CXXFLAGS = \ |
160 | 170 | $(AM_CXXFLAGS) \ |
215 | 225 | t_version_version_LDADD = \ |
216 | 226 | protobuf-c/libprotobuf-c.la |
217 | 227 | |
228 | # Issue #204 | |
229 | check_PROGRAMS += \ | |
230 | t/issue204/issue204 | |
231 | TESTS += \ | |
232 | t/issue204/issue204 | |
233 | t_issue204_issue204_SOURCES = \ | |
234 | t/issue204/issue204.c \ | |
235 | t/issue204/issue204.pb-c.c | |
236 | t_issue204_issue204_LDADD = \ | |
237 | protobuf-c/libprotobuf-c.la | |
238 | t/issue204/issue204.pb-c.c t/issue204/issue204.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue204/issue204.proto | |
239 | $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue204/issue204.proto | |
240 | BUILT_SOURCES += \ | |
241 | t/issue204/issue204.pb-c.c t/issue204/issue204.pb-c.h | |
242 | EXTRA_DIST += \ | |
243 | t/issue204/issue204.proto | |
244 | ||
218 | 245 | # Issue #220 |
219 | 246 | check_PROGRAMS += \ |
220 | 247 | t/issue220/issue220 |
264 | 291 | $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue330/issue330.proto |
265 | 292 | BUILT_SOURCES += \ |
266 | 293 | t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h |
294 | ||
295 | t_issue330_issue330_SOURCES += \ | |
296 | t/issue389/issue389.pb-c.c # Tack onto issue330 since there is no need for a separate binary here | |
297 | t/issue389/issue389.pb-c.c t/issue389/issue389.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue389/issue389.proto | |
298 | $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue389/issue389.proto | |
299 | BUILT_SOURCES += \ | |
300 | t/issue389/issue389.pb-c.c t/issue389/issue389.pb-c.h | |
301 | EXTRA_DIST += \ | |
302 | t/issue389/issue389.proto | |
303 | ||
304 | check_PROGRAMS += \ | |
305 | t/issue440/issue440 | |
306 | TESTS += \ | |
307 | t/issue440/issue440 | |
308 | t_issue440_issue440_SOURCES = \ | |
309 | t/issue440/issue440.c \ | |
310 | t/issue440/issue440.pb-c.c | |
311 | t_issue440_issue440_LDADD = \ | |
312 | protobuf-c/libprotobuf-c.la | |
313 | t/issue440/issue440.pb-c.c t/issue440/issue440.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue440/issue440.proto | |
314 | $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue440/issue440.proto | |
315 | BUILT_SOURCES += \ | |
316 | t/issue440/issue440.pb-c.c t/issue440/issue440.pb-c.h | |
317 | EXTRA_DIST += \ | |
318 | t/issue440/issue440.proto | |
267 | 319 | endif # BUILD_PROTO3 |
268 | 320 | EXTRA_DIST += \ |
269 | 321 | t/issue330/issue330.proto |
0 | # Makefile.in generated by automake 1.16.1 from Makefile.am. | |
0 | # Makefile.in generated by automake 1.16.3 from Makefile.am. | |
1 | 1 | # @configure_input@ |
2 | 2 | |
3 | # Copyright (C) 1994-2018 Free Software Foundation, Inc. | |
3 | # Copyright (C) 1994-2020 Free Software Foundation, Inc. | |
4 | 4 | |
5 | 5 | # This Makefile.in is free software; the Free Software Foundation |
6 | 6 | # gives unlimited permission to copy and/or distribute it, |
107 | 107 | # protoc-gen-c |
108 | 108 | # |
109 | 109 | @BUILD_COMPILER_TRUE@am__append_3 = protoc-c/protoc-gen-c |
110 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_4 = \ | |
111 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code/test-generated-code \ | |
112 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-generated-code2 \ | |
113 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version | |
110 | @BUILD_COMPILER_TRUE@am__append_4 = \ | |
111 | @BUILD_COMPILER_TRUE@ protobuf-c/protobuf-c.pb.cc \ | |
112 | @BUILD_COMPILER_TRUE@ protobuf-c/protobuf-c.pb.h | |
114 | 113 | |
115 | 114 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_5 = \ |
116 | 115 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code/test-generated-code \ |
118 | 117 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version |
119 | 118 | |
120 | 119 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_6 = \ |
120 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code/test-generated-code \ | |
121 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-generated-code2 \ | |
122 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version | |
123 | ||
124 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_7 = \ | |
121 | 125 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/cxx-generate-packed-data |
122 | 126 | |
123 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_7 = \ | |
127 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_8 = \ | |
124 | 128 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test.pb-c.c t/test.pb-c.h \ |
125 | 129 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb-c.c t/test-full.pb-c.h \ |
126 | 130 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-optimized.pb-c.c t/test-optimized.pb-c.h \ |
127 | 131 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb.cc t/test-full.pb.h \ |
128 | 132 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-full-cxx-output.inc |
129 | 133 | |
130 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_8 = \ | |
131 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code3/test-generated-code3 | |
132 | ||
133 | 134 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_9 = \ |
134 | 135 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code3/test-generated-code3 |
135 | 136 | |
136 | 137 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_10 = \ |
138 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code3/test-generated-code3 | |
139 | ||
140 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_11 = \ | |
137 | 141 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/test-proto3.pb-c.c t/test-proto3.pb-c.h |
138 | 142 | |
139 | 143 | |
144 | # Issue #204 | |
145 | ||
140 | 146 | # Issue #220 |
141 | 147 | |
142 | 148 | # Issue #251 |
143 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_11 = t/issue220/issue220 \ | |
149 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_12 = t/issue204/issue204 \ | |
150 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220 \ | |
144 | 151 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251 |
145 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_12 = t/issue220/issue220 \ | |
152 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_13 = t/issue204/issue204 \ | |
153 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220 \ | |
146 | 154 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251 |
147 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_13 = t/issue220/issue220.pb-c.c \ | |
155 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_14 = t/issue204/issue204.pb-c.c \ | |
156 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue204/issue204.pb-c.h \ | |
157 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.pb-c.c \ | |
148 | 158 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.pb-c.h \ |
149 | 159 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251.pb-c.c \ |
150 | 160 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251.pb-c.h |
151 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_14 = t/issue220/issue220.proto \ | |
152 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251.proto \ | |
153 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.proto \ | |
161 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_15 = t/issue204/issue204.proto \ | |
162 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.proto \ | |
163 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251.proto | |
164 | ||
165 | # Issue #330 | |
166 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_16 = t/issue330/issue330 \ | |
167 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440 | |
168 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_17 = t/issue330/issue330 \ | |
169 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440 | |
170 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_18 = t/issue330/issue330.pb-c.c \ | |
171 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.h \ | |
172 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue389/issue389.pb-c.c \ | |
173 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue389/issue389.pb-c.h \ | |
174 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.pb-c.c \ | |
175 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.pb-c.h | |
176 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_19 = t/issue389/issue389.proto \ | |
177 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.proto | |
178 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_20 = t/issue330/issue330.proto \ | |
154 | 179 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.proto |
155 | 180 | |
156 | # Issue #330 | |
157 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_15 = \ | |
158 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330 | |
159 | ||
160 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_16 = \ | |
161 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330 | |
162 | ||
163 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_17 = \ | |
164 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h | |
165 | ||
166 | ||
167 | 181 | # Issue #375 |
168 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_18 = \ | |
182 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_21 = \ | |
169 | 183 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375 |
170 | 184 | |
171 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_19 = \ | |
185 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_22 = \ | |
172 | 186 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375 |
173 | 187 | |
174 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_20 = \ | |
188 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_23 = \ | |
175 | 189 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.pb-c.c t/issue375/issue375.pb-c.h |
176 | 190 | |
177 | 191 | subdir = . |
202 | 216 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-generated-code2$(EXEEXT) \ |
203 | 217 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version$(EXEEXT) |
204 | 218 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_3 = t/generated-code3/test-generated-code3$(EXEEXT) |
205 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_4 = t/issue220/issue220$(EXEEXT) \ | |
219 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_4 = t/issue204/issue204$(EXEEXT) \ | |
220 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220$(EXEEXT) \ | |
206 | 221 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251$(EXEEXT) |
207 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_5 = t/issue330/issue330$(EXEEXT) | |
222 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_5 = t/issue330/issue330$(EXEEXT) \ | |
223 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440$(EXEEXT) | |
208 | 224 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_6 = t/issue375/issue375$(EXEEXT) |
209 | 225 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_7 = t/generated-code2/cxx-generate-packed-data$(EXEEXT) |
210 | 226 | PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) |
261 | 277 | protoc-c/c_message_field.h protoc-c/c_primitive_field.cc \ |
262 | 278 | protoc-c/c_primitive_field.h protoc-c/c_service.cc \ |
263 | 279 | protoc-c/c_service.h protoc-c/c_string_field.cc \ |
264 | protoc-c/c_string_field.h protoc-c/main.cc | |
280 | protoc-c/c_string_field.h protobuf-c/protobuf-c.pb.cc \ | |
281 | protobuf-c/protobuf-c.pb.h protoc-c/main.cc | |
265 | 282 | @BUILD_COMPILER_TRUE@am_protoc_c_protoc_gen_c_OBJECTS = protoc-c/protoc_gen_c-c_bytes_field.$(OBJEXT) \ |
266 | 283 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_enum.$(OBJEXT) \ |
267 | 284 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_enum_field.$(OBJEXT) \ |
275 | 292 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_primitive_field.$(OBJEXT) \ |
276 | 293 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_service.$(OBJEXT) \ |
277 | 294 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_string_field.$(OBJEXT) \ |
295 | @BUILD_COMPILER_TRUE@ protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.$(OBJEXT) \ | |
278 | 296 | @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-main.$(OBJEXT) |
279 | 297 | protoc_c_protoc_gen_c_OBJECTS = $(am_protoc_c_protoc_gen_c_OBJECTS) |
280 | 298 | am__DEPENDENCIES_1 = |
293 | 311 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code_test_generated_code_DEPENDENCIES = protobuf-c/libprotobuf-c.la |
294 | 312 | am__t_generated_code2_cxx_generate_packed_data_SOURCES_DIST = \ |
295 | 313 | t/generated-code2/cxx-generate-packed-data.cc \ |
296 | t/test-full.pb.cc | |
314 | t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc | |
297 | 315 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_generated_code2_cxx_generate_packed_data_OBJECTS = t/generated-code2/cxx_generate_packed_data-cxx-generate-packed-data.$(OBJEXT) \ |
298 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated_code2_cxx_generate_packed_data-test-full.pb.$(OBJEXT) | |
316 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated_code2_cxx_generate_packed_data-test-full.pb.$(OBJEXT) \ | |
317 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.$(OBJEXT) | |
299 | 318 | t_generated_code2_cxx_generate_packed_data_OBJECTS = \ |
300 | 319 | $(am_t_generated_code2_cxx_generate_packed_data_OBJECTS) |
301 | 320 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_DEPENDENCIES = $(am__DEPENDENCIES_1) |
320 | 339 | t_generated_code3_test_generated_code3_OBJECTS = \ |
321 | 340 | $(am_t_generated_code3_test_generated_code3_OBJECTS) |
322 | 341 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_generated_code3_test_generated_code3_DEPENDENCIES = protobuf-c/libprotobuf-c.la |
342 | am__t_issue204_issue204_SOURCES_DIST = t/issue204/issue204.c \ | |
343 | t/issue204/issue204.pb-c.c | |
344 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_issue204_issue204_OBJECTS = t/issue204/issue204.$(OBJEXT) \ | |
345 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue204/issue204.pb-c.$(OBJEXT) | |
346 | t_issue204_issue204_OBJECTS = $(am_t_issue204_issue204_OBJECTS) | |
347 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue204_issue204_DEPENDENCIES = protobuf-c/libprotobuf-c.la | |
323 | 348 | am__t_issue220_issue220_SOURCES_DIST = t/issue220/issue220.c \ |
324 | 349 | t/issue220/issue220.pb-c.c |
325 | 350 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_issue220_issue220_OBJECTS = t/issue220/issue220.$(OBJEXT) \ |
333 | 358 | t_issue251_issue251_OBJECTS = $(am_t_issue251_issue251_OBJECTS) |
334 | 359 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue251_issue251_DEPENDENCIES = protobuf-c/libprotobuf-c.la |
335 | 360 | am__t_issue330_issue330_SOURCES_DIST = t/issue330/issue330.c \ |
336 | t/issue330/issue330.pb-c.c | |
361 | t/issue330/issue330.pb-c.c t/issue389/issue389.pb-c.c | |
337 | 362 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am_t_issue330_issue330_OBJECTS = t/issue330/issue330.$(OBJEXT) \ |
338 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.$(OBJEXT) | |
363 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.$(OBJEXT) \ | |
364 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue389/issue389.pb-c.$(OBJEXT) | |
339 | 365 | t_issue330_issue330_OBJECTS = $(am_t_issue330_issue330_OBJECTS) |
340 | 366 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue330_issue330_DEPENDENCIES = protobuf-c/libprotobuf-c.la |
341 | 367 | am__t_issue375_issue375_SOURCES_DIST = t/issue375/issue375.c \ |
344 | 370 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.pb-c.$(OBJEXT) |
345 | 371 | t_issue375_issue375_OBJECTS = $(am_t_issue375_issue375_OBJECTS) |
346 | 372 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue375_issue375_DEPENDENCIES = protobuf-c/libprotobuf-c.la |
373 | am__t_issue440_issue440_SOURCES_DIST = t/issue440/issue440.c \ | |
374 | t/issue440/issue440.pb-c.c | |
375 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am_t_issue440_issue440_OBJECTS = t/issue440/issue440.$(OBJEXT) \ | |
376 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.pb-c.$(OBJEXT) | |
377 | t_issue440_issue440_OBJECTS = $(am_t_issue440_issue440_OBJECTS) | |
378 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue440_issue440_DEPENDENCIES = protobuf-c/libprotobuf-c.la | |
347 | 379 | am__t_version_version_SOURCES_DIST = t/version/version.c |
348 | 380 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_version_version_OBJECTS = t/version/version.$(OBJEXT) |
349 | 381 | t_version_version_OBJECTS = $(am_t_version_version_OBJECTS) |
364 | 396 | depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp |
365 | 397 | am__maybe_remake_depfiles = depfiles |
366 | 398 | am__depfiles_remade = protobuf-c/$(DEPDIR)/protobuf-c.Plo \ |
399 | protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po \ | |
400 | protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po \ | |
367 | 401 | protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po \ |
368 | 402 | protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po \ |
369 | 403 | protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po \ |
386 | 420 | t/generated-code/$(DEPDIR)/test-generated-code.Po \ |
387 | 421 | t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po \ |
388 | 422 | t/generated-code2/$(DEPDIR)/test-generated-code2.Po \ |
423 | t/issue204/$(DEPDIR)/issue204.Po \ | |
424 | t/issue204/$(DEPDIR)/issue204.pb-c.Po \ | |
389 | 425 | t/issue220/$(DEPDIR)/issue220.Po \ |
390 | 426 | t/issue220/$(DEPDIR)/issue220.pb-c.Po \ |
391 | 427 | t/issue251/$(DEPDIR)/issue251.Po \ |
394 | 430 | t/issue330/$(DEPDIR)/issue330.pb-c.Po \ |
395 | 431 | t/issue375/$(DEPDIR)/issue375.Po \ |
396 | 432 | t/issue375/$(DEPDIR)/issue375.pb-c.Po \ |
433 | t/issue389/$(DEPDIR)/issue389.pb-c.Po \ | |
434 | t/issue440/$(DEPDIR)/issue440.Po \ | |
435 | t/issue440/$(DEPDIR)/issue440.pb-c.Po \ | |
397 | 436 | t/version/$(DEPDIR)/version.Po |
398 | 437 | am__mv = mv -f |
399 | 438 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ |
438 | 477 | $(t_generated_code2_cxx_generate_packed_data_SOURCES) \ |
439 | 478 | $(t_generated_code2_test_generated_code2_SOURCES) \ |
440 | 479 | $(t_generated_code3_test_generated_code3_SOURCES) \ |
441 | $(t_issue220_issue220_SOURCES) $(t_issue251_issue251_SOURCES) \ | |
442 | $(t_issue330_issue330_SOURCES) $(t_issue375_issue375_SOURCES) \ | |
480 | $(t_issue204_issue204_SOURCES) $(t_issue220_issue220_SOURCES) \ | |
481 | $(t_issue251_issue251_SOURCES) $(t_issue330_issue330_SOURCES) \ | |
482 | $(t_issue375_issue375_SOURCES) $(t_issue440_issue440_SOURCES) \ | |
443 | 483 | $(t_version_version_SOURCES) |
444 | 484 | DIST_SOURCES = $(protobuf_c_libprotobuf_c_la_SOURCES) \ |
445 | 485 | $(am__protoc_c_protoc_gen_c_SOURCES_DIST) \ |
447 | 487 | $(am__t_generated_code2_cxx_generate_packed_data_SOURCES_DIST) \ |
448 | 488 | $(am__t_generated_code2_test_generated_code2_SOURCES_DIST) \ |
449 | 489 | $(am__t_generated_code3_test_generated_code3_SOURCES_DIST) \ |
490 | $(am__t_issue204_issue204_SOURCES_DIST) \ | |
450 | 491 | $(am__t_issue220_issue220_SOURCES_DIST) \ |
451 | 492 | $(am__t_issue251_issue251_SOURCES_DIST) \ |
452 | 493 | $(am__t_issue330_issue330_SOURCES_DIST) \ |
453 | 494 | $(am__t_issue375_issue375_SOURCES_DIST) \ |
495 | $(am__t_issue440_issue440_SOURCES_DIST) \ | |
454 | 496 | $(am__t_version_version_SOURCES_DIST) |
455 | 497 | am__can_run_installinfo = \ |
456 | 498 | case $$AM_UPDATE_INFO_DIR in \ |
459 | 501 | esac |
460 | 502 | DATA = $(pkgconfig_DATA) |
461 | 503 | HEADERS = $(nobase_include_HEADERS) |
462 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ | |
463 | $(LISP)config.h.in | |
504 | am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ | |
505 | config.h.in | |
464 | 506 | # Read a list of newline-separated strings from the standard input, |
465 | 507 | # and print each of them once, without duplicates. Input order is |
466 | 508 | # *not* preserved. |
636 | 678 | bases='$(TEST_LOGS)'; \ |
637 | 679 | bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ |
638 | 680 | bases=`echo $$bases` |
681 | AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' | |
639 | 682 | RECHECK_LOGS = $(TEST_LOGS) |
640 | 683 | TEST_SUITE_LOG = test-suite.log |
641 | 684 | TEST_EXTENSIONS = @EXEEXT@ .test |
683 | 726 | DIST_ARCHIVES = $(distdir).tar.gz |
684 | 727 | GZIP_ENV = --best |
685 | 728 | DIST_TARGETS = dist-gzip |
729 | # Exists only to be overridden by the user if desired. | |
730 | AM_DISTCHECK_DVI_TARGET = dvi | |
686 | 731 | distuninstallcheck_listfiles = find . -type f -print |
687 | 732 | am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ |
688 | 733 | | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' |
827 | 872 | top_builddir = @top_builddir@ |
828 | 873 | top_srcdir = @top_srcdir@ |
829 | 874 | lib_LTLIBRARIES = protobuf-c/libprotobuf-c.la |
830 | nobase_include_HEADERS = protobuf-c/protobuf-c.h | |
875 | nobase_include_HEADERS = protobuf-c/protobuf-c.h \ | |
876 | protobuf-c/protobuf-c.proto | |
831 | 877 | pkgconfig_DATA = protobuf-c/libprotobuf-c.pc |
832 | BUILT_SOURCES = $(am__append_7) $(am__append_10) $(am__append_13) \ | |
833 | $(am__append_17) $(am__append_20) | |
878 | BUILT_SOURCES = $(am__append_4) $(am__append_8) $(am__append_11) \ | |
879 | $(am__append_14) $(am__append_18) $(am__append_23) | |
834 | 880 | |
835 | 881 | # |
836 | 882 | # |
838 | 884 | CLEANFILES = protobuf-c/libprotobuf-c.pc $(BUILT_SOURCES) |
839 | 885 | DISTCLEANFILES = |
840 | 886 | EXTRA_DIST = LICENSE README.md protobuf-c/libprotobuf-c.sym \ |
841 | protobuf-c/libprotobuf-c.pc.in $(am__append_14) t/test.proto \ | |
887 | protobuf-c/libprotobuf-c.pc.in $(am__append_15) \ | |
888 | $(am__append_19) $(am__append_20) t/test.proto \ | |
842 | 889 | t/test-full.proto t/test-optimized.proto t/test-proto3.proto \ |
843 | 890 | t/generated-code2/common-test-arrays.h Doxyfile.in \ |
844 | 891 | DoxygenLayout.xml build-cmake/CMakeLists.txt |
896 | 943 | @BUILD_COMPILER_TRUE@ protoc-c/c_service.h \ |
897 | 944 | @BUILD_COMPILER_TRUE@ protoc-c/c_string_field.cc \ |
898 | 945 | @BUILD_COMPILER_TRUE@ protoc-c/c_string_field.h \ |
946 | @BUILD_COMPILER_TRUE@ protobuf-c/protobuf-c.pb.cc \ | |
947 | @BUILD_COMPILER_TRUE@ protobuf-c/protobuf-c.pb.h \ | |
899 | 948 | @BUILD_COMPILER_TRUE@ protoc-c/main.cc |
900 | 949 | |
901 | 950 | @BUILD_COMPILER_TRUE@protoc_c_protoc_gen_c_CXXFLAGS = \ |
932 | 981 | |
933 | 982 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_SOURCES = \ |
934 | 983 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/cxx-generate-packed-data.cc \ |
935 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb.cc | |
984 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb.cc \ | |
985 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/protobuf-c.pb.cc | |
936 | 986 | |
937 | 987 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_CXXFLAGS = \ |
938 | 988 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_CXXFLAGS) \ |
957 | 1007 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_version_version_LDADD = \ |
958 | 1008 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la |
959 | 1009 | |
1010 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue204_issue204_SOURCES = \ | |
1011 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue204/issue204.c \ | |
1012 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue204/issue204.pb-c.c | |
1013 | ||
1014 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue204_issue204_LDADD = \ | |
1015 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la | |
1016 | ||
960 | 1017 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue220_issue220_SOURCES = \ |
961 | 1018 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.c \ |
962 | 1019 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.pb-c.c |
971 | 1028 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue251_issue251_LDADD = \ |
972 | 1029 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la |
973 | 1030 | |
974 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue330_issue330_SOURCES = \ | |
975 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.c \ | |
976 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.c | |
977 | ||
1031 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue330_issue330_SOURCES = t/issue330/issue330.c \ | |
1032 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue330/issue330.pb-c.c \ | |
1033 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue389/issue389.pb-c.c \ | |
1034 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ # \ | |
1035 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ Tack \ | |
1036 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ onto \ | |
1037 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ issue330 \ | |
1038 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ since \ | |
1039 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ there \ | |
1040 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ is \ | |
1041 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ no \ | |
1042 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ need \ | |
1043 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ for \ | |
1044 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ a \ | |
1045 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ separate \ | |
1046 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ binary \ | |
1047 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ here | |
978 | 1048 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue330_issue330_LDADD = \ |
1049 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la | |
1050 | ||
1051 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue440_issue440_SOURCES = \ | |
1052 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.c \ | |
1053 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/issue440/issue440.pb-c.c | |
1054 | ||
1055 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue440_issue440_LDADD = \ | |
979 | 1056 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la |
980 | 1057 | |
981 | 1058 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue375_issue375_SOURCES = \ |
1187 | 1264 | protoc-c/$(DEPDIR)/$(am__dirstamp) |
1188 | 1265 | protoc-c/protoc_gen_c-c_string_field.$(OBJEXT): \ |
1189 | 1266 | protoc-c/$(am__dirstamp) protoc-c/$(DEPDIR)/$(am__dirstamp) |
1267 | protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.$(OBJEXT): \ | |
1268 | protobuf-c/$(am__dirstamp) \ | |
1269 | protobuf-c/$(DEPDIR)/$(am__dirstamp) | |
1190 | 1270 | protoc-c/protoc_gen_c-main.$(OBJEXT): protoc-c/$(am__dirstamp) \ |
1191 | 1271 | protoc-c/$(DEPDIR)/$(am__dirstamp) |
1192 | 1272 | |
1224 | 1304 | t/generated-code2/$(DEPDIR)/$(am__dirstamp) |
1225 | 1305 | t/generated_code2_cxx_generate_packed_data-test-full.pb.$(OBJEXT): \ |
1226 | 1306 | t/$(am__dirstamp) t/$(DEPDIR)/$(am__dirstamp) |
1307 | protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.$(OBJEXT): \ | |
1308 | protobuf-c/$(am__dirstamp) \ | |
1309 | protobuf-c/$(DEPDIR)/$(am__dirstamp) | |
1227 | 1310 | |
1228 | 1311 | t/generated-code2/cxx-generate-packed-data$(EXEEXT): $(t_generated_code2_cxx_generate_packed_data_OBJECTS) $(t_generated_code2_cxx_generate_packed_data_DEPENDENCIES) $(EXTRA_t_generated_code2_cxx_generate_packed_data_DEPENDENCIES) t/generated-code2/$(am__dirstamp) |
1229 | 1312 | @rm -f t/generated-code2/cxx-generate-packed-data$(EXEEXT) |
1251 | 1334 | t/generated-code3/test-generated-code3$(EXEEXT): $(t_generated_code3_test_generated_code3_OBJECTS) $(t_generated_code3_test_generated_code3_DEPENDENCIES) $(EXTRA_t_generated_code3_test_generated_code3_DEPENDENCIES) t/generated-code3/$(am__dirstamp) |
1252 | 1335 | @rm -f t/generated-code3/test-generated-code3$(EXEEXT) |
1253 | 1336 | $(AM_V_CCLD)$(LINK) $(t_generated_code3_test_generated_code3_OBJECTS) $(t_generated_code3_test_generated_code3_LDADD) $(LIBS) |
1337 | t/issue204/$(am__dirstamp): | |
1338 | @$(MKDIR_P) t/issue204 | |
1339 | @: > t/issue204/$(am__dirstamp) | |
1340 | t/issue204/$(DEPDIR)/$(am__dirstamp): | |
1341 | @$(MKDIR_P) t/issue204/$(DEPDIR) | |
1342 | @: > t/issue204/$(DEPDIR)/$(am__dirstamp) | |
1343 | t/issue204/issue204.$(OBJEXT): t/issue204/$(am__dirstamp) \ | |
1344 | t/issue204/$(DEPDIR)/$(am__dirstamp) | |
1345 | t/issue204/issue204.pb-c.$(OBJEXT): t/issue204/$(am__dirstamp) \ | |
1346 | t/issue204/$(DEPDIR)/$(am__dirstamp) | |
1347 | ||
1348 | t/issue204/issue204$(EXEEXT): $(t_issue204_issue204_OBJECTS) $(t_issue204_issue204_DEPENDENCIES) $(EXTRA_t_issue204_issue204_DEPENDENCIES) t/issue204/$(am__dirstamp) | |
1349 | @rm -f t/issue204/issue204$(EXEEXT) | |
1350 | $(AM_V_CCLD)$(LINK) $(t_issue204_issue204_OBJECTS) $(t_issue204_issue204_LDADD) $(LIBS) | |
1254 | 1351 | t/issue220/$(am__dirstamp): |
1255 | 1352 | @$(MKDIR_P) t/issue220 |
1256 | 1353 | @: > t/issue220/$(am__dirstamp) |
1289 | 1386 | t/issue330/$(DEPDIR)/$(am__dirstamp) |
1290 | 1387 | t/issue330/issue330.pb-c.$(OBJEXT): t/issue330/$(am__dirstamp) \ |
1291 | 1388 | t/issue330/$(DEPDIR)/$(am__dirstamp) |
1389 | t/issue389/$(am__dirstamp): | |
1390 | @$(MKDIR_P) t/issue389 | |
1391 | @: > t/issue389/$(am__dirstamp) | |
1392 | t/issue389/$(DEPDIR)/$(am__dirstamp): | |
1393 | @$(MKDIR_P) t/issue389/$(DEPDIR) | |
1394 | @: > t/issue389/$(DEPDIR)/$(am__dirstamp) | |
1395 | t/issue389/issue389.pb-c.$(OBJEXT): t/issue389/$(am__dirstamp) \ | |
1396 | t/issue389/$(DEPDIR)/$(am__dirstamp) | |
1292 | 1397 | |
1293 | 1398 | t/issue330/issue330$(EXEEXT): $(t_issue330_issue330_OBJECTS) $(t_issue330_issue330_DEPENDENCIES) $(EXTRA_t_issue330_issue330_DEPENDENCIES) t/issue330/$(am__dirstamp) |
1294 | 1399 | @rm -f t/issue330/issue330$(EXEEXT) |
1307 | 1412 | t/issue375/issue375$(EXEEXT): $(t_issue375_issue375_OBJECTS) $(t_issue375_issue375_DEPENDENCIES) $(EXTRA_t_issue375_issue375_DEPENDENCIES) t/issue375/$(am__dirstamp) |
1308 | 1413 | @rm -f t/issue375/issue375$(EXEEXT) |
1309 | 1414 | $(AM_V_CCLD)$(LINK) $(t_issue375_issue375_OBJECTS) $(t_issue375_issue375_LDADD) $(LIBS) |
1415 | t/issue440/$(am__dirstamp): | |
1416 | @$(MKDIR_P) t/issue440 | |
1417 | @: > t/issue440/$(am__dirstamp) | |
1418 | t/issue440/$(DEPDIR)/$(am__dirstamp): | |
1419 | @$(MKDIR_P) t/issue440/$(DEPDIR) | |
1420 | @: > t/issue440/$(DEPDIR)/$(am__dirstamp) | |
1421 | t/issue440/issue440.$(OBJEXT): t/issue440/$(am__dirstamp) \ | |
1422 | t/issue440/$(DEPDIR)/$(am__dirstamp) | |
1423 | t/issue440/issue440.pb-c.$(OBJEXT): t/issue440/$(am__dirstamp) \ | |
1424 | t/issue440/$(DEPDIR)/$(am__dirstamp) | |
1425 | ||
1426 | t/issue440/issue440$(EXEEXT): $(t_issue440_issue440_OBJECTS) $(t_issue440_issue440_DEPENDENCIES) $(EXTRA_t_issue440_issue440_DEPENDENCIES) t/issue440/$(am__dirstamp) | |
1427 | @rm -f t/issue440/issue440$(EXEEXT) | |
1428 | $(AM_V_CCLD)$(LINK) $(t_issue440_issue440_OBJECTS) $(t_issue440_issue440_LDADD) $(LIBS) | |
1310 | 1429 | t/version/$(am__dirstamp): |
1311 | 1430 | @$(MKDIR_P) t/version |
1312 | 1431 | @: > t/version/$(am__dirstamp) |
1328 | 1447 | -rm -f t/*.$(OBJEXT) |
1329 | 1448 | -rm -f t/generated-code/*.$(OBJEXT) |
1330 | 1449 | -rm -f t/generated-code2/*.$(OBJEXT) |
1450 | -rm -f t/issue204/*.$(OBJEXT) | |
1331 | 1451 | -rm -f t/issue220/*.$(OBJEXT) |
1332 | 1452 | -rm -f t/issue251/*.$(OBJEXT) |
1333 | 1453 | -rm -f t/issue330/*.$(OBJEXT) |
1334 | 1454 | -rm -f t/issue375/*.$(OBJEXT) |
1455 | -rm -f t/issue389/*.$(OBJEXT) | |
1456 | -rm -f t/issue440/*.$(OBJEXT) | |
1335 | 1457 | -rm -f t/version/*.$(OBJEXT) |
1336 | 1458 | |
1337 | 1459 | distclean-compile: |
1338 | 1460 | -rm -f *.tab.c |
1339 | 1461 | |
1340 | 1462 | @AMDEP_TRUE@@am__include@ @am__quote@protobuf-c/$(DEPDIR)/protobuf-c.Plo@am__quote@ # am--include-marker |
1463 | @AMDEP_TRUE@@am__include@ @am__quote@protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po@am__quote@ # am--include-marker | |
1464 | @AMDEP_TRUE@@am__include@ @am__quote@protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po@am__quote@ # am--include-marker | |
1341 | 1465 | @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po@am__quote@ # am--include-marker |
1342 | 1466 | @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po@am__quote@ # am--include-marker |
1343 | 1467 | @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po@am__quote@ # am--include-marker |
1361 | 1485 | @AMDEP_TRUE@@am__include@ @am__quote@t/generated-code/$(DEPDIR)/test-generated-code.Po@am__quote@ # am--include-marker |
1362 | 1486 | @AMDEP_TRUE@@am__include@ @am__quote@t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po@am__quote@ # am--include-marker |
1363 | 1487 | @AMDEP_TRUE@@am__include@ @am__quote@t/generated-code2/$(DEPDIR)/test-generated-code2.Po@am__quote@ # am--include-marker |
1488 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue204/$(DEPDIR)/issue204.Po@am__quote@ # am--include-marker | |
1489 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue204/$(DEPDIR)/issue204.pb-c.Po@am__quote@ # am--include-marker | |
1364 | 1490 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue220/$(DEPDIR)/issue220.Po@am__quote@ # am--include-marker |
1365 | 1491 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue220/$(DEPDIR)/issue220.pb-c.Po@am__quote@ # am--include-marker |
1366 | 1492 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue251/$(DEPDIR)/issue251.Po@am__quote@ # am--include-marker |
1369 | 1495 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue330/$(DEPDIR)/issue330.pb-c.Po@am__quote@ # am--include-marker |
1370 | 1496 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue375/$(DEPDIR)/issue375.Po@am__quote@ # am--include-marker |
1371 | 1497 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue375/$(DEPDIR)/issue375.pb-c.Po@am__quote@ # am--include-marker |
1498 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue389/$(DEPDIR)/issue389.pb-c.Po@am__quote@ # am--include-marker | |
1499 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue440/$(DEPDIR)/issue440.Po@am__quote@ # am--include-marker | |
1500 | @AMDEP_TRUE@@am__include@ @am__quote@t/issue440/$(DEPDIR)/issue440.pb-c.Po@am__quote@ # am--include-marker | |
1372 | 1501 | @AMDEP_TRUE@@am__include@ @am__quote@t/version/$(DEPDIR)/version.Po@am__quote@ # am--include-marker |
1373 | 1502 | |
1374 | 1503 | $(am__depfiles_remade): |
1635 | 1764 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
1636 | 1765 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -c -o protoc-c/protoc_gen_c-c_string_field.obj `if test -f 'protoc-c/c_string_field.cc'; then $(CYGPATH_W) 'protoc-c/c_string_field.cc'; else $(CYGPATH_W) '$(srcdir)/protoc-c/c_string_field.cc'; fi` |
1637 | 1766 | |
1767 | protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o: protobuf-c/protobuf-c.pb.cc | |
1768 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -MT protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o -MD -MP -MF protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Tpo -c -o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o `test -f 'protobuf-c/protobuf-c.pb.cc' || echo '$(srcdir)/'`protobuf-c/protobuf-c.pb.cc | |
1769 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Tpo protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po | |
1770 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='protobuf-c/protobuf-c.pb.cc' object='protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o' libtool=no @AMDEPBACKSLASH@ | |
1771 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
1772 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -c -o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.o `test -f 'protobuf-c/protobuf-c.pb.cc' || echo '$(srcdir)/'`protobuf-c/protobuf-c.pb.cc | |
1773 | ||
1774 | protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.obj: protobuf-c/protobuf-c.pb.cc | |
1775 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -MT protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.obj -MD -MP -MF protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Tpo -c -o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.obj `if test -f 'protobuf-c/protobuf-c.pb.cc'; then $(CYGPATH_W) 'protobuf-c/protobuf-c.pb.cc'; else $(CYGPATH_W) '$(srcdir)/protobuf-c/protobuf-c.pb.cc'; fi` | |
1776 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Tpo protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po | |
1777 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='protobuf-c/protobuf-c.pb.cc' object='protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.obj' libtool=no @AMDEPBACKSLASH@ | |
1778 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
1779 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -c -o protobuf-c/protoc_c_protoc_gen_c-protobuf-c.pb.obj `if test -f 'protobuf-c/protobuf-c.pb.cc'; then $(CYGPATH_W) 'protobuf-c/protobuf-c.pb.cc'; else $(CYGPATH_W) '$(srcdir)/protobuf-c/protobuf-c.pb.cc'; fi` | |
1780 | ||
1638 | 1781 | protoc-c/protoc_gen_c-main.o: protoc-c/main.cc |
1639 | 1782 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(protoc_c_protoc_gen_c_CXXFLAGS) $(CXXFLAGS) -MT protoc-c/protoc_gen_c-main.o -MD -MP -MF protoc-c/$(DEPDIR)/protoc_gen_c-main.Tpo -c -o protoc-c/protoc_gen_c-main.o `test -f 'protoc-c/main.cc' || echo '$(srcdir)/'`protoc-c/main.cc |
1640 | 1783 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protoc-c/$(DEPDIR)/protoc_gen_c-main.Tpo protoc-c/$(DEPDIR)/protoc_gen_c-main.Po |
1676 | 1819 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='t/test-full.pb.cc' object='t/generated_code2_cxx_generate_packed_data-test-full.pb.obj' libtool=no @AMDEPBACKSLASH@ |
1677 | 1820 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ |
1678 | 1821 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(t_generated_code2_cxx_generate_packed_data_CXXFLAGS) $(CXXFLAGS) -c -o t/generated_code2_cxx_generate_packed_data-test-full.pb.obj `if test -f 't/test-full.pb.cc'; then $(CYGPATH_W) 't/test-full.pb.cc'; else $(CYGPATH_W) '$(srcdir)/t/test-full.pb.cc'; fi` |
1822 | ||
1823 | protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.o: protobuf-c/protobuf-c.pb.cc | |
1824 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(t_generated_code2_cxx_generate_packed_data_CXXFLAGS) $(CXXFLAGS) -MT protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.o -MD -MP -MF protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Tpo -c -o protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.o `test -f 'protobuf-c/protobuf-c.pb.cc' || echo '$(srcdir)/'`protobuf-c/protobuf-c.pb.cc | |
1825 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Tpo protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po | |
1826 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='protobuf-c/protobuf-c.pb.cc' object='protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.o' libtool=no @AMDEPBACKSLASH@ | |
1827 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
1828 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(t_generated_code2_cxx_generate_packed_data_CXXFLAGS) $(CXXFLAGS) -c -o protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.o `test -f 'protobuf-c/protobuf-c.pb.cc' || echo '$(srcdir)/'`protobuf-c/protobuf-c.pb.cc | |
1829 | ||
1830 | protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.obj: protobuf-c/protobuf-c.pb.cc | |
1831 | @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(t_generated_code2_cxx_generate_packed_data_CXXFLAGS) $(CXXFLAGS) -MT protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.obj -MD -MP -MF protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Tpo -c -o protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.obj `if test -f 'protobuf-c/protobuf-c.pb.cc'; then $(CYGPATH_W) 'protobuf-c/protobuf-c.pb.cc'; else $(CYGPATH_W) '$(srcdir)/protobuf-c/protobuf-c.pb.cc'; fi` | |
1832 | @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Tpo protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po | |
1833 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='protobuf-c/protobuf-c.pb.cc' object='protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.obj' libtool=no @AMDEPBACKSLASH@ | |
1834 | @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | |
1835 | @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(t_generated_code2_cxx_generate_packed_data_CXXFLAGS) $(CXXFLAGS) -c -o protobuf-c/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.obj `if test -f 'protobuf-c/protobuf-c.pb.cc'; then $(CYGPATH_W) 'protobuf-c/protobuf-c.pb.cc'; else $(CYGPATH_W) '$(srcdir)/protobuf-c/protobuf-c.pb.cc'; fi` | |
1679 | 1836 | |
1680 | 1837 | mostlyclean-libtool: |
1681 | 1838 | -rm -f *.lo |
1687 | 1844 | -rm -rf t/generated-code/.libs t/generated-code/_libs |
1688 | 1845 | -rm -rf t/generated-code2/.libs t/generated-code2/_libs |
1689 | 1846 | -rm -rf t/generated-code3/.libs t/generated-code3/_libs |
1847 | -rm -rf t/issue204/.libs t/issue204/_libs | |
1690 | 1848 | -rm -rf t/issue220/.libs t/issue220/_libs |
1691 | 1849 | -rm -rf t/issue251/.libs t/issue251/_libs |
1692 | 1850 | -rm -rf t/issue330/.libs t/issue330/_libs |
1693 | 1851 | -rm -rf t/issue375/.libs t/issue375/_libs |
1852 | -rm -rf t/issue440/.libs t/issue440/_libs | |
1694 | 1853 | -rm -rf t/version/.libs t/version/_libs |
1695 | 1854 | |
1696 | 1855 | distclean-libtool: |
1907 | 2066 | test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ |
1908 | 2067 | fi; \ |
1909 | 2068 | echo "$${col}$$br$${std}"; \ |
1910 | echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ | |
2069 | echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ | |
1911 | 2070 | echo "$${col}$$br$${std}"; \ |
1912 | 2071 | create_testsuite_report --maybe-color; \ |
1913 | 2072 | echo "$$col$$br$$std"; \ |
1969 | 2128 | --log-file $$b.log --trs-file $$b.trs \ |
1970 | 2129 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ |
1971 | 2130 | "$$tst" $(AM_TESTS_FD_REDIRECT) |
2131 | t/issue204/issue204.log: t/issue204/issue204$(EXEEXT) | |
2132 | @p='t/issue204/issue204$(EXEEXT)'; \ | |
2133 | b='t/issue204/issue204'; \ | |
2134 | $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ | |
2135 | --log-file $$b.log --trs-file $$b.trs \ | |
2136 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ | |
2137 | "$$tst" $(AM_TESTS_FD_REDIRECT) | |
1972 | 2138 | t/issue220/issue220.log: t/issue220/issue220$(EXEEXT) |
1973 | 2139 | @p='t/issue220/issue220$(EXEEXT)'; \ |
1974 | 2140 | b='t/issue220/issue220'; \ |
1986 | 2152 | t/issue330/issue330.log: t/issue330/issue330$(EXEEXT) |
1987 | 2153 | @p='t/issue330/issue330$(EXEEXT)'; \ |
1988 | 2154 | b='t/issue330/issue330'; \ |
2155 | $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ | |
2156 | --log-file $$b.log --trs-file $$b.trs \ | |
2157 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ | |
2158 | "$$tst" $(AM_TESTS_FD_REDIRECT) | |
2159 | t/issue440/issue440.log: t/issue440/issue440$(EXEEXT) | |
2160 | @p='t/issue440/issue440$(EXEEXT)'; \ | |
2161 | b='t/issue440/issue440'; \ | |
1989 | 2162 | $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ |
1990 | 2163 | --log-file $$b.log --trs-file $$b.trs \ |
1991 | 2164 | $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ |
2073 | 2246 | tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz |
2074 | 2247 | $(am__post_remove_distdir) |
2075 | 2248 | |
2249 | dist-zstd: distdir | |
2250 | tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst | |
2251 | $(am__post_remove_distdir) | |
2252 | ||
2076 | 2253 | dist-tarZ: distdir |
2077 | 2254 | @echo WARNING: "Support for distribution archives compressed with" \ |
2078 | 2255 | "legacy program 'compress' is deprecated." >&2 |
2115 | 2292 | eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ |
2116 | 2293 | *.zip*) \ |
2117 | 2294 | unzip $(distdir).zip ;;\ |
2295 | *.tar.zst*) \ | |
2296 | zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ | |
2118 | 2297 | esac |
2119 | 2298 | chmod -R a-w $(distdir) |
2120 | 2299 | chmod u+w $(distdir) |
2130 | 2309 | $(DISTCHECK_CONFIGURE_FLAGS) \ |
2131 | 2310 | --srcdir=../.. --prefix="$$dc_install_base" \ |
2132 | 2311 | && $(MAKE) $(AM_MAKEFLAGS) \ |
2133 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ | |
2312 | && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ | |
2134 | 2313 | && $(MAKE) $(AM_MAKEFLAGS) check \ |
2135 | 2314 | && $(MAKE) $(AM_MAKEFLAGS) install \ |
2136 | 2315 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ |
2196 | 2375 | done |
2197 | 2376 | install: $(BUILT_SOURCES) |
2198 | 2377 | $(MAKE) $(AM_MAKEFLAGS) install-am |
2199 | install-exec: install-exec-am | |
2378 | install-exec: $(BUILT_SOURCES) | |
2379 | $(MAKE) $(AM_MAKEFLAGS) install-exec-am | |
2200 | 2380 | install-data: install-data-am |
2201 | 2381 | uninstall: uninstall-am |
2202 | 2382 | |
2236 | 2416 | -rm -f t/generated-code2/$(DEPDIR)/$(am__dirstamp) |
2237 | 2417 | -rm -f t/generated-code2/$(am__dirstamp) |
2238 | 2418 | -rm -f t/generated-code3/$(am__dirstamp) |
2419 | -rm -f t/issue204/$(DEPDIR)/$(am__dirstamp) | |
2420 | -rm -f t/issue204/$(am__dirstamp) | |
2239 | 2421 | -rm -f t/issue220/$(DEPDIR)/$(am__dirstamp) |
2240 | 2422 | -rm -f t/issue220/$(am__dirstamp) |
2241 | 2423 | -rm -f t/issue251/$(DEPDIR)/$(am__dirstamp) |
2244 | 2426 | -rm -f t/issue330/$(am__dirstamp) |
2245 | 2427 | -rm -f t/issue375/$(DEPDIR)/$(am__dirstamp) |
2246 | 2428 | -rm -f t/issue375/$(am__dirstamp) |
2429 | -rm -f t/issue389/$(DEPDIR)/$(am__dirstamp) | |
2430 | -rm -f t/issue389/$(am__dirstamp) | |
2431 | -rm -f t/issue440/$(DEPDIR)/$(am__dirstamp) | |
2432 | -rm -f t/issue440/$(am__dirstamp) | |
2247 | 2433 | -rm -f t/version/$(DEPDIR)/$(am__dirstamp) |
2248 | 2434 | -rm -f t/version/$(am__dirstamp) |
2249 | 2435 | -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) |
2264 | 2450 | distclean: distclean-am |
2265 | 2451 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) |
2266 | 2452 | -rm -f protobuf-c/$(DEPDIR)/protobuf-c.Plo |
2453 | -rm -f protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po | |
2454 | -rm -f protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po | |
2267 | 2455 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po |
2268 | 2456 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po |
2269 | 2457 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po |
2287 | 2475 | -rm -f t/generated-code/$(DEPDIR)/test-generated-code.Po |
2288 | 2476 | -rm -f t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po |
2289 | 2477 | -rm -f t/generated-code2/$(DEPDIR)/test-generated-code2.Po |
2478 | -rm -f t/issue204/$(DEPDIR)/issue204.Po | |
2479 | -rm -f t/issue204/$(DEPDIR)/issue204.pb-c.Po | |
2290 | 2480 | -rm -f t/issue220/$(DEPDIR)/issue220.Po |
2291 | 2481 | -rm -f t/issue220/$(DEPDIR)/issue220.pb-c.Po |
2292 | 2482 | -rm -f t/issue251/$(DEPDIR)/issue251.Po |
2295 | 2485 | -rm -f t/issue330/$(DEPDIR)/issue330.pb-c.Po |
2296 | 2486 | -rm -f t/issue375/$(DEPDIR)/issue375.Po |
2297 | 2487 | -rm -f t/issue375/$(DEPDIR)/issue375.pb-c.Po |
2488 | -rm -f t/issue389/$(DEPDIR)/issue389.pb-c.Po | |
2489 | -rm -f t/issue440/$(DEPDIR)/issue440.Po | |
2490 | -rm -f t/issue440/$(DEPDIR)/issue440.pb-c.Po | |
2298 | 2491 | -rm -f t/version/$(DEPDIR)/version.Po |
2299 | 2492 | -rm -f Makefile |
2300 | 2493 | distclean-am: clean-am distclean-compile distclean-generic \ |
2346 | 2539 | -rm -f $(am__CONFIG_DISTCLEAN_FILES) |
2347 | 2540 | -rm -rf $(top_srcdir)/autom4te.cache |
2348 | 2541 | -rm -f protobuf-c/$(DEPDIR)/protobuf-c.Plo |
2542 | -rm -f protobuf-c/$(DEPDIR)/protoc_c_protoc_gen_c-protobuf-c.pb.Po | |
2543 | -rm -f protobuf-c/$(DEPDIR)/t_generated_code2_cxx_generate_packed_data-protobuf-c.pb.Po | |
2349 | 2544 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po |
2350 | 2545 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po |
2351 | 2546 | -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po |
2369 | 2564 | -rm -f t/generated-code/$(DEPDIR)/test-generated-code.Po |
2370 | 2565 | -rm -f t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po |
2371 | 2566 | -rm -f t/generated-code2/$(DEPDIR)/test-generated-code2.Po |
2567 | -rm -f t/issue204/$(DEPDIR)/issue204.Po | |
2568 | -rm -f t/issue204/$(DEPDIR)/issue204.pb-c.Po | |
2372 | 2569 | -rm -f t/issue220/$(DEPDIR)/issue220.Po |
2373 | 2570 | -rm -f t/issue220/$(DEPDIR)/issue220.pb-c.Po |
2374 | 2571 | -rm -f t/issue251/$(DEPDIR)/issue251.Po |
2377 | 2574 | -rm -f t/issue330/$(DEPDIR)/issue330.pb-c.Po |
2378 | 2575 | -rm -f t/issue375/$(DEPDIR)/issue375.Po |
2379 | 2576 | -rm -f t/issue375/$(DEPDIR)/issue375.pb-c.Po |
2577 | -rm -f t/issue389/$(DEPDIR)/issue389.pb-c.Po | |
2578 | -rm -f t/issue440/$(DEPDIR)/issue440.Po | |
2579 | -rm -f t/issue440/$(DEPDIR)/issue440.pb-c.Po | |
2380 | 2580 | -rm -f t/version/$(DEPDIR)/version.Po |
2381 | 2581 | -rm -f Makefile |
2382 | 2582 | maintainer-clean-am: distclean-am maintainer-clean-generic |
2398 | 2598 | uninstall-nobase_includeHEADERS uninstall-pkgconfigDATA |
2399 | 2599 | |
2400 | 2600 | .MAKE: all check check-am install install-am install-data-am \ |
2401 | install-exec-am install-strip | |
2601 | install-exec install-exec-am install-strip | |
2402 | 2602 | |
2403 | 2603 | .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \ |
2404 | 2604 | check-TESTS check-am clean clean-binPROGRAMS \ |
2406 | 2606 | clean-libLTLIBRARIES clean-libtool clean-local \ |
2407 | 2607 | clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \ |
2408 | 2608 | dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ |
2409 | dist-tarZ dist-xz dist-zip distcheck distclean \ | |
2609 | dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \ | |
2410 | 2610 | distclean-compile distclean-generic distclean-hdr \ |
2411 | 2611 | distclean-libtool distclean-tags distcleancheck distdir \ |
2412 | 2612 | distuninstallcheck dvi dvi-am html html-am html-local info \ |
2428 | 2628 | |
2429 | 2629 | @CODE_COVERAGE_RULES@ |
2430 | 2630 | |
2631 | @BUILD_COMPILER_TRUE@protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h: @PROTOC@ $(top_srcdir)/protobuf-c/protobuf-c.proto | |
2632 | @BUILD_COMPILER_TRUE@ $(AM_V_GEN)@PROTOC@ -I$(top_srcdir) --cpp_out=$(top_builddir) $(top_srcdir)/protobuf-c/protobuf-c.proto | |
2431 | 2633 | # |
2432 | 2634 | # protoc-c compat link |
2433 | 2635 | # |
2454 | 2656 | |
2455 | 2657 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t/test-proto3.pb-c.c t/test-proto3.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/test-proto3.proto |
2456 | 2658 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/test-proto3.proto |
2659 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t/issue204/issue204.pb-c.c t/issue204/issue204.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue204/issue204.proto | |
2660 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue204/issue204.proto | |
2457 | 2661 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t/issue220/issue220.pb-c.c t/issue220/issue220.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue220/issue220.proto |
2458 | 2662 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue220/issue220.proto |
2459 | 2663 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t/issue251/issue251.pb-c.c t/issue251/issue251.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue251/issue251.proto |
2460 | 2664 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue251/issue251.proto |
2461 | 2665 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t/issue330/issue330.pb-c.c t/issue330/issue330.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue330/issue330.proto |
2462 | 2666 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue330/issue330.proto |
2667 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t/issue389/issue389.pb-c.c t/issue389/issue389.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue389/issue389.proto | |
2668 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue389/issue389.proto | |
2669 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t/issue440/issue440.pb-c.c t/issue440/issue440.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue440/issue440.proto | |
2670 | @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue440/issue440.proto | |
2463 | 2671 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t/issue375/issue375.pb-c.c t/issue375/issue375.pb-c.h: $(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) $(top_srcdir)/t/issue375/issue375.proto |
2464 | 2672 | @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_V_GEN)@PROTOC@ --plugin=protoc-gen-c=$(top_builddir)/protoc-c/protoc-gen-c$(EXEEXT) -I$(top_srcdir) --c_out=$(top_builddir) $(top_srcdir)/t/issue375/issue375.proto |
2465 | 2673 |
0 | [![Build Status](https://travis-ci.org/protobuf-c/protobuf-c.png?branch=master)](https://travis-ci.org/protobuf-c/protobuf-c) [![Coverage Status](https://coveralls.io/repos/protobuf-c/protobuf-c/badge.png)](https://coveralls.io/r/protobuf-c/protobuf-c) | |
0 | [![Build Status](https://github.com/protobuf-c/protobuf-c/actions/workflows/build.yml/badge.svg)](https://github.com/protobuf-c/protobuf-c/actions) [![Coverage Status](https://coveralls.io/repos/protobuf-c/protobuf-c/badge.png)](https://coveralls.io/r/protobuf-c/protobuf-c) | |
1 | 1 | |
2 | 2 | ## Overview |
3 | 3 | |
19 | 19 | |
20 | 20 | ./autogen.sh && ./configure && make && make install |
21 | 21 | |
22 | ## Test | |
23 | ||
24 | If you want to execute test cases individually, please run the following command after running `./configure` once: | |
25 | ||
26 | make check | |
27 | ||
22 | 28 | ## Documentation |
23 | 29 | |
24 | See the [online Doxygen documentation here](http://lib.protobuf-c.io) or [the Wiki](https://github.com/protobuf-c/protobuf-c/wiki) for a detailed reference. The Doxygen documentation can be built from the source tree by running: | |
30 | See the [online Doxygen documentation here](https://protobuf-c.github.io/protobuf-c) or [the Wiki](https://github.com/protobuf-c/protobuf-c/wiki) for a detailed reference. The Doxygen documentation can be built from the source tree by running: | |
25 | 31 | |
26 | 32 | make html |
27 | 33 |
0 | # generated automatically by aclocal 1.16.1 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
0 | # generated automatically by aclocal 1.16.3 -*- Autoconf -*- | |
1 | ||
2 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | # This file is free software; the Free Software Foundation |
5 | 5 | # gives unlimited permission to copy and/or distribute it, |
19 | 19 | If you have problems, you may need to regenerate the build system entirely. |
20 | 20 | To do so, use the procedure documented by the package, typically 'autoreconf'.])]) |
21 | 21 | |
22 | # Copyright (C) 2002-2018 Free Software Foundation, Inc. | |
22 | # Copyright (C) 2002-2020 Free Software Foundation, Inc. | |
23 | 23 | # |
24 | 24 | # This file is free software; the Free Software Foundation |
25 | 25 | # gives unlimited permission to copy and/or distribute it, |
34 | 34 | [am__api_version='1.16' |
35 | 35 | dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to |
36 | 36 | dnl require some minimum version. Point them to the right macro. |
37 | m4_if([$1], [1.16.1], [], | |
37 | m4_if([$1], [1.16.3], [], | |
38 | 38 | [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl |
39 | 39 | ]) |
40 | 40 | |
50 | 50 | # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. |
51 | 51 | # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. |
52 | 52 | AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], |
53 | [AM_AUTOMAKE_VERSION([1.16.1])dnl | |
53 | [AM_AUTOMAKE_VERSION([1.16.3])dnl | |
54 | 54 | m4_ifndef([AC_AUTOCONF_VERSION], |
55 | 55 | [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl |
56 | 56 | _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) |
57 | 57 | |
58 | 58 | # AM_AUX_DIR_EXPAND -*- Autoconf -*- |
59 | 59 | |
60 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
60 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
61 | 61 | # |
62 | 62 | # This file is free software; the Free Software Foundation |
63 | 63 | # gives unlimited permission to copy and/or distribute it, |
109 | 109 | |
110 | 110 | # AM_COND_IF -*- Autoconf -*- |
111 | 111 | |
112 | # Copyright (C) 2008-2018 Free Software Foundation, Inc. | |
112 | # Copyright (C) 2008-2020 Free Software Foundation, Inc. | |
113 | 113 | # |
114 | 114 | # This file is free software; the Free Software Foundation |
115 | 115 | # gives unlimited permission to copy and/or distribute it, |
146 | 146 | |
147 | 147 | # AM_CONDITIONAL -*- Autoconf -*- |
148 | 148 | |
149 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
149 | # Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
150 | 150 | # |
151 | 151 | # This file is free software; the Free Software Foundation |
152 | 152 | # gives unlimited permission to copy and/or distribute it, |
177 | 177 | Usually this means the macro was only invoked conditionally.]]) |
178 | 178 | fi])]) |
179 | 179 | |
180 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
180 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
181 | 181 | # |
182 | 182 | # This file is free software; the Free Software Foundation |
183 | 183 | # gives unlimited permission to copy and/or distribute it, |
368 | 368 | |
369 | 369 | # Generate code to set up dependency tracking. -*- Autoconf -*- |
370 | 370 | |
371 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
371 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
372 | 372 | # |
373 | 373 | # This file is free software; the Free Software Foundation |
374 | 374 | # gives unlimited permission to copy and/or distribute it, |
407 | 407 | done |
408 | 408 | if test $am_rc -ne 0; then |
409 | 409 | AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments |
410 | for automatic dependency tracking. Try re-running configure with the | |
410 | for automatic dependency tracking. If GNU make was not used, consider | |
411 | re-running the configure script with MAKE="gmake" (or whatever is | |
412 | necessary). You can also try re-running configure with the | |
411 | 413 | '--disable-dependency-tracking' option to at least be able to build |
412 | 414 | the package (albeit without support for automatic dependency tracking).]) |
413 | 415 | fi |
434 | 436 | |
435 | 437 | # Do all the work for Automake. -*- Autoconf -*- |
436 | 438 | |
437 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
439 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
438 | 440 | # |
439 | 441 | # This file is free software; the Free Software Foundation |
440 | 442 | # gives unlimited permission to copy and/or distribute it, |
631 | 633 | done |
632 | 634 | echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) |
633 | 635 | |
634 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
636 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
635 | 637 | # |
636 | 638 | # This file is free software; the Free Software Foundation |
637 | 639 | # gives unlimited permission to copy and/or distribute it, |
652 | 654 | fi |
653 | 655 | AC_SUBST([install_sh])]) |
654 | 656 | |
655 | # Copyright (C) 2003-2018 Free Software Foundation, Inc. | |
657 | # Copyright (C) 2003-2020 Free Software Foundation, Inc. | |
656 | 658 | # |
657 | 659 | # This file is free software; the Free Software Foundation |
658 | 660 | # gives unlimited permission to copy and/or distribute it, |
673 | 675 | |
674 | 676 | # Check to see how 'make' treats includes. -*- Autoconf -*- |
675 | 677 | |
676 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
678 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
677 | 679 | # |
678 | 680 | # This file is free software; the Free Software Foundation |
679 | 681 | # gives unlimited permission to copy and/or distribute it, |
716 | 718 | |
717 | 719 | # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- |
718 | 720 | |
719 | # Copyright (C) 1997-2018 Free Software Foundation, Inc. | |
721 | # Copyright (C) 1997-2020 Free Software Foundation, Inc. | |
720 | 722 | # |
721 | 723 | # This file is free software; the Free Software Foundation |
722 | 724 | # gives unlimited permission to copy and/or distribute it, |
737 | 739 | [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl |
738 | 740 | AC_REQUIRE_AUX_FILE([missing])dnl |
739 | 741 | if test x"${MISSING+set}" != xset; then |
740 | case $am_aux_dir in | |
741 | *\ * | *\ *) | |
742 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | |
743 | *) | |
744 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | |
745 | esac | |
742 | MISSING="\${SHELL} '$am_aux_dir/missing'" | |
746 | 743 | fi |
747 | 744 | # Use eval to expand $SHELL |
748 | 745 | if eval "$MISSING --is-lightweight"; then |
755 | 752 | |
756 | 753 | # Helper functions for option handling. -*- Autoconf -*- |
757 | 754 | |
758 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
755 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
759 | 756 | # |
760 | 757 | # This file is free software; the Free Software Foundation |
761 | 758 | # gives unlimited permission to copy and/or distribute it, |
784 | 781 | AC_DEFUN([_AM_IF_OPTION], |
785 | 782 | [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) |
786 | 783 | |
787 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
784 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
788 | 785 | # |
789 | 786 | # This file is free software; the Free Software Foundation |
790 | 787 | # gives unlimited permission to copy and/or distribute it, |
831 | 828 | # For backward compatibility. |
832 | 829 | AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) |
833 | 830 | |
834 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
831 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
835 | 832 | # |
836 | 833 | # This file is free software; the Free Software Foundation |
837 | 834 | # gives unlimited permission to copy and/or distribute it, |
850 | 847 | |
851 | 848 | # Check to make sure that the build environment is sane. -*- Autoconf -*- |
852 | 849 | |
853 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
850 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
854 | 851 | # |
855 | 852 | # This file is free software; the Free Software Foundation |
856 | 853 | # gives unlimited permission to copy and/or distribute it, |
931 | 928 | rm -f conftest.file |
932 | 929 | ]) |
933 | 930 | |
934 | # Copyright (C) 2009-2018 Free Software Foundation, Inc. | |
931 | # Copyright (C) 2009-2020 Free Software Foundation, Inc. | |
935 | 932 | # |
936 | 933 | # This file is free software; the Free Software Foundation |
937 | 934 | # gives unlimited permission to copy and/or distribute it, |
991 | 988 | _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl |
992 | 989 | ]) |
993 | 990 | |
994 | # Copyright (C) 2001-2018 Free Software Foundation, Inc. | |
991 | # Copyright (C) 2001-2020 Free Software Foundation, Inc. | |
995 | 992 | # |
996 | 993 | # This file is free software; the Free Software Foundation |
997 | 994 | # gives unlimited permission to copy and/or distribute it, |
1019 | 1016 | INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" |
1020 | 1017 | AC_SUBST([INSTALL_STRIP_PROGRAM])]) |
1021 | 1018 | |
1022 | # Copyright (C) 2006-2018 Free Software Foundation, Inc. | |
1019 | # Copyright (C) 2006-2020 Free Software Foundation, Inc. | |
1023 | 1020 | # |
1024 | 1021 | # This file is free software; the Free Software Foundation |
1025 | 1022 | # gives unlimited permission to copy and/or distribute it, |
1038 | 1035 | |
1039 | 1036 | # Check how to create a tarball. -*- Autoconf -*- |
1040 | 1037 | |
1041 | # Copyright (C) 2004-2018 Free Software Foundation, Inc. | |
1038 | # Copyright (C) 2004-2020 Free Software Foundation, Inc. | |
1042 | 1039 | # |
1043 | 1040 | # This file is free software; the Free Software Foundation |
1044 | 1041 | # gives unlimited permission to copy and/or distribute it, |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
6 | 6 | # Written by Tom Tromey <tromey@cygnus.com>. |
7 | 7 | # |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
52 | 52 | MINGW*) |
53 | 53 | file_conv=mingw |
54 | 54 | ;; |
55 | CYGWIN*) | |
55 | CYGWIN* | MSYS*) | |
56 | 56 | file_conv=cygwin |
57 | 57 | ;; |
58 | 58 | *) |
66 | 66 | mingw/*) |
67 | 67 | file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` |
68 | 68 | ;; |
69 | cygwin/*) | |
69 | cygwin/* | msys/*) | |
70 | 70 | file=`cygpath -m "$file" || echo "$file"` |
71 | 71 | ;; |
72 | 72 | wine/*) |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1999-2018 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1999-2020 Free Software Foundation, Inc. | |
6 | 6 | |
7 | 7 | # This program is free software; you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
0 | 0 | #!/bin/sh |
1 | 1 | # install - install a program, script, or datafile |
2 | 2 | |
3 | scriptversion=2018-03-11.20; # UTC | |
3 | scriptversion=2020-11-14.01; # UTC | |
4 | 4 | |
5 | 5 | # This originates from X11R5 (mit/util/scripts/install.sh), which was |
6 | 6 | # later released in X11R6 (xc/config/util/install.sh) with the |
68 | 68 | # Desired mode of installed file. |
69 | 69 | mode=0755 |
70 | 70 | |
71 | # Create dirs (including intermediate dirs) using mode 755. | |
72 | # This is like GNU 'install' as of coreutils 8.32 (2020). | |
73 | mkdir_umask=22 | |
74 | ||
75 | backupsuffix= | |
71 | 76 | chgrpcmd= |
72 | 77 | chmodcmd=$chmodprog |
73 | 78 | chowncmd= |
98 | 103 | --version display version info and exit. |
99 | 104 | |
100 | 105 | -c (ignored) |
101 | -C install only if different (preserve the last data modification time) | |
106 | -C install only if different (preserve data modification time) | |
102 | 107 | -d create directories instead of installing files. |
103 | 108 | -g GROUP $chgrpprog installed files to GROUP. |
104 | 109 | -m MODE $chmodprog installed files to MODE. |
105 | 110 | -o USER $chownprog installed files to USER. |
111 | -p pass -p to $cpprog. | |
106 | 112 | -s $stripprog installed files. |
113 | -S SUFFIX attempt to back up existing files, with suffix SUFFIX. | |
107 | 114 | -t DIRECTORY install into DIRECTORY. |
108 | 115 | -T report an error if DSTFILE is a directory. |
109 | 116 | |
110 | 117 | Environment variables override the default commands: |
111 | 118 | CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG |
112 | 119 | RMPROG STRIPPROG |
120 | ||
121 | By default, rm is invoked with -f; when overridden with RMPROG, | |
122 | it's up to you to specify -f if you want it. | |
123 | ||
124 | If -S is not specified, no backups are attempted. | |
125 | ||
126 | Email bug reports to bug-automake@gnu.org. | |
127 | Automake home page: https://www.gnu.org/software/automake/ | |
113 | 128 | " |
114 | 129 | |
115 | 130 | while test $# -ne 0; do |
136 | 151 | -o) chowncmd="$chownprog $2" |
137 | 152 | shift;; |
138 | 153 | |
154 | -p) cpprog="$cpprog -p";; | |
155 | ||
139 | 156 | -s) stripcmd=$stripprog;; |
157 | ||
158 | -S) backupsuffix="$2" | |
159 | shift;; | |
140 | 160 | |
141 | 161 | -t) |
142 | 162 | is_target_a_directory=always |
254 | 274 | dstdir=$dst |
255 | 275 | test -d "$dstdir" |
256 | 276 | dstdir_status=$? |
277 | # Don't chown directories that already exist. | |
278 | if test $dstdir_status = 0; then | |
279 | chowncmd="" | |
280 | fi | |
257 | 281 | else |
258 | 282 | |
259 | 283 | # Waiting for this to be detected by the "$cpprog $src $dsttmp" command |
300 | 324 | if test $dstdir_status != 0; then |
301 | 325 | case $posix_mkdir in |
302 | 326 | '') |
303 | # Create intermediate dirs using mode 755 as modified by the umask. | |
304 | # This is like FreeBSD 'install' as of 1997-10-28. | |
305 | umask=`umask` | |
306 | case $stripcmd.$umask in | |
307 | # Optimize common cases. | |
308 | *[2367][2367]) mkdir_umask=$umask;; | |
309 | .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; | |
310 | ||
311 | *[0-7]) | |
312 | mkdir_umask=`expr $umask + 22 \ | |
313 | - $umask % 100 % 40 + $umask % 20 \ | |
314 | - $umask % 10 % 4 + $umask % 2 | |
315 | `;; | |
316 | *) mkdir_umask=$umask,go-w;; | |
317 | esac | |
318 | ||
319 | 327 | # With -d, create the new directory with the user-specified mode. |
320 | 328 | # Otherwise, rely on $mkdir_umask. |
321 | 329 | if test -n "$dir_arg"; then |
325 | 333 | fi |
326 | 334 | |
327 | 335 | posix_mkdir=false |
328 | case $umask in | |
329 | *[123567][0-7][0-7]) | |
330 | # POSIX mkdir -p sets u+wx bits regardless of umask, which | |
331 | # is incompatible with FreeBSD 'install' when (umask & 300) != 0. | |
332 | ;; | |
333 | *) | |
334 | # Note that $RANDOM variable is not portable (e.g. dash); Use it | |
335 | # here however when possible just to lower collision chance. | |
336 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
337 | ||
338 | trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 | |
339 | ||
340 | # Because "mkdir -p" follows existing symlinks and we likely work | |
341 | # directly in world-writeable /tmp, make sure that the '$tmpdir' | |
342 | # directory is successfully created first before we actually test | |
343 | # 'mkdir -p' feature. | |
344 | if (umask $mkdir_umask && | |
345 | $mkdirprog $mkdir_mode "$tmpdir" && | |
346 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 | |
347 | then | |
348 | if test -z "$dir_arg" || { | |
349 | # Check for POSIX incompatibilities with -m. | |
350 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
351 | # other-writable bit of parent directory when it shouldn't. | |
352 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
353 | test_tmpdir="$tmpdir/a" | |
354 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` | |
355 | case $ls_ld_tmpdir in | |
356 | d????-?r-*) different_mode=700;; | |
357 | d????-?--*) different_mode=755;; | |
358 | *) false;; | |
359 | esac && | |
360 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { | |
361 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` | |
362 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
363 | } | |
364 | } | |
365 | then posix_mkdir=: | |
366 | fi | |
367 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" | |
368 | else | |
369 | # Remove any dirs left behind by ancient mkdir implementations. | |
370 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null | |
371 | fi | |
372 | trap '' 0;; | |
373 | esac;; | |
336 | # The $RANDOM variable is not portable (e.g., dash). Use it | |
337 | # here however when possible just to lower collision chance. | |
338 | tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ | |
339 | ||
340 | trap ' | |
341 | ret=$? | |
342 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null | |
343 | exit $ret | |
344 | ' 0 | |
345 | ||
346 | # Because "mkdir -p" follows existing symlinks and we likely work | |
347 | # directly in world-writeable /tmp, make sure that the '$tmpdir' | |
348 | # directory is successfully created first before we actually test | |
349 | # 'mkdir -p'. | |
350 | if (umask $mkdir_umask && | |
351 | $mkdirprog $mkdir_mode "$tmpdir" && | |
352 | exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 | |
353 | then | |
354 | if test -z "$dir_arg" || { | |
355 | # Check for POSIX incompatibilities with -m. | |
356 | # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or | |
357 | # other-writable bit of parent directory when it shouldn't. | |
358 | # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. | |
359 | test_tmpdir="$tmpdir/a" | |
360 | ls_ld_tmpdir=`ls -ld "$test_tmpdir"` | |
361 | case $ls_ld_tmpdir in | |
362 | d????-?r-*) different_mode=700;; | |
363 | d????-?--*) different_mode=755;; | |
364 | *) false;; | |
365 | esac && | |
366 | $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { | |
367 | ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` | |
368 | test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" | |
369 | } | |
370 | } | |
371 | then posix_mkdir=: | |
372 | fi | |
373 | rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" | |
374 | else | |
375 | # Remove any dirs left behind by ancient mkdir implementations. | |
376 | rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null | |
377 | fi | |
378 | trap '' 0;; | |
374 | 379 | esac |
375 | 380 | |
376 | 381 | if |
381 | 386 | then : |
382 | 387 | else |
383 | 388 | |
384 | # The umask is ridiculous, or mkdir does not conform to POSIX, | |
389 | # mkdir does not conform to POSIX, | |
385 | 390 | # or it failed possibly due to a race condition. Create the |
386 | 391 | # directory the slow way, step by step, checking for races as we go. |
387 | 392 | |
410 | 415 | prefixes= |
411 | 416 | else |
412 | 417 | if $posix_mkdir; then |
413 | (umask=$mkdir_umask && | |
418 | (umask $mkdir_umask && | |
414 | 419 | $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break |
415 | 420 | # Don't fail if two instances are running concurrently. |
416 | 421 | test -d "$prefix" || exit 1 |
450 | 455 | trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 |
451 | 456 | |
452 | 457 | # Copy the file name to the temp name. |
453 | (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && | |
458 | (umask $cp_umask && | |
459 | { test -z "$stripcmd" || { | |
460 | # Create $dsttmp read-write so that cp doesn't create it read-only, | |
461 | # which would cause strip to fail. | |
462 | if test -z "$doit"; then | |
463 | : >"$dsttmp" # No need to fork-exec 'touch'. | |
464 | else | |
465 | $doit touch "$dsttmp" | |
466 | fi | |
467 | } | |
468 | } && | |
469 | $doit_exec $cpprog "$src" "$dsttmp") && | |
454 | 470 | |
455 | 471 | # and set any options; do chmod last to preserve setuid bits. |
456 | 472 | # |
476 | 492 | then |
477 | 493 | rm -f "$dsttmp" |
478 | 494 | else |
495 | # If $backupsuffix is set, and the file being installed | |
496 | # already exists, attempt a backup. Don't worry if it fails, | |
497 | # e.g., if mv doesn't support -f. | |
498 | if test -n "$backupsuffix" && test -f "$dst"; then | |
499 | $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null | |
500 | fi | |
501 | ||
479 | 502 | # Rename the file to the real destination. |
480 | 503 | $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || |
481 | 504 | |
490 | 513 | # file should still install successfully. |
491 | 514 | { |
492 | 515 | test ! -f "$dst" || |
493 | $doit $rmcmd -f "$dst" 2>/dev/null || | |
516 | $doit $rmcmd "$dst" 2>/dev/null || | |
494 | 517 | { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && |
495 | { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } | |
518 | { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } | |
496 | 519 | } || |
497 | 520 | { echo "$0: cannot unlink or rename $dst" >&2 |
498 | 521 | (exit 1); exit 1 |
30 | 30 | |
31 | 31 | PROGRAM=libtool |
32 | 32 | PACKAGE=libtool |
33 | VERSION="2.4.6 Debian-2.4.6-12" | |
33 | VERSION="2.4.6 Debian-2.4.6-15" | |
34 | 34 | package_revision=2.4.6 |
35 | 35 | |
36 | 36 | |
2140 | 2140 | compiler: $LTCC |
2141 | 2141 | compiler flags: $LTCFLAGS |
2142 | 2142 | linker: $LD (gnu? $with_gnu_ld) |
2143 | version: $progname $scriptversion Debian-2.4.6-12 | |
2143 | version: $progname $scriptversion Debian-2.4.6-15 | |
2144 | 2144 | automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` |
2145 | 2145 | autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` |
2146 | 2146 |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 1996-2018 Free Software Foundation, Inc. | |
5 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. | |
6 | 6 | # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. |
7 | 7 | |
8 | 8 | # This program is free software; you can redistribute it and/or modify |
2 | 2 | |
3 | 3 | scriptversion=2018-03-07.03; # UTC |
4 | 4 | |
5 | # Copyright (C) 2011-2018 Free Software Foundation, Inc. | |
5 | # Copyright (C) 2011-2020 Free Software Foundation, Inc. | |
6 | 6 | # |
7 | 7 | # This program is free software; you can redistribute it and/or modify |
8 | 8 | # it under the terms of the GNU General Public License as published by |
41 | 41 | { |
42 | 42 | cat <<END |
43 | 43 | Usage: |
44 | test-driver --test-name=NAME --log-file=PATH --trs-file=PATH | |
45 | [--expect-failure={yes|no}] [--color-tests={yes|no}] | |
46 | [--enable-hard-errors={yes|no}] [--] | |
44 | test-driver --test-name NAME --log-file PATH --trs-file PATH | |
45 | [--expect-failure {yes|no}] [--color-tests {yes|no}] | |
46 | [--enable-hard-errors {yes|no}] [--] | |
47 | 47 | TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS] |
48 | ||
48 | 49 | The '--test-name', '--log-file' and '--trs-file' options are mandatory. |
50 | See the GNU Automake documentation for information. | |
49 | 51 | END |
50 | 52 | } |
51 | 53 |
0 | 0 | SET(PACKAGE protobuf-c) |
1 | 1 | SET(PACKAGE_NAME protobuf-c) |
2 | SET(PACKAGE_VERSION 1.3.3) | |
3 | ||
4 | ||
5 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) | |
2 | SET(PACKAGE_VERSION 1.4.0) | |
3 | SET(PACKAGE_URL https://github.com/protobuf-c/protobuf-c) | |
4 | SET(PACKAGE_DESCRIPTION "Protocol Buffers implementation in C") | |
5 | ||
6 | CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR) | |
6 | 7 | |
7 | 8 | PROJECT(protobuf-c) |
8 | 9 | |
9 | 10 | #options |
10 | option(MSVC_STATIC_BUILD "MSVC_STATIC_BUILD" OFF) | |
11 | 11 | option(BUILD_PROTO3 "BUILD_PROTO3" ON) |
12 | option(BUILD_PROTOC "Build protoc-gen-c" ON) | |
13 | if(CMAKE_BUILD_TYPE MATCHES Debug) | |
14 | option(BUILD_TESTS "Build tests" ON) | |
15 | else() | |
16 | option(BUILD_TESTS "Build tests" OFF) | |
17 | endif() | |
12 | 18 | |
13 | 19 | INCLUDE(TestBigEndian) |
14 | 20 | TEST_BIG_ENDIAN(WORDS_BIGENDIAN) |
20 | 26 | ADD_DEFINITIONS(-DWORDS_BIGENDIAN) |
21 | 27 | endif() |
22 | 28 | |
29 | IF (MSVC AND BUILD_SHARED_LIBS) | |
30 | ADD_DEFINITIONS(-DPROTOBUF_C_USE_SHARED_LIB) | |
31 | ENDIF (MSVC AND BUILD_SHARED_LIBS) | |
32 | ||
23 | 33 | if(MSVC) |
24 | 34 | # using Visual Studio C++ |
25 | 35 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244") |
36 | 46 | ${MAIN_DIR}/protobuf-c/protobuf-c.h) |
37 | 47 | |
38 | 48 | ADD_LIBRARY(protobuf-c ${PC_SOURCES}) |
49 | set_target_properties(protobuf-c PROPERTIES COMPILE_PDB_NAME protobuf-c) | |
50 | IF (MSVC AND BUILD_SHARED_LIBS) | |
51 | TARGET_COMPILE_DEFINITIONS(protobuf-c PRIVATE -DPROTOBUF_C_EXPORT) | |
52 | ENDIF (MSVC AND BUILD_SHARED_LIBS) | |
39 | 53 | |
40 | 54 | INCLUDE_DIRECTORIES(${MAIN_DIR}) |
41 | 55 | INCLUDE_DIRECTORIES(${MAIN_DIR}/protobuf-c) |
56 | ||
57 | IF(BUILD_PROTOC) | |
42 | 58 | INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) # for generated files |
59 | ||
60 | if (MSVC AND NOT BUILD_SHARED_LIBS) | |
61 | SET(Protobuf_USE_STATIC_LIBS ON) | |
62 | endif (MSVC AND NOT BUILD_SHARED_LIBS) | |
43 | 63 | |
44 | 64 | FIND_PACKAGE(Protobuf REQUIRED) |
45 | 65 | INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) |
47 | 67 | if (BUILD_PROTO3) |
48 | 68 | ADD_DEFINITIONS(-DHAVE_PROTO3) |
49 | 69 | endif() |
50 | ||
51 | if (MSVC AND MSVC_STATIC_BUILD) | |
70 | ENDIF() | |
71 | ||
72 | if (MSVC AND NOT BUILD_SHARED_LIBS) | |
52 | 73 | # In case we are building static libraries, link also the runtime library statically |
53 | 74 | # so that MSVCR*.DLL is not required at runtime. |
54 | 75 | # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx |
63 | 84 | string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") |
64 | 85 | endif(${flag_var} MATCHES "/MD") |
65 | 86 | endforeach(flag_var) |
66 | endif (MSVC AND MSVC_STATIC_BUILD) | |
87 | endif (MSVC AND NOT BUILD_SHARED_LIBS) | |
88 | ||
89 | IF(BUILD_PROTOC) | |
90 | SET(CMAKE_CXX_STANDARD 11) | |
91 | SET(CMAKE_CXX_STANDARD_REQUIRED ON) | |
92 | SET(CMAKE_CXX_EXTENSIONS OFF) | |
93 | ADD_CUSTOM_COMMAND(OUTPUT protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h | |
94 | COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} | |
95 | ARGS --cpp_out ${CMAKE_BINARY_DIR} -I${MAIN_DIR} ${MAIN_DIR}/protobuf-c/protobuf-c.proto) | |
67 | 96 | FILE(GLOB PROTOC_GEN_C_SRC ${MAIN_DIR}/protoc-c/*.h ${MAIN_DIR}/protoc-c/*.cc ) |
68 | ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC}) | |
97 | ADD_EXECUTABLE(protoc-gen-c ${PROTOC_GEN_C_SRC} protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) | |
69 | 98 | |
70 | 99 | TARGET_LINK_LIBRARIES(protoc-gen-c ${PROTOBUF_PROTOC_LIBRARY} ${PROTOBUF_LIBRARY}) |
100 | ||
101 | IF (MSVC AND BUILD_SHARED_LIBS) | |
102 | TARGET_COMPILE_DEFINITIONS(protoc-gen-c PRIVATE -DPROTOBUF_USE_DLLS) | |
103 | GET_FILENAME_COMPONENT(PROTOBUF_DLL_DIR ${PROTOBUF_PROTOC_EXECUTABLE} DIRECTORY) | |
104 | FILE(GLOB PROTOBUF_DLLS ${PROTOBUF_DLL_DIR}/*.dll) | |
105 | FILE(COPY ${PROTOBUF_DLLS} DESTINATION ${CMAKE_BINARY_DIR}) | |
106 | ENDIF (MSVC AND BUILD_SHARED_LIBS) | |
71 | 107 | |
72 | 108 | IF(CMAKE_HOST_UNIX) |
73 | 109 | ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD |
83 | 119 | ENDFUNCTION() |
84 | 120 | |
85 | 121 | |
86 | IF(CMAKE_BUILD_TYPE MATCHES Debug) | |
122 | IF(BUILD_TESTS) | |
87 | 123 | ENABLE_TESTING() |
88 | 124 | |
89 | 125 | GENERATE_TEST_SOURCES(${TEST_DIR}/test.proto t/test.pb-c.c t/test.pb-c.h) |
98 | 134 | |
99 | 135 | GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full.pb-c.h) |
100 | 136 | |
101 | ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc) | |
137 | ADD_EXECUTABLE(cxx-generate-packed-data ${TEST_DIR}/generated-code2/cxx-generate-packed-data.cc t/test-full.pb.h t/test-full.pb.cc protobuf-c/protobuf-c.pb.cc protobuf-c/protobuf-c.pb.h) | |
102 | 138 | TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${PROTOBUF_LIBRARY}) |
139 | IF (MSVC AND BUILD_SHARED_LIBS) | |
140 | TARGET_COMPILE_DEFINITIONS(cxx-generate-packed-data PRIVATE -DPROTOBUF_USE_DLLS) | |
141 | ENDIF (MSVC AND BUILD_SHARED_LIBS) | |
103 | 142 | |
104 | 143 | FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/t/generated-code2) |
105 | 144 | ADD_CUSTOM_COMMAND(OUTPUT t/generated-code2/test-full-cxx-output.inc |
130 | 169 | TARGET_COMPILE_DEFINITIONS(test-generated-code3 PUBLIC -DPROTO3) |
131 | 170 | TARGET_LINK_LIBRARIES(test-generated-code3 protobuf-c) |
132 | 171 | |
133 | ENDIF() | |
134 | ||
135 | INSTALL(TARGETS protoc-gen-c protobuf-c RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) | |
136 | INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include/protobuf-c) | |
172 | ENDIF() # BUILD_TESTS | |
173 | ||
174 | # https://github.com/protocolbuffers/protobuf/issues/5107 | |
175 | IF(CMAKE_HOST_UNIX) | |
176 | FIND_PACKAGE(Threads REQUIRED) | |
177 | TARGET_LINK_LIBRARIES(protoc-gen-c ${CMAKE_THREAD_LIBS_INIT}) | |
178 | IF(BUILD_TESTS) | |
179 | TARGET_LINK_LIBRARIES(cxx-generate-packed-data ${CMAKE_THREAD_LIBS_INIT}) | |
180 | ENDIF() | |
181 | ENDIF() | |
182 | ||
183 | INSTALL(TARGETS protoc-gen-c RUNTIME DESTINATION bin) | |
184 | ENDIF() # BUILD_PROTOC | |
185 | ||
186 | INSTALL(TARGETS protobuf-c LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) | |
187 | INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h ${MAIN_DIR}/protobuf-c/protobuf-c.proto DESTINATION include/protobuf-c) | |
137 | 188 | INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include) |
189 | INSTALL(FILES ${CMAKE_BINARY_DIR}/protobuf-c.pdb DESTINATION lib OPTIONAL) | |
138 | 190 | |
139 | 191 | IF(CMAKE_HOST_UNIX) |
140 | 192 | INSTALL(CODE "EXECUTE_PROCESS (COMMAND ln -sf protoc-gen-c protoc-c WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)") |
141 | 193 | ENDIF() |
142 | 194 | |
195 | INCLUDE(GNUInstallDirs) | |
196 | SET(prefix ${CMAKE_INSTALL_PREFIX}) | |
197 | SET(exec_prefix \${prefix}) | |
198 | SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR}) | |
199 | SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR}) | |
200 | SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) | |
201 | CONFIGURE_FILE(${MAIN_DIR}/protobuf-c/libprotobuf-c.pc.in libprotobuf-c.pc @ONLY) | |
202 | INSTALL(FILES ${CMAKE_BINARY_DIR}/libprotobuf-c.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) | |
203 | ||
204 | IF(BUILD_TESTS) | |
143 | 205 | INCLUDE(Dart) |
144 | 206 | |
145 | 207 | SET(DART_TESTING_TIMEOUT 5) |
149 | 211 | ADD_TEST(test-issue220 test-issue220) |
150 | 212 | ADD_TEST(test-issue251 test-issue251) |
151 | 213 | ADD_TEST(test-version test-version) |
214 | ENDIF() | |
152 | 215 | |
153 | 216 | |
154 | 217 | INCLUDE(CPack) |
0 | 0 | #! /bin/sh |
1 | 1 | # Guess values for system-dependent variables and create Makefiles. |
2 | # Generated by GNU Autoconf 2.69 for protobuf-c 1.3.3. | |
2 | # Generated by GNU Autoconf 2.69 for protobuf-c 1.4.0. | |
3 | 3 | # |
4 | 4 | # Report bugs to <https://github.com/protobuf-c/protobuf-c/issues>. |
5 | 5 | # |
589 | 589 | # Identity of this package. |
590 | 590 | PACKAGE_NAME='protobuf-c' |
591 | 591 | PACKAGE_TARNAME='protobuf-c' |
592 | PACKAGE_VERSION='1.3.3' | |
593 | PACKAGE_STRING='protobuf-c 1.3.3' | |
592 | PACKAGE_VERSION='1.4.0' | |
593 | PACKAGE_STRING='protobuf-c 1.4.0' | |
594 | 594 | PACKAGE_BUGREPORT='https://github.com/protobuf-c/protobuf-c/issues' |
595 | 595 | PACKAGE_URL='https://github.com/protobuf-c/protobuf-c' |
596 | 596 | |
1377 | 1377 | # Omit some internal or obsolete options to make the list less imposing. |
1378 | 1378 | # This message is too long to be a string in the A/UX 3.1 sh. |
1379 | 1379 | cat <<_ACEOF |
1380 | \`configure' configures protobuf-c 1.3.3 to adapt to many kinds of systems. | |
1380 | \`configure' configures protobuf-c 1.4.0 to adapt to many kinds of systems. | |
1381 | 1381 | |
1382 | 1382 | Usage: $0 [OPTION]... [VAR=VALUE]... |
1383 | 1383 | |
1448 | 1448 | |
1449 | 1449 | if test -n "$ac_init_help"; then |
1450 | 1450 | case $ac_init_help in |
1451 | short | recursive ) echo "Configuration of protobuf-c 1.3.3:";; | |
1451 | short | recursive ) echo "Configuration of protobuf-c 1.4.0:";; | |
1452 | 1452 | esac |
1453 | 1453 | cat <<\_ACEOF |
1454 | 1454 | |
1581 | 1581 | test -n "$ac_init_help" && exit $ac_status |
1582 | 1582 | if $ac_init_version; then |
1583 | 1583 | cat <<\_ACEOF |
1584 | protobuf-c configure 1.3.3 | |
1584 | protobuf-c configure 1.4.0 | |
1585 | 1585 | generated by GNU Autoconf 2.69 |
1586 | 1586 | |
1587 | 1587 | Copyright (C) 2012 Free Software Foundation, Inc. |
2204 | 2204 | This file contains any messages produced by compilers while |
2205 | 2205 | running configure, to aid debugging if configure makes a mistake. |
2206 | 2206 | |
2207 | It was created by protobuf-c $as_me 1.3.3, which was | |
2207 | It was created by protobuf-c $as_me 1.4.0, which was | |
2208 | 2208 | generated by GNU Autoconf 2.69. Invocation command line was |
2209 | 2209 | |
2210 | 2210 | $ $0 $@ |
2761 | 2761 | am_aux_dir=`cd "$ac_aux_dir" && pwd` |
2762 | 2762 | |
2763 | 2763 | if test x"${MISSING+set}" != xset; then |
2764 | case $am_aux_dir in | |
2765 | *\ * | *\ *) | |
2766 | MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; | |
2767 | *) | |
2768 | MISSING="\${SHELL} $am_aux_dir/missing" ;; | |
2769 | esac | |
2764 | MISSING="\${SHELL} '$am_aux_dir/missing'" | |
2770 | 2765 | fi |
2771 | 2766 | # Use eval to expand $SHELL |
2772 | 2767 | if eval "$MISSING --is-lightweight"; then |
3071 | 3066 | |
3072 | 3067 | # Define the identity of the package. |
3073 | 3068 | PACKAGE='protobuf-c' |
3074 | VERSION='1.3.3' | |
3069 | VERSION='1.4.0' | |
3075 | 3070 | |
3076 | 3071 | |
3077 | 3072 | cat >>confdefs.h <<_ACEOF |
8875 | 8870 | # to the OS version, if on x86, and 10.4, the deployment |
8876 | 8871 | # target defaults to 10.4. Don't you love it? |
8877 | 8872 | case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in |
8878 | 10.0,*86*-darwin8*|10.0,*-darwin[91]*) | |
8873 | 10.0,*86*-darwin8*|10.0,*-darwin[912]*) | |
8879 | 8874 | _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; |
8880 | 8875 | 10.[012][,.]*) |
8881 | 8876 | _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; |
8882 | 10.*) | |
8877 | 10.*|11.*) | |
8883 | 8878 | _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; |
8884 | 8879 | esac |
8885 | 8880 | ;; |
18858 | 18853 | # report actual input values of CONFIG_FILES etc. instead of their |
18859 | 18854 | # values after options handling. |
18860 | 18855 | ac_log=" |
18861 | This file was extended by protobuf-c $as_me 1.3.3, which was | |
18856 | This file was extended by protobuf-c $as_me 1.4.0, which was | |
18862 | 18857 | generated by GNU Autoconf 2.69. Invocation command line was |
18863 | 18858 | |
18864 | 18859 | CONFIG_FILES = $CONFIG_FILES |
18925 | 18920 | cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 |
18926 | 18921 | ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" |
18927 | 18922 | ac_cs_version="\\ |
18928 | protobuf-c config.status 1.3.3 | |
18923 | protobuf-c config.status 1.4.0 | |
18929 | 18924 | configured by $0, generated by GNU Autoconf 2.69, |
18930 | 18925 | with options \\"\$ac_cs_config\\" |
18931 | 18926 | |
20118 | 20113 | { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 |
20119 | 20114 | $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} |
20120 | 20115 | as_fn_error $? "Something went wrong bootstrapping makefile fragments |
20121 | for automatic dependency tracking. Try re-running configure with the | |
20116 | for automatic dependency tracking. If GNU make was not used, consider | |
20117 | re-running the configure script with MAKE=\"gmake\" (or whatever is | |
20118 | necessary). You can also try re-running configure with the | |
20122 | 20119 | '--disable-dependency-tracking' option to at least be able to build |
20123 | 20120 | the package (albeit without support for automatic dependency tracking). |
20124 | 20121 | See \`config.log' for more details" "$LINENO" 5; } |
0 | 0 | AC_PREREQ(2.63) |
1 | 1 | |
2 | 2 | AC_INIT([protobuf-c], |
3 | [1.3.3], | |
3 | [1.4.0], | |
4 | 4 | [https://github.com/protobuf-c/protobuf-c/issues], |
5 | 5 | [protobuf-c], |
6 | 6 | [https://github.com/protobuf-c/protobuf-c]) |
0 | protobuf-c (1.4.0-1) UNRELEASED; urgency=low | |
1 | ||
2 | * New upstream release. | |
3 | ||
4 | -- Debian Janitor <janitor@jelmer.uk> Thu, 05 Aug 2021 15:56:18 -0000 | |
5 | ||
0 | 6 | protobuf-c (1.3.3-1) unstable; urgency=medium |
1 | 7 | |
2 | 8 | * New upstream version 1.3.3 |
1070 | 1070 | # to the OS version, if on x86, and 10.4, the deployment |
1071 | 1071 | # target defaults to 10.4. Don't you love it? |
1072 | 1072 | case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in |
1073 | 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) | |
1073 | 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*) | |
1074 | 1074 | _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; |
1075 | 1075 | 10.[[012]][[,.]]*) |
1076 | 1076 | _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; |
1077 | 10.*) | |
1077 | 10.*|11.*) | |
1078 | 1078 | _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; |
1079 | 1079 | esac |
1080 | 1080 | ;; |
3 | 3 | includedir=@includedir@ |
4 | 4 | bindir=@bindir@ |
5 | 5 | |
6 | Name: libprotobuf-c | |
7 | Description: Protocol Buffers C library | |
8 | Version: @VERSION@ | |
6 | Name: @PACKAGE_NAME@ | |
7 | Description: @PACKAGE_DESCRIPTION@ | |
8 | Version: @PACKAGE_VERSION@ | |
9 | URL: @PACKAGE_URL@ | |
9 | 10 | Libs: -L${libdir} -lprotobuf-c |
10 | 11 | Libs.private: |
11 | 12 | Cflags: -I${includedir} |
83 | 83 | # define PROTOBUF_C_UNPACK_ERROR(...) |
84 | 84 | #endif |
85 | 85 | |
86 | #if !defined(_WIN32) || !defined(PROTOBUF_C_USE_SHARED_LIB) | |
86 | 87 | const char protobuf_c_empty_string[] = ""; |
88 | #endif | |
87 | 89 | |
88 | 90 | /** |
89 | 91 | * Internal `ProtobufCMessage` manipulation macro. |
147 | 149 | static void * |
148 | 150 | system_alloc(void *allocator_data, size_t size) |
149 | 151 | { |
152 | (void)allocator_data; | |
150 | 153 | return malloc(size); |
151 | 154 | } |
152 | 155 | |
153 | 156 | static void |
154 | 157 | system_free(void *allocator_data, void *data) |
155 | 158 | { |
159 | (void)allocator_data; | |
156 | 160 | free(data); |
157 | 161 | } |
158 | 162 | |
1617 | 1621 | break; |
1618 | 1622 | } |
1619 | 1623 | case PROTOBUF_C_TYPE_MESSAGE: { |
1620 | uint8_t simple_buffer_scratch[256]; | |
1621 | size_t sublen; | |
1622 | 1624 | const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member; |
1623 | ProtobufCBufferSimple simple_buffer = | |
1624 | PROTOBUF_C_BUFFER_SIMPLE_INIT(simple_buffer_scratch); | |
1625 | ||
1625 | ||
1626 | 1626 | scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; |
1627 | if (msg == NULL) | |
1628 | sublen = 0; | |
1629 | else | |
1630 | sublen = protobuf_c_message_pack_to_buffer(msg, &simple_buffer.base); | |
1631 | rv += uint32_pack(sublen, scratch + rv); | |
1632 | buffer->append(buffer, rv, scratch); | |
1633 | buffer->append(buffer, sublen, simple_buffer.data); | |
1634 | rv += sublen; | |
1635 | PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple_buffer); | |
1627 | if (msg == NULL) { | |
1628 | rv += uint32_pack(0, scratch + rv); | |
1629 | buffer->append(buffer, rv, scratch); | |
1630 | } else { | |
1631 | size_t sublen = protobuf_c_message_get_packed_size(msg); | |
1632 | rv += uint32_pack(sublen, scratch + rv); | |
1633 | buffer->append(buffer, rv, scratch); | |
1634 | protobuf_c_message_pack_to_buffer(msg, buffer); | |
1635 | rv += sublen; | |
1636 | } | |
1636 | 1637 | break; |
1637 | 1638 | } |
1638 | 1639 | default: |
2062 | 2063 | parse_tag_and_wiretype(size_t len, |
2063 | 2064 | const uint8_t *data, |
2064 | 2065 | uint32_t *tag_out, |
2065 | ProtobufCWireType *wiretype_out) | |
2066 | uint8_t *wiretype_out) | |
2066 | 2067 | { |
2067 | 2068 | unsigned max_rv = len > 5 ? 5 : len; |
2068 | 2069 | uint32_t tag = (data[0] & 0x7f) >> 3; |
2094 | 2095 | |
2095 | 2096 | /* sizeof(ScannedMember) must be <= (1UL<<BOUND_SIZEOF_SCANNED_MEMBER_LOG2) */ |
2096 | 2097 | #define BOUND_SIZEOF_SCANNED_MEMBER_LOG2 5 |
2097 | typedef struct _ScannedMember ScannedMember; | |
2098 | typedef struct ScannedMember ScannedMember; | |
2098 | 2099 | /** Field as it's being read. */ |
2099 | struct _ScannedMember { | |
2100 | struct ScannedMember { | |
2100 | 2101 | uint32_t tag; /**< Field tag. */ |
2101 | 2102 | uint8_t wire_type; /**< Field type. */ |
2102 | 2103 | uint8_t length_prefix_len; /**< Prefix length. */ |
2131 | 2132 | // Protobuf messages should always be less than 2 GiB in size. |
2132 | 2133 | // We also want to return early here so that hdr_len + val does |
2133 | 2134 | // not overflow on 32-bit systems. |
2134 | PROTOBUF_C_UNPACK_ERROR("length prefix of %lu is too large", val); | |
2135 | PROTOBUF_C_UNPACK_ERROR("length prefix of %lu is too large", | |
2136 | (unsigned long int)val); | |
2135 | 2137 | return 0; |
2136 | 2138 | } |
2137 | 2139 | if (hdr_len + val > len) { |
2138 | PROTOBUF_C_UNPACK_ERROR("data too short after length-prefix of %lu", val); | |
2140 | PROTOBUF_C_UNPACK_ERROR("data too short after length-prefix of %lu", | |
2141 | (unsigned long int)val); | |
2139 | 2142 | return 0; |
2140 | 2143 | } |
2141 | 2144 | return hdr_len + val; |
2497 | 2500 | { |
2498 | 2501 | unsigned len = scanned_member->len; |
2499 | 2502 | const uint8_t *data = scanned_member->data; |
2500 | ProtobufCWireType wire_type = scanned_member->wire_type; | |
2503 | uint8_t wire_type = scanned_member->wire_type; | |
2501 | 2504 | |
2502 | 2505 | switch (scanned_member->field->type) { |
2503 | 2506 | case PROTOBUF_C_TYPE_ENUM: |
2578 | 2581 | { |
2579 | 2582 | do_free(allocator, bd->data); |
2580 | 2583 | } |
2581 | if (len - pref_len > 0) { | |
2584 | if (len > pref_len) { | |
2582 | 2585 | bd->data = do_alloc(allocator, len - pref_len); |
2583 | 2586 | if (bd->data == NULL) |
2584 | 2587 | return FALSE; |
2746 | 2749 | const uint8_t *at = scanned_member->data + scanned_member->length_prefix_len; |
2747 | 2750 | size_t rem = scanned_member->len - scanned_member->length_prefix_len; |
2748 | 2751 | size_t count = 0; |
2752 | #if defined(WORDS_BIGENDIAN) | |
2749 | 2753 | unsigned i; |
2754 | #endif | |
2750 | 2755 | |
2751 | 2756 | switch (field->type) { |
2752 | 2757 | case PROTOBUF_C_TYPE_SFIXED32: |
2839 | 2844 | } |
2840 | 2845 | break; |
2841 | 2846 | case PROTOBUF_C_TYPE_BOOL: |
2842 | count = rem; | |
2843 | for (i = 0; i < count; i++) { | |
2844 | if (at[i] > 1) { | |
2847 | while (rem > 0) { | |
2848 | unsigned s = scan_varint(rem, at); | |
2849 | if (s == 0) { | |
2845 | 2850 | PROTOBUF_C_UNPACK_ERROR("bad packed-repeated boolean value"); |
2846 | 2851 | return FALSE; |
2847 | 2852 | } |
2848 | ((protobuf_c_boolean *) array)[i] = at[i]; | |
2853 | ((protobuf_c_boolean *) array)[count++] = parse_boolean(s, at); | |
2854 | at += s; | |
2855 | rem -= s; | |
2849 | 2856 | } |
2850 | 2857 | break; |
2851 | 2858 | default: |
3079 | 3086 | |
3080 | 3087 | while (rem > 0) { |
3081 | 3088 | uint32_t tag; |
3082 | ProtobufCWireType wire_type; | |
3089 | uint8_t wire_type; | |
3083 | 3090 | size_t used = parse_tag_and_wiretype(rem, at, &tag, &wire_type); |
3084 | 3091 | const ProtobufCFieldDescriptor *field; |
3085 | 3092 | ScannedMember tmp; |
237 | 237 | #define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af |
238 | 238 | |
239 | 239 | /* Empty string used for initializers */ |
240 | #if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) | |
241 | static const char protobuf_c_empty_string[] = ""; | |
242 | #else | |
240 | 243 | extern const char protobuf_c_empty_string[]; |
244 | #endif | |
241 | 245 | |
242 | 246 | /** |
243 | 247 | * \defgroup api Public API |
789 | 793 | * The version of the protobuf-c headers, represented as a string using the same |
790 | 794 | * format as protobuf_c_version(). |
791 | 795 | */ |
792 | #define PROTOBUF_C_VERSION "1.3.3" | |
796 | #define PROTOBUF_C_VERSION "1.4.0" | |
793 | 797 | |
794 | 798 | /** |
795 | 799 | * The version of the protobuf-c headers, represented as an integer using the |
796 | 800 | * same format as protobuf_c_version_number(). |
797 | 801 | */ |
798 | #define PROTOBUF_C_VERSION_NUMBER 1003003 | |
802 | #define PROTOBUF_C_VERSION_NUMBER 1004000 | |
799 | 803 | |
800 | 804 | /** |
801 | 805 | * The minimum protoc-c version which works with the current version of the |
0 | /* | |
1 | * Copyright (c) 2021, the protobuf-c authors. | |
2 | * All rights reserved. | |
3 | * | |
4 | * Redistribution and use in source and binary forms, with or without | |
5 | * modification, are permitted provided that the following conditions are | |
6 | * met: | |
7 | * | |
8 | * * Redistributions of source code must retain the above copyright | |
9 | * notice, this list of conditions and the following disclaimer. | |
10 | * | |
11 | * * Redistributions in binary form must reproduce the above | |
12 | * copyright notice, this list of conditions and the following disclaimer | |
13 | * in the documentation and/or other materials provided with the | |
14 | * distribution. | |
15 | * | |
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
17 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
18 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
19 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
20 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
22 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
26 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | */ | |
28 | ||
29 | syntax = "proto2"; | |
30 | import "google/protobuf/descriptor.proto"; | |
31 | ||
32 | // We never need to generate protobuf-c.pb-c.{c,h}, the options are used | |
33 | // only by protoc-gen-c, never by the protobuf-c runtime itself | |
34 | option (pb_c_file).no_generate = true; | |
35 | ||
36 | message ProtobufCFileOptions { | |
37 | // Suppresses pb-c.{c,h} file output completely. | |
38 | optional bool no_generate = 1 [default = false]; | |
39 | ||
40 | // Generate helper pack/unpack functions? | |
41 | // For backwards compatibility, if this field is not explicitly set, | |
42 | // only top-level message pack/unpack functions will be generated | |
43 | optional bool gen_pack_helpers = 2 [default = true]; | |
44 | ||
45 | // Generate helper init message functions? | |
46 | optional bool gen_init_helpers = 3 [default = true]; | |
47 | ||
48 | // Use const char * instead of char * for string fields | |
49 | optional bool const_strings = 4 [default = false]; | |
50 | ||
51 | // For oneof fields, set ProtobufCFieldDescriptor name field to the | |
52 | // name of the containing oneof, instead of the field name | |
53 | optional bool use_oneof_field_name = 5 [default = false]; | |
54 | ||
55 | // Overrides the package name, if present | |
56 | optional string c_package = 6; | |
57 | } | |
58 | ||
59 | extend google.protobuf.FileOptions { | |
60 | optional ProtobufCFileOptions pb_c_file = 1019; | |
61 | } | |
62 | ||
63 | message ProtobufCMessageOptions { | |
64 | // Overrides the parent setting only if present | |
65 | optional bool gen_pack_helpers = 1 [default = false]; | |
66 | ||
67 | // Overrides the parent setting only if present | |
68 | optional bool gen_init_helpers = 2 [default = true]; | |
69 | ||
70 | // Reserved base message field name | |
71 | optional string base_field_name = 3 [default = "base"]; | |
72 | } | |
73 | ||
74 | extend google.protobuf.MessageOptions { | |
75 | optional ProtobufCMessageOptions pb_c_msg = 1019; | |
76 | } | |
77 | ||
78 | message ProtobufCFieldOptions { | |
79 | // Treat string as bytes in generated code | |
80 | optional bool string_as_bytes = 1 [default = false]; | |
81 | } | |
82 | ||
83 | extend google.protobuf.FieldOptions { | |
84 | optional ProtobufCFieldOptions pb_c_field = 1019; | |
85 | } |
63 | 63 | #include <protoc-c/c_helpers.h> |
64 | 64 | #include <google/protobuf/io/printer.h> |
65 | 65 | #include <google/protobuf/wire_format.h> |
66 | #include <google/protobuf/descriptor.pb.h> | |
66 | #include <protobuf-c/protobuf-c.pb.h> | |
67 | 67 | |
68 | 68 | namespace google { |
69 | 69 | namespace protobuf { |
73 | 73 | using internal::WireFormat; |
74 | 74 | |
75 | 75 | void SetBytesVariables(const FieldDescriptor* descriptor, |
76 | std::map<string, string>* variables) { | |
76 | std::map<std::string, std::string>* variables) { | |
77 | 77 | (*variables)["name"] = FieldName(descriptor); |
78 | 78 | (*variables)["default"] = |
79 | 79 | "\"" + CEscape(descriptor->default_value_string()) + "\""; |
88 | 88 | SetBytesVariables(descriptor, &variables_); |
89 | 89 | variables_["default_value"] = descriptor->has_default_value() |
90 | 90 | ? GetDefaultValue() |
91 | : string("{0,NULL}"); | |
91 | : std::string("{0,NULL}"); | |
92 | 92 | } |
93 | 93 | |
94 | 94 | BytesFieldGenerator::~BytesFieldGenerator() {} |
112 | 112 | } |
113 | 113 | void BytesFieldGenerator::GenerateDefaultValueDeclarations(io::Printer* printer) const |
114 | 114 | { |
115 | std::map<string, string> vars; | |
116 | vars["default_value_data"] = FullNameToLower(descriptor_->full_name()) | |
115 | std::map<std::string, std::string> vars; | |
116 | vars["default_value_data"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()) | |
117 | 117 | + "__default_value_data"; |
118 | 118 | printer->Print(vars, "extern uint8_t $default_value_data$[];\n"); |
119 | 119 | } |
120 | 120 | |
121 | 121 | void BytesFieldGenerator::GenerateDefaultValueImplementations(io::Printer* printer) const |
122 | 122 | { |
123 | std::map<string, string> vars; | |
124 | vars["default_value_data"] = FullNameToLower(descriptor_->full_name()) | |
123 | std::map<std::string, std::string> vars; | |
124 | vars["default_value_data"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()) | |
125 | 125 | + "__default_value_data"; |
126 | 126 | vars["escaped"] = CEscape(descriptor_->default_value_string()); |
127 | 127 | printer->Print(vars, "uint8_t $default_value_data$[] = \"$escaped$\";\n"); |
128 | 128 | } |
129 | string BytesFieldGenerator::GetDefaultValue(void) const | |
129 | std::string BytesFieldGenerator::GetDefaultValue(void) const | |
130 | 130 | { |
131 | 131 | return "{ " |
132 | 132 | + SimpleItoa(descriptor_->default_value_string().size()) |
133 | 133 | + ", " |
134 | + FullNameToLower(descriptor_->full_name()) | |
134 | + FullNameToLower(descriptor_->full_name(), descriptor_->file()) | |
135 | 135 | + "__default_value_data }"; |
136 | 136 | } |
137 | 137 | void BytesFieldGenerator::GenerateStaticInit(io::Printer* printer) const |
81 | 81 | void GenerateDescriptorInitializer(io::Printer* printer) const; |
82 | 82 | void GenerateDefaultValueDeclarations(io::Printer* printer) const; |
83 | 83 | void GenerateDefaultValueImplementations(io::Printer* printer) const; |
84 | string GetDefaultValue(void) const; | |
84 | std::string GetDefaultValue(void) const; | |
85 | 85 | void GenerateStaticInit(io::Printer* printer) const; |
86 | 86 | |
87 | 87 | private: |
88 | std::map<string, string> variables_; | |
88 | std::map<std::string, std::string> variables_; | |
89 | 89 | |
90 | 90 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(BytesFieldGenerator); |
91 | 91 | }; |
72 | 72 | namespace c { |
73 | 73 | |
74 | 74 | EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor, |
75 | const string& dllexport_decl) | |
75 | const std::string& dllexport_decl) | |
76 | 76 | : descriptor_(descriptor), |
77 | 77 | dllexport_decl_(dllexport_decl) { |
78 | 78 | } |
80 | 80 | EnumGenerator::~EnumGenerator() {} |
81 | 81 | |
82 | 82 | void EnumGenerator::GenerateDefinition(io::Printer* printer) { |
83 | std::map<string, string> vars; | |
84 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
83 | std::map<std::string, std::string> vars; | |
84 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
85 | 85 | vars["shortname"] = descriptor_->name(); |
86 | vars["uc_name"] = FullNameToUpper(descriptor_->full_name()); | |
86 | vars["uc_name"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()); | |
87 | 87 | |
88 | 88 | SourceLocation sourceLoc; |
89 | 89 | descriptor_->GetSourceLocation(&sourceLoc); |
97 | 97 | |
98 | 98 | |
99 | 99 | vars["opt_comma"] = ","; |
100 | vars["prefix"] = FullNameToUpper(descriptor_->full_name()) + "__"; | |
100 | vars["prefix"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()) + "__"; | |
101 | 101 | for (int i = 0; i < descriptor_->value_count(); i++) { |
102 | 102 | vars["name"] = descriptor_->value(i)->name(); |
103 | 103 | vars["number"] = SimpleItoa(descriptor_->value(i)->number()); |
125 | 125 | } |
126 | 126 | |
127 | 127 | void EnumGenerator::GenerateDescriptorDeclarations(io::Printer* printer) { |
128 | std::map<string, string> vars; | |
128 | std::map<std::string, std::string> vars; | |
129 | 129 | if (dllexport_decl_.empty()) { |
130 | 130 | vars["dllexport"] = ""; |
131 | 131 | } else { |
132 | 132 | vars["dllexport"] = dllexport_decl_ + " "; |
133 | 133 | } |
134 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
135 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
134 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
135 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
136 | 136 | |
137 | 137 | printer->Print(vars, |
138 | 138 | "extern $dllexport$const ProtobufCEnumDescriptor $lcclassname$__descriptor;\n"); |
148 | 148 | void EnumGenerator::GenerateValueInitializer(io::Printer *printer, int index) |
149 | 149 | { |
150 | 150 | const EnumValueDescriptor *vd = descriptor_->value(index); |
151 | std::map<string, string> vars; | |
151 | std::map<std::string, std::string> vars; | |
152 | 152 | bool optimize_code_size = descriptor_->file()->options().has_optimize_for() && |
153 | 153 | descriptor_->file()->options().optimize_for() == |
154 | 154 | FileOptions_OptimizeMode_CODE_SIZE; |
155 | 155 | vars["enum_value_name"] = vd->name(); |
156 | vars["c_enum_value_name"] = FullNameToUpper(descriptor_->full_name()) + "__" + vd->name(); | |
156 | vars["c_enum_value_name"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()) + "__" + vd->name(); | |
157 | 157 | vars["value"] = SimpleItoa(vd->number()); |
158 | 158 | if (optimize_code_size) |
159 | 159 | printer->Print(vars, " { NULL, NULL, $value$ }, /* CODE_SIZE */\n"); |
181 | 181 | } |
182 | 182 | |
183 | 183 | void EnumGenerator::GenerateEnumDescriptor(io::Printer* printer) { |
184 | std::map<string, string> vars; | |
184 | std::map<std::string, std::string> vars; | |
185 | 185 | vars["fullname"] = descriptor_->full_name(); |
186 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
187 | vars["cname"] = FullNameToC(descriptor_->full_name()); | |
186 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
187 | vars["cname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
188 | 188 | vars["shortname"] = descriptor_->name(); |
189 | 189 | vars["packagename"] = descriptor_->file()->package(); |
190 | 190 | vars["value_count"] = SimpleItoa(descriptor_->value_count()); |
80 | 80 | public: |
81 | 81 | // See generator.cc for the meaning of dllexport_decl. |
82 | 82 | explicit EnumGenerator(const EnumDescriptor* descriptor, |
83 | const string& dllexport_decl); | |
83 | const std::string& dllexport_decl); | |
84 | 84 | ~EnumGenerator(); |
85 | 85 | |
86 | 86 | // Header stuff. |
104 | 104 | |
105 | 105 | private: |
106 | 106 | const EnumDescriptor* descriptor_; |
107 | string dllexport_decl_; | |
107 | std::string dllexport_decl_; | |
108 | 108 | |
109 | 109 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); |
110 | 110 | }; |
74 | 74 | // TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of |
75 | 75 | // repeat code between this and the other field types. |
76 | 76 | void SetEnumVariables(const FieldDescriptor* descriptor, |
77 | std::map<string, string>* variables) { | |
77 | std::map<std::string, std::string>* variables) { | |
78 | 78 | |
79 | 79 | (*variables)["name"] = FieldName(descriptor); |
80 | (*variables)["type"] = FullNameToC(descriptor->enum_type()->full_name()); | |
80 | (*variables)["type"] = FullNameToC(descriptor->enum_type()->full_name(), descriptor->enum_type()->file()); | |
81 | 81 | const EnumValueDescriptor* default_value = descriptor->default_value_enum(); |
82 | (*variables)["default"] = FullNameToUpper(default_value->type()->full_name()) | |
82 | (*variables)["default"] = FullNameToUpper(default_value->type()->full_name(), default_value->type()->file()) | |
83 | 83 | + "__" + default_value->name(); |
84 | 84 | (*variables)["deprecated"] = FieldDeprecated(descriptor); |
85 | 85 | } |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | string EnumFieldGenerator::GetDefaultValue(void) const | |
116 | std::string EnumFieldGenerator::GetDefaultValue(void) const | |
117 | 117 | { |
118 | 118 | return variables_.find("default")->second; |
119 | 119 | } |
137 | 137 | |
138 | 138 | void EnumFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const |
139 | 139 | { |
140 | string addr = "&" + FullNameToLower(descriptor_->enum_type()->full_name()) + "__descriptor"; | |
140 | std::string addr = "&" + FullNameToLower(descriptor_->enum_type()->full_name(), descriptor_->enum_type()->file()) + "__descriptor"; | |
141 | 141 | GenerateDescriptorInitializerGeneric(printer, true, "ENUM", addr); |
142 | 142 | } |
143 | 143 |
79 | 79 | // implements FieldGenerator --------------------------------------- |
80 | 80 | void GenerateStructMembers(io::Printer* printer) const; |
81 | 81 | void GenerateDescriptorInitializer(io::Printer* printer) const; |
82 | string GetDefaultValue(void) const; | |
82 | std::string GetDefaultValue(void) const; | |
83 | 83 | void GenerateStaticInit(io::Printer* printer) const; |
84 | 84 | |
85 | 85 | private: |
86 | std::map<string, string> variables_; | |
86 | std::map<std::string, std::string> variables_; | |
87 | 87 | |
88 | 88 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator); |
89 | 89 | }; |
69 | 69 | namespace c { |
70 | 70 | |
71 | 71 | ExtensionGenerator::ExtensionGenerator(const FieldDescriptor* descriptor, |
72 | const string& dllexport_decl) | |
72 | const std::string& dllexport_decl) | |
73 | 73 | : descriptor_(descriptor), |
74 | 74 | dllexport_decl_(dllexport_decl) { |
75 | 75 | } |
84 | 84 | public: |
85 | 85 | // See generator.cc for the meaning of dllexport_decl. |
86 | 86 | explicit ExtensionGenerator(const FieldDescriptor* descriptor, |
87 | const string& dllexport_decl); | |
87 | const std::string& dllexport_decl); | |
88 | 88 | ~ExtensionGenerator(); |
89 | 89 | |
90 | 90 | // Header stuff. |
95 | 95 | |
96 | 96 | private: |
97 | 97 | const FieldDescriptor* descriptor_; |
98 | string type_traits_; | |
99 | string dllexport_decl_; | |
98 | std::string type_traits_; | |
99 | std::string dllexport_decl_; | |
100 | 100 | |
101 | 101 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); |
102 | 102 | }; |
66 | 66 | #include <protoc-c/c_enum_field.h> |
67 | 67 | #include <protoc-c/c_message_field.h> |
68 | 68 | #include <protoc-c/c_helpers.h> |
69 | #include <google/protobuf/descriptor.pb.h> | |
69 | #include <protobuf-c/protobuf-c.pb.h> | |
70 | 70 | #include <google/protobuf/stubs/common.h> |
71 | 71 | #include <google/protobuf/io/printer.h> |
72 | 72 | |
102 | 102 | |
103 | 103 | void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer, |
104 | 104 | bool optional_uses_has, |
105 | const string &type_macro, | |
106 | const string &descriptor_addr) const | |
105 | const std::string &type_macro, | |
106 | const std::string &descriptor_addr) const | |
107 | 107 | { |
108 | std::map<string, string> variables; | |
108 | std::map<std::string, std::string> variables; | |
109 | const OneofDescriptor *oneof = descriptor_->containing_oneof(); | |
110 | const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file); | |
109 | 111 | variables["TYPE"] = type_macro; |
110 | variables["classname"] = FullNameToC(FieldScope(descriptor_)->full_name()); | |
112 | variables["classname"] = FullNameToC(FieldScope(descriptor_)->full_name(), FieldScope(descriptor_)->file()); | |
111 | 113 | variables["name"] = FieldName(descriptor_); |
112 | variables["proto_name"] = descriptor_->name(); | |
114 | if (opt.use_oneof_field_name()) | |
115 | variables["proto_name"] = oneof->name(); | |
116 | else | |
117 | variables["proto_name"] = descriptor_->name(); | |
113 | 118 | variables["descriptor_addr"] = descriptor_addr; |
114 | 119 | variables["value"] = SimpleItoa(descriptor_->number()); |
115 | const OneofDescriptor *oneof = descriptor_->containing_oneof(); | |
116 | 120 | if (oneof != NULL) |
117 | variables["oneofname"] = FullNameToLower(oneof->name()); | |
121 | variables["oneofname"] = CamelToLower(oneof->name()); | |
118 | 122 | |
119 | 123 | if (FieldSyntax(descriptor_) == 3 && |
120 | 124 | descriptor_->label() == FieldDescriptor::LABEL_OPTIONAL) { |
125 | 129 | } |
126 | 130 | |
127 | 131 | if (descriptor_->has_default_value()) { |
128 | variables["default_value"] = string("&") | |
129 | + FullNameToLower(descriptor_->full_name()) | |
132 | variables["default_value"] = std::string("&") | |
133 | + FullNameToLower(descriptor_->full_name(), descriptor_->file()) | |
130 | 134 | + "__default_value"; |
131 | 135 | } else if (FieldSyntax(descriptor_) == 3 && |
132 | 136 | descriptor_->type() == FieldDescriptor::TYPE_STRING) { |
202 | 206 | } |
203 | 207 | |
204 | 208 | FieldGenerator* FieldGeneratorMap::MakeGenerator(const FieldDescriptor* field) { |
209 | const ProtobufCFieldOptions opt = field->options().GetExtension(pb_c_field); | |
205 | 210 | switch (field->type()) { |
206 | 211 | case FieldDescriptor::TYPE_MESSAGE: |
207 | 212 | return new MessageFieldGenerator(field); |
208 | 213 | case FieldDescriptor::TYPE_STRING: |
209 | return new StringFieldGenerator(field); | |
214 | if (opt.string_as_bytes()) | |
215 | return new BytesFieldGenerator(field); | |
216 | else | |
217 | return new StringFieldGenerator(field); | |
210 | 218 | case FieldDescriptor::TYPE_BYTES: |
211 | 219 | return new BytesFieldGenerator(field); |
212 | 220 | case FieldDescriptor::TYPE_ENUM: |
90 | 90 | |
91 | 91 | virtual void GenerateDefaultValueDeclarations(io::Printer* printer) const { } |
92 | 92 | virtual void GenerateDefaultValueImplementations(io::Printer* printer) const { } |
93 | virtual string GetDefaultValue() const = 0; | |
93 | virtual std::string GetDefaultValue() const = 0; | |
94 | 94 | |
95 | 95 | // Generate members to initialize this field from a static initializer |
96 | 96 | virtual void GenerateStaticInit(io::Printer* printer) const = 0; |
99 | 99 | protected: |
100 | 100 | void GenerateDescriptorInitializerGeneric(io::Printer* printer, |
101 | 101 | bool optional_uses_has, |
102 | const string &type_macro, | |
103 | const string &descriptor_addr) const; | |
102 | const std::string &type_macro, | |
103 | const std::string &descriptor_addr) const; | |
104 | 104 | const FieldDescriptor *descriptor_; |
105 | 105 | |
106 | 106 | private: |
67 | 67 | #include <protoc-c/c_helpers.h> |
68 | 68 | #include <protoc-c/c_message.h> |
69 | 69 | #include <google/protobuf/io/printer.h> |
70 | #include <google/protobuf/descriptor.pb.h> | |
70 | #include <protobuf-c/protobuf-c.pb.h> | |
71 | 71 | |
72 | 72 | #include "protobuf-c.h" |
73 | 73 | |
79 | 79 | // =================================================================== |
80 | 80 | |
81 | 81 | FileGenerator::FileGenerator(const FileDescriptor* file, |
82 | const string& dllexport_decl) | |
82 | const std::string& dllexport_decl) | |
83 | 83 | : file_(file), |
84 | 84 | message_generators_( |
85 | 85 | new std::unique_ptr<MessageGenerator>[file->message_type_count()]), |
109 | 109 | extension_generators_[i].reset( |
110 | 110 | new ExtensionGenerator(file->extension(i), dllexport_decl)); |
111 | 111 | } |
112 | ||
113 | SplitStringUsing(file_->package(), ".", &package_parts_); | |
114 | 112 | } |
115 | 113 | |
116 | 114 | FileGenerator::~FileGenerator() {} |
117 | 115 | |
118 | 116 | void FileGenerator::GenerateHeader(io::Printer* printer) { |
119 | string filename_identifier = FilenameIdentifier(file_->name()); | |
117 | std::string filename_identifier = FilenameIdentifier(file_->name()); | |
120 | 118 | |
121 | 119 | int min_header_version = 1000000; |
122 | 120 | #if defined(HAVE_PROTO3) |
156 | 154 | "protoc_version", SimpleItoa(PROTOBUF_C_VERSION_NUMBER)); |
157 | 155 | |
158 | 156 | for (int i = 0; i < file_->dependency_count(); i++) { |
159 | printer->Print( | |
160 | "#include \"$dependency$.pb-c.h\"\n", | |
161 | "dependency", StripProto(file_->dependency(i)->name())); | |
157 | const ProtobufCFileOptions opt = | |
158 | file_->dependency(i)->options().GetExtension(pb_c_file); | |
159 | if (!opt.no_generate()) { | |
160 | printer->Print( | |
161 | "#include \"$dependency$.pb-c.h\"\n", | |
162 | "dependency", StripProto(file_->dependency(i)->name())); | |
163 | } | |
162 | 164 | } |
163 | 165 | |
164 | 166 | printer->Print("\n"); |
186 | 188 | } |
187 | 189 | |
188 | 190 | for (int i = 0; i < file_->message_type_count(); i++) { |
189 | message_generators_[i]->GenerateHelperFunctionDeclarations(printer, false); | |
191 | const ProtobufCFileOptions opt = file_->options().GetExtension(pb_c_file); | |
192 | ||
193 | message_generators_[i]->GenerateHelperFunctionDeclarations( | |
194 | printer, | |
195 | opt.has_gen_pack_helpers(), | |
196 | opt.gen_pack_helpers(), | |
197 | opt.gen_init_helpers()); | |
190 | 198 | } |
191 | 199 | |
192 | 200 | printer->Print("/* --- per-message closures --- */\n\n"); |
237 | 245 | "filename", file_->name(), |
238 | 246 | "basename", StripProto(file_->name())); |
239 | 247 | |
240 | #if 0 | |
241 | // For each dependency, write a prototype for that dependency's | |
242 | // BuildDescriptors() function. We don't expose these in the header because | |
243 | // they are internal implementation details, and since this is generated code | |
244 | // we don't have the usual risks involved with declaring external functions | |
245 | // within a .cc file. | |
246 | for (int i = 0; i < file_->dependency_count(); i++) { | |
247 | const FileDescriptor* dependency = file_->dependency(i); | |
248 | // Open the dependency's namespace. | |
249 | vector<string> dependency_package_parts; | |
250 | SplitStringUsing(dependency->package(), ".", &dependency_package_parts); | |
251 | // Declare its BuildDescriptors() function. | |
252 | printer->Print( | |
253 | "void $function$();", | |
254 | "function", GlobalBuildDescriptorsName(dependency->name())); | |
255 | // Close the namespace. | |
256 | for (int i = 0; i < dependency_package_parts.size(); i++) { | |
257 | printer->Print(" }"); | |
258 | } | |
259 | printer->Print("\n"); | |
260 | } | |
261 | #endif | |
262 | ||
263 | for (int i = 0; i < file_->message_type_count(); i++) { | |
264 | message_generators_[i]->GenerateHelperFunctionDefinitions(printer, false); | |
265 | } | |
266 | for (int i = 0; i < file_->message_type_count(); i++) { | |
267 | message_generators_[i]->GenerateMessageDescriptor(printer); | |
248 | const ProtobufCFileOptions opt = file_->options().GetExtension(pb_c_file); | |
249 | ||
250 | for (int i = 0; i < file_->message_type_count(); i++) { | |
251 | message_generators_[i]->GenerateHelperFunctionDefinitions( | |
252 | printer, | |
253 | opt.has_gen_pack_helpers(), | |
254 | opt.gen_pack_helpers(), | |
255 | opt.gen_init_helpers()); | |
256 | } | |
257 | for (int i = 0; i < file_->message_type_count(); i++) { | |
258 | message_generators_[i]->GenerateMessageDescriptor(printer, | |
259 | opt.gen_init_helpers()); | |
268 | 260 | } |
269 | 261 | for (int i = 0; i < file_->enum_type_count(); i++) { |
270 | 262 | enum_generators_[i]->GenerateEnumDescriptor(printer); |
89 | 89 | public: |
90 | 90 | // See generator.cc for the meaning of dllexport_decl. |
91 | 91 | explicit FileGenerator(const FileDescriptor* file, |
92 | const string& dllexport_decl); | |
92 | const std::string& dllexport_decl); | |
93 | 93 | ~FileGenerator(); |
94 | 94 | |
95 | 95 | void GenerateHeader(io::Printer* printer); |
103 | 103 | std::unique_ptr<std::unique_ptr<ServiceGenerator>[]> service_generators_; |
104 | 104 | std::unique_ptr<std::unique_ptr<ExtensionGenerator>[]> extension_generators_; |
105 | 105 | |
106 | // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}. | |
107 | std::vector<string> package_parts_; | |
108 | ||
109 | 106 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator); |
110 | 107 | }; |
111 | 108 |
69 | 69 | #include <protoc-c/c_helpers.h> |
70 | 70 | #include <google/protobuf/io/printer.h> |
71 | 71 | #include <google/protobuf/io/zero_copy_stream.h> |
72 | #include <google/protobuf/descriptor.pb.h> | |
72 | #include <protobuf-c/protobuf-c.pb.h> | |
73 | 73 | |
74 | 74 | namespace google { |
75 | 75 | namespace protobuf { |
80 | 80 | // "foo=bar,baz,qux=corge" |
81 | 81 | // parses to the pairs: |
82 | 82 | // ("foo", "bar"), ("baz", ""), ("qux", "corge") |
83 | void ParseOptions(const string& text, std::vector<std::pair<string, string> >* output) { | |
84 | std::vector<string> parts; | |
83 | void ParseOptions(const std::string& text, std::vector<std::pair<std::string, std::string> >* output) { | |
84 | std::vector<std::string> parts; | |
85 | 85 | SplitStringUsing(text, ",", &parts); |
86 | 86 | |
87 | 87 | for (unsigned i = 0; i < parts.size(); i++) { |
88 | string::size_type equals_pos = parts[i].find_first_of('='); | |
89 | std::pair<string, string> value; | |
90 | if (equals_pos == string::npos) { | |
88 | std::string::size_type equals_pos = parts[i].find_first_of('='); | |
89 | std::pair<std::string, std::string> value; | |
90 | if (equals_pos == std::string::npos) { | |
91 | 91 | value.first = parts[i]; |
92 | 92 | value.second = ""; |
93 | 93 | } else { |
102 | 102 | CGenerator::~CGenerator() {} |
103 | 103 | |
104 | 104 | bool CGenerator::Generate(const FileDescriptor* file, |
105 | const string& parameter, | |
105 | const std::string& parameter, | |
106 | 106 | OutputDirectory* output_directory, |
107 | string* error) const { | |
108 | std::vector<std::pair<string, string> > options; | |
107 | std::string* error) const { | |
108 | if (file->options().GetExtension(pb_c_file).no_generate()) | |
109 | return true; | |
110 | ||
111 | std::vector<std::pair<std::string, std::string> > options; | |
109 | 112 | ParseOptions(parameter, &options); |
110 | 113 | |
111 | 114 | // ----------------------------------------------------------------- |
128 | 131 | // } |
129 | 132 | // FOO_EXPORT is a macro which should expand to __declspec(dllexport) or |
130 | 133 | // __declspec(dllimport) depending on what is being compiled. |
131 | string dllexport_decl; | |
134 | std::string dllexport_decl; | |
132 | 135 | |
133 | 136 | for (unsigned i = 0; i < options.size(); i++) { |
134 | 137 | if (options[i].first == "dllexport_decl") { |
142 | 145 | // ----------------------------------------------------------------- |
143 | 146 | |
144 | 147 | |
145 | string basename = StripProto(file->name()); | |
148 | std::string basename = StripProto(file->name()); | |
146 | 149 | basename.append(".pb-c"); |
147 | 150 | |
148 | 151 | FileGenerator file_generator(file, dllexport_decl); |
67 | 67 | #include <string> |
68 | 68 | #include <google/protobuf/compiler/code_generator.h> |
69 | 69 | |
70 | #if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) | |
71 | # define PROTOC_C_EXPORT __declspec(dllexport) | |
72 | #else | |
73 | # define PROTOC_C_EXPORT | |
74 | #endif | |
75 | ||
70 | 76 | namespace google { |
71 | 77 | namespace protobuf { |
72 | 78 | namespace compiler { |
76 | 82 | // header. If you create your own protocol compiler binary and you want |
77 | 83 | // it to support C++ output, you can do so by registering an instance of this |
78 | 84 | // CodeGenerator with the CommandLineInterface in your main() function. |
79 | class LIBPROTOC_EXPORT CGenerator : public CodeGenerator { | |
85 | class PROTOC_C_EXPORT CGenerator : public CodeGenerator { | |
80 | 86 | public: |
81 | 87 | CGenerator(); |
82 | 88 | ~CGenerator(); |
83 | 89 | |
84 | 90 | // implements CodeGenerator ---------------------------------------- |
85 | 91 | bool Generate(const FileDescriptor* file, |
86 | const string& parameter, | |
92 | const std::string& parameter, | |
87 | 93 | OutputDirectory* output_directory, |
88 | string* error) const; | |
94 | std::string* error) const; | |
89 | 95 | |
90 | 96 | private: |
91 | 97 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CGenerator); |
86 | 86 | #pragma warning(disable:4996) |
87 | 87 | #endif |
88 | 88 | |
89 | string DotsToUnderscores(const string& name) { | |
89 | std::string DotsToUnderscores(const std::string& name) { | |
90 | 90 | return StringReplace(name, ".", "_", true); |
91 | 91 | } |
92 | 92 | |
93 | string DotsToColons(const string& name) { | |
93 | std::string DotsToColons(const std::string& name) { | |
94 | 94 | return StringReplace(name, ".", "::", true); |
95 | 95 | } |
96 | 96 | |
97 | string SimpleFtoa(float f) { | |
97 | std::string SimpleFtoa(float f) { | |
98 | 98 | char buf[100]; |
99 | 99 | snprintf(buf,sizeof(buf),"%.*g", FLT_DIG, f); |
100 | 100 | buf[sizeof(buf)-1] = 0; /* should NOT be necessary */ |
101 | 101 | return buf; |
102 | 102 | } |
103 | string SimpleDtoa(double d) { | |
103 | std::string SimpleDtoa(double d) { | |
104 | 104 | char buf[100]; |
105 | 105 | snprintf(buf,sizeof(buf),"%.*g", DBL_DIG, d); |
106 | 106 | buf[sizeof(buf)-1] = 0; /* should NOT be necessary */ |
107 | 107 | return buf; |
108 | 108 | } |
109 | 109 | |
110 | string CamelToUpper(const string &name) { | |
110 | std::string CamelToUpper(const std::string &name) { | |
111 | 111 | bool was_upper = true; // suppress initial _ |
112 | string rv = ""; | |
112 | std::string rv = ""; | |
113 | 113 | int len = name.length(); |
114 | 114 | for (int i = 0; i < len; i++) { |
115 | 115 | bool is_upper = isupper(name[i]); |
124 | 124 | } |
125 | 125 | return rv; |
126 | 126 | } |
127 | string CamelToLower(const string &name) { | |
127 | std::string CamelToLower(const std::string &name) { | |
128 | 128 | bool was_upper = true; // suppress initial _ |
129 | string rv = ""; | |
129 | std::string rv = ""; | |
130 | 130 | int len = name.length(); |
131 | 131 | for (int i = 0; i < len; i++) { |
132 | 132 | bool is_upper = isupper(name[i]); |
143 | 143 | } |
144 | 144 | |
145 | 145 | |
146 | string ToUpper(const string &name) { | |
147 | string rv = ""; | |
146 | std::string ToUpper(const std::string &name) { | |
147 | std::string rv = ""; | |
148 | 148 | int len = name.length(); |
149 | 149 | for (int i = 0; i < len; i++) { |
150 | 150 | rv += toupper(name[i]); |
151 | 151 | } |
152 | 152 | return rv; |
153 | 153 | } |
154 | string ToLower(const string &name) { | |
155 | string rv = ""; | |
154 | std::string ToLower(const std::string &name) { | |
155 | std::string rv = ""; | |
156 | 156 | int len = name.length(); |
157 | 157 | for (int i = 0; i < len; i++) { |
158 | 158 | rv += tolower(name[i]); |
159 | 159 | } |
160 | 160 | return rv; |
161 | 161 | } |
162 | string ToCamel(const string &name) { | |
163 | string rv = ""; | |
162 | std::string ToCamel(const std::string &name) { | |
163 | std::string rv = ""; | |
164 | 164 | int len = name.length(); |
165 | 165 | bool next_is_upper = true; |
166 | 166 | for (int i = 0; i < len; i++) { |
176 | 176 | return rv; |
177 | 177 | } |
178 | 178 | |
179 | string FullNameToLower(const string &full_name) { | |
180 | std::vector<string> pieces; | |
181 | SplitStringUsing(full_name, ".", &pieces); | |
182 | string rv = ""; | |
179 | std::string OverrideFullName(const std::string &full_name, | |
180 | const FileDescriptor *file) { | |
181 | const ProtobufCFileOptions opt = file->options().GetExtension(pb_c_file); | |
182 | if (!opt.has_c_package()) | |
183 | return full_name; | |
184 | ||
185 | std::string new_name = opt.c_package(); | |
186 | if (file->package().empty()) | |
187 | new_name += "."; | |
188 | ||
189 | return new_name + full_name.substr(file->package().length()); | |
190 | } | |
191 | ||
192 | std::string FullNameToLower(const std::string &full_name, | |
193 | const FileDescriptor *file) { | |
194 | std::vector<std::string> pieces; | |
195 | SplitStringUsing(OverrideFullName(full_name, file), ".", &pieces); | |
196 | std::string rv = ""; | |
183 | 197 | for (unsigned i = 0; i < pieces.size(); i++) { |
184 | 198 | if (pieces[i] == "") continue; |
185 | 199 | if (rv != "") rv += "__"; |
187 | 201 | } |
188 | 202 | return rv; |
189 | 203 | } |
190 | string FullNameToUpper(const string &full_name) { | |
191 | std::vector<string> pieces; | |
192 | SplitStringUsing(full_name, ".", &pieces); | |
193 | string rv = ""; | |
204 | std::string FullNameToUpper(const std::string &full_name, | |
205 | const FileDescriptor *file) { | |
206 | std::vector<std::string> pieces; | |
207 | SplitStringUsing(OverrideFullName(full_name, file), ".", &pieces); | |
208 | std::string rv = ""; | |
194 | 209 | for (unsigned i = 0; i < pieces.size(); i++) { |
195 | 210 | if (pieces[i] == "") continue; |
196 | 211 | if (rv != "") rv += "__"; |
198 | 213 | } |
199 | 214 | return rv; |
200 | 215 | } |
201 | string FullNameToC(const string &full_name) { | |
202 | std::vector<string> pieces; | |
203 | SplitStringUsing(full_name, ".", &pieces); | |
204 | string rv = ""; | |
216 | std::string FullNameToC(const std::string &full_name, | |
217 | const FileDescriptor *file) { | |
218 | std::vector<std::string> pieces; | |
219 | SplitStringUsing(OverrideFullName(full_name, file), ".", &pieces); | |
220 | std::string rv = ""; | |
205 | 221 | for (unsigned i = 0; i < pieces.size(); i++) { |
206 | 222 | if (pieces[i] == "") continue; |
207 | 223 | if (rv != "") rv += "__"; |
210 | 226 | return rv; |
211 | 227 | } |
212 | 228 | |
213 | void PrintComment (io::Printer* printer, string comment) | |
229 | void PrintComment (io::Printer* printer, std::string comment) | |
214 | 230 | { |
215 | 231 | if (!comment.empty()) |
216 | 232 | { |
217 | std::vector<string> comment_lines; | |
233 | std::vector<std::string> comment_lines; | |
218 | 234 | SplitStringUsing (comment, "\r\n", &comment_lines); |
219 | 235 | printer->Print ("/*\n"); |
220 | 236 | for (int i = 0; i < comment_lines.size(); i++) |
227 | 243 | |
228 | 244 | /* Or cause other compiler issues. */ |
229 | 245 | size_t delim_i; |
230 | while ((delim_i = comment_lines[i].find("/*")) != string::npos) | |
246 | while ((delim_i = comment_lines[i].find("/*")) != std::string::npos) | |
231 | 247 | comment_lines[i][delim_i] = ' '; |
232 | 248 | |
233 | while ((delim_i = comment_lines[i].find("*/")) != string::npos) | |
249 | while ((delim_i = comment_lines[i].find("*/")) != std::string::npos) | |
234 | 250 | comment_lines[i][delim_i + 1] = ' '; |
235 | 251 | |
236 | 252 | printer->Print (" *$line$\n", "line", comment_lines[i]); |
240 | 256 | } |
241 | 257 | } |
242 | 258 | |
243 | string ConvertToSpaces(const string &input) { | |
244 | return string(input.size(), ' '); | |
259 | std::string ConvertToSpaces(const std::string &input) { | |
260 | return std::string(input.size(), ' '); | |
245 | 261 | } |
246 | 262 | |
247 | 263 | int compare_name_indices_by_name(const void *a, const void *b) |
252 | 268 | } |
253 | 269 | |
254 | 270 | |
255 | string CEscape(const string& src); | |
271 | std::string CEscape(const std::string& src); | |
256 | 272 | |
257 | 273 | const char* const kKeywordList[] = { |
258 | 274 | "and", "and_eq", "asm", "auto", "bitand", "bitor", "bool", "break", "case", |
267 | 283 | "void", "volatile", "wchar_t", "while", "xor", "xor_eq" |
268 | 284 | }; |
269 | 285 | |
270 | std::set<string> MakeKeywordsMap() { | |
271 | std::set<string> result; | |
286 | std::set<std::string> MakeKeywordsMap() { | |
287 | std::set<std::string> result; | |
272 | 288 | for (int i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) { |
273 | 289 | result.insert(kKeywordList[i]); |
274 | 290 | } |
275 | 291 | return result; |
276 | 292 | } |
277 | 293 | |
278 | std::set<string> kKeywords = MakeKeywordsMap(); | |
279 | ||
280 | string ClassName(const Descriptor* descriptor, bool qualified) { | |
281 | // Find "outer", the descriptor of the top-level message in which | |
282 | // "descriptor" is embedded. | |
283 | const Descriptor* outer = descriptor; | |
284 | while (outer->containing_type() != NULL) outer = outer->containing_type(); | |
285 | ||
286 | const string& outer_name = outer->full_name(); | |
287 | string inner_name = descriptor->full_name().substr(outer_name.size()); | |
288 | ||
289 | if (qualified) { | |
290 | return "::" + DotsToColons(outer_name) + DotsToUnderscores(inner_name); | |
291 | } else { | |
292 | return outer->name() + DotsToUnderscores(inner_name); | |
293 | } | |
294 | } | |
295 | ||
296 | string ClassName(const EnumDescriptor* enum_descriptor, bool qualified) { | |
297 | if (enum_descriptor->containing_type() == NULL) { | |
298 | if (qualified) { | |
299 | return DotsToColons(enum_descriptor->full_name()); | |
300 | } else { | |
301 | return enum_descriptor->name(); | |
302 | } | |
303 | } else { | |
304 | string result = ClassName(enum_descriptor->containing_type(), qualified); | |
305 | result += '_'; | |
306 | result += enum_descriptor->name(); | |
307 | return result; | |
308 | } | |
309 | } | |
310 | ||
311 | string FieldName(const FieldDescriptor* field) { | |
312 | string result = ToLower(field->name()); | |
294 | std::set<std::string> kKeywords = MakeKeywordsMap(); | |
295 | ||
296 | std::string FieldName(const FieldDescriptor* field) { | |
297 | std::string result = ToLower(field->name()); | |
313 | 298 | if (kKeywords.count(result) > 0) { |
314 | 299 | result.append("_"); |
315 | 300 | } |
316 | 301 | return result; |
317 | 302 | } |
318 | 303 | |
319 | string FieldDeprecated(const FieldDescriptor* field) { | |
304 | std::string FieldDeprecated(const FieldDescriptor* field) { | |
320 | 305 | if (field->options().deprecated()) { |
321 | 306 | return " PROTOBUF_C__DEPRECATED"; |
322 | 307 | } |
323 | 308 | return ""; |
324 | 309 | } |
325 | 310 | |
326 | string StripProto(const string& filename) { | |
311 | std::string StripProto(const std::string& filename) { | |
327 | 312 | if (HasSuffixString(filename, ".protodevel")) { |
328 | 313 | return StripSuffixString(filename, ".protodevel"); |
329 | 314 | } else { |
332 | 317 | } |
333 | 318 | |
334 | 319 | // Convert a file name into a valid identifier. |
335 | string FilenameIdentifier(const string& filename) { | |
336 | string result; | |
320 | std::string FilenameIdentifier(const std::string& filename) { | |
321 | std::string result; | |
337 | 322 | for (unsigned i = 0; i < filename.size(); i++) { |
338 | 323 | if (isalnum(filename[i])) { |
339 | 324 | result.push_back(filename[i]); |
349 | 334 | } |
350 | 335 | |
351 | 336 | // Return the name of the BuildDescriptors() function for a given file. |
352 | string GlobalBuildDescriptorsName(const string& filename) { | |
337 | std::string GlobalBuildDescriptorsName(const std::string& filename) { | |
353 | 338 | return "proto_BuildDescriptors_" + FilenameIdentifier(filename); |
354 | 339 | } |
355 | 340 | |
356 | string GetLabelName(FieldDescriptor::Label label) { | |
341 | std::string GetLabelName(FieldDescriptor::Label label) { | |
357 | 342 | switch (label) { |
358 | 343 | case FieldDescriptor::LABEL_OPTIONAL: return "optional"; |
359 | 344 | case FieldDescriptor::LABEL_REQUIRED: return "required"; |
363 | 348 | } |
364 | 349 | |
365 | 350 | unsigned |
366 | WriteIntRanges(io::Printer* printer, int n_values, const int *values, const string &name) | |
351 | WriteIntRanges(io::Printer* printer, int n_values, const int *values, const std::string &name) | |
367 | 352 | { |
368 | std::map<string, string> vars; | |
353 | std::map<std::string, std::string> vars; | |
369 | 354 | vars["name"] = name; |
370 | 355 | if (n_values > 0) { |
371 | 356 | int n_ranges = 1; |
419 | 404 | // it only replaces the first instance of "old." |
420 | 405 | // ---------------------------------------------------------------------- |
421 | 406 | |
422 | void StringReplace(const string& s, const string& oldsub, | |
423 | const string& newsub, bool replace_all, | |
424 | string* res) { | |
407 | void StringReplace(const std::string& s, const std::string& oldsub, | |
408 | const std::string& newsub, bool replace_all, | |
409 | std::string* res) { | |
425 | 410 | if (oldsub.empty()) { |
426 | 411 | res->append(s); // if empty, append the given string. |
427 | 412 | return; |
428 | 413 | } |
429 | 414 | |
430 | string::size_type start_pos = 0; | |
431 | string::size_type pos; | |
415 | std::string::size_type start_pos = 0; | |
416 | std::string::size_type pos; | |
432 | 417 | do { |
433 | 418 | pos = s.find(oldsub, start_pos); |
434 | if (pos == string::npos) { | |
419 | if (pos == std::string::npos) { | |
435 | 420 | break; |
436 | 421 | } |
437 | 422 | res->append(s, start_pos, pos - start_pos); |
451 | 436 | // happened or not. |
452 | 437 | // ---------------------------------------------------------------------- |
453 | 438 | |
454 | string StringReplace(const string& s, const string& oldsub, | |
455 | const string& newsub, bool replace_all) { | |
456 | string ret; | |
439 | std::string StringReplace(const std::string& s, const std::string& oldsub, | |
440 | const std::string& newsub, bool replace_all) { | |
441 | std::string ret; | |
457 | 442 | StringReplace(s, oldsub, newsub, replace_all, &ret); |
458 | 443 | return ret; |
459 | 444 | } |
468 | 453 | // ---------------------------------------------------------------------- |
469 | 454 | template <typename ITR> |
470 | 455 | static inline |
471 | void SplitStringToIteratorUsing(const string& full, | |
456 | void SplitStringToIteratorUsing(const std::string& full, | |
472 | 457 | const char* delim, |
473 | 458 | ITR& result) { |
474 | 459 | // Optimize the common case where delim is a single character. |
482 | 467 | } else { |
483 | 468 | const char* start = p; |
484 | 469 | while (++p != end && *p != c); |
485 | *result++ = string(start, p - start); | |
470 | *result++ = std::string(start, p - start); | |
486 | 471 | } |
487 | 472 | } |
488 | 473 | return; |
489 | 474 | } |
490 | 475 | |
491 | string::size_type begin_index, end_index; | |
476 | std::string::size_type begin_index, end_index; | |
492 | 477 | begin_index = full.find_first_not_of(delim); |
493 | while (begin_index != string::npos) { | |
478 | while (begin_index != std::string::npos) { | |
494 | 479 | end_index = full.find_first_of(delim, begin_index); |
495 | if (end_index == string::npos) { | |
480 | if (end_index == std::string::npos) { | |
496 | 481 | *result++ = full.substr(begin_index); |
497 | 482 | return; |
498 | 483 | } |
501 | 486 | } |
502 | 487 | } |
503 | 488 | |
504 | void SplitStringUsing(const string& full, | |
489 | void SplitStringUsing(const std::string& full, | |
505 | 490 | const char* delim, |
506 | std::vector<string>* result) { | |
507 | std::back_insert_iterator< std::vector<string> > it(*result); | |
491 | std::vector<std::string>* result) { | |
492 | std::back_insert_iterator< std::vector<std::string> > it(*result); | |
508 | 493 | SplitStringToIteratorUsing(full, delim, it); |
509 | 494 | } |
510 | 495 | |
557 | 542 | dest[used] = '\0'; // doesn't count towards return value though |
558 | 543 | return used; |
559 | 544 | } |
560 | string CEscape(const string& src) { | |
545 | std::string CEscape(const std::string& src) { | |
561 | 546 | const int dest_length = src.size() * 4 + 1; // Maximum possible expansion |
562 | 547 | std::unique_ptr<char[]> dest(new char[dest_length]); |
563 | 548 | const int len = CEscapeInternal(src.data(), src.size(), |
564 | 549 | dest.get(), dest_length, false); |
565 | 550 | GOOGLE_DCHECK_GE(len, 0); |
566 | return string(dest.get(), len); | |
551 | return std::string(dest.get(), len); | |
567 | 552 | } |
568 | 553 | |
569 | 554 | } // namespace c |
66 | 66 | #include <vector> |
67 | 67 | #include <sstream> |
68 | 68 | #include <google/protobuf/descriptor.h> |
69 | #include <google/protobuf/descriptor.pb.h> | |
69 | #include <protobuf-c/protobuf-c.pb.h> | |
70 | 70 | #include <google/protobuf/io/printer.h> |
71 | 71 | |
72 | 72 | namespace google { |
74 | 74 | namespace compiler { |
75 | 75 | namespace c { |
76 | 76 | |
77 | // Returns the non-nested type name for the given type. If "qualified" is | |
78 | // true, prefix the type with the full namespace. For example, if you had: | |
79 | // package foo.bar; | |
80 | // message Baz { message Qux {} } | |
81 | // Then the qualified ClassName for Qux would be: | |
82 | // Foo__Bar__Baz_Qux | |
83 | // While the non-qualified version would be: | |
84 | // Baz_Qux | |
85 | string ClassName(const Descriptor* descriptor, bool qualified); | |
86 | string ClassName(const EnumDescriptor* enum_descriptor, bool qualified); | |
87 | ||
88 | 77 | // --- Borrowed from stubs. --- |
89 | template <typename T> string SimpleItoa(T n) { | |
78 | template <typename T> std::string SimpleItoa(T n) { | |
90 | 79 | std::stringstream stream; |
91 | 80 | stream << n; |
92 | 81 | return stream.str(); |
93 | 82 | } |
94 | 83 | |
95 | string SimpleFtoa(float f); | |
96 | string SimpleDtoa(double f); | |
97 | void SplitStringUsing(const string &str, const char *delim, std::vector<string> *out); | |
98 | string CEscape(const string& src); | |
99 | string StringReplace(const string& s, const string& oldsub, const string& newsub, bool replace_all); | |
100 | inline bool HasSuffixString(const string& str, const string& suffix) { return str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; } | |
101 | inline string StripSuffixString(const string& str, const string& suffix) { if (HasSuffixString(str, suffix)) { return str.substr(0, str.size() - suffix.size()); } else { return str; } } | |
84 | std::string SimpleFtoa(float f); | |
85 | std::string SimpleDtoa(double f); | |
86 | void SplitStringUsing(const std::string &str, const char *delim, std::vector<std::string> *out); | |
87 | std::string CEscape(const std::string& src); | |
88 | std::string StringReplace(const std::string& s, const std::string& oldsub, const std::string& newsub, bool replace_all); | |
89 | inline bool HasSuffixString(const std::string& str, const std::string& suffix) { return str.size() >= suffix.size() && str.compare(str.size() - suffix.size(), suffix.size(), suffix) == 0; } | |
90 | inline std::string StripSuffixString(const std::string& str, const std::string& suffix) { if (HasSuffixString(str, suffix)) { return str.substr(0, str.size() - suffix.size()); } else { return str; } } | |
102 | 91 | char* FastHexToBuffer(int i, char* buffer); |
103 | 92 | |
104 | 93 | |
106 | 95 | // The name is coerced to lower-case to emulate proto1 behavior. People |
107 | 96 | // should be using lowercase-with-underscores style for proto field names |
108 | 97 | // anyway, so normally this just returns field->name(). |
109 | string FieldName(const FieldDescriptor* field); | |
98 | std::string FieldName(const FieldDescriptor* field); | |
110 | 99 | |
111 | 100 | // Get macro string for deprecated field |
112 | string FieldDeprecated(const FieldDescriptor* field); | |
101 | std::string FieldDeprecated(const FieldDescriptor* field); | |
113 | 102 | |
114 | 103 | // Returns the scope where the field was defined (for extensions, this is |
115 | 104 | // different from the message type to which the field applies). |
120 | 109 | |
121 | 110 | // convert a CamelCase class name into an all uppercase affair |
122 | 111 | // with underscores separating words, e.g. MyClass becomes MY_CLASS. |
123 | string CamelToUpper(const string &class_name); | |
124 | string CamelToLower(const string &class_name); | |
112 | std::string CamelToUpper(const std::string &class_name); | |
113 | std::string CamelToLower(const std::string &class_name); | |
125 | 114 | |
126 | 115 | // lowercased, underscored name to camel case |
127 | string ToCamel(const string &name); | |
116 | std::string ToCamel(const std::string &name); | |
128 | 117 | |
129 | 118 | // lowercase the string |
130 | string ToLower(const string &class_name); | |
131 | string ToUpper(const string &class_name); | |
119 | std::string ToLower(const std::string &class_name); | |
120 | std::string ToUpper(const std::string &class_name); | |
132 | 121 | |
133 | 122 | // full_name() to lowercase with underscores |
134 | string FullNameToLower(const string &full_name); | |
135 | string FullNameToUpper(const string &full_name); | |
123 | std::string FullNameToLower(const std::string &full_name, const FileDescriptor *file); | |
124 | std::string FullNameToUpper(const std::string &full_name, const FileDescriptor *file); | |
136 | 125 | |
137 | 126 | // full_name() to c-typename (with underscores for packages, otherwise camel case) |
138 | string FullNameToC(const string &class_name); | |
127 | std::string FullNameToC(const std::string &class_name, const FileDescriptor *file); | |
139 | 128 | |
140 | 129 | // Splits, indents, formats, and prints comment lines |
141 | void PrintComment (io::Printer* printer, string comment); | |
130 | void PrintComment (io::Printer* printer, std::string comment); | |
142 | 131 | |
143 | 132 | // make a string of spaces as long as input |
144 | string ConvertToSpaces(const string &input); | |
133 | std::string ConvertToSpaces(const std::string &input); | |
145 | 134 | |
146 | 135 | // Strips ".proto" or ".protodevel" from the end of a filename. |
147 | string StripProto(const string& filename); | |
136 | std::string StripProto(const std::string& filename); | |
148 | 137 | |
149 | 138 | // Get the C++ type name for a primitive type (e.g. "double", "::google::protobuf::int32", etc.). |
150 | 139 | // Note: non-built-in type names will be qualified, meaning they will start |
158 | 147 | const char* DeclaredTypeMethodName(FieldDescriptor::Type type); |
159 | 148 | |
160 | 149 | // Convert a file name into a valid identifier. |
161 | string FilenameIdentifier(const string& filename); | |
150 | std::string FilenameIdentifier(const std::string& filename); | |
162 | 151 | |
163 | 152 | // Return the name of the BuildDescriptors() function for a given file. |
164 | string GlobalBuildDescriptorsName(const string& filename); | |
153 | std::string GlobalBuildDescriptorsName(const std::string& filename); | |
165 | 154 | |
166 | 155 | // return 'required', 'optional', or 'repeated' |
167 | string GetLabelName(FieldDescriptor::Label label); | |
156 | std::string GetLabelName(FieldDescriptor::Label label); | |
168 | 157 | |
169 | 158 | |
170 | 159 | // write IntRanges entries for a bunch of sorted values. |
171 | 160 | // returns the number of ranges there are to bsearch. |
172 | unsigned WriteIntRanges(io::Printer* printer, int n_values, const int *values, const string &name); | |
161 | unsigned WriteIntRanges(io::Printer* printer, int n_values, const int *values, const std::string &name); | |
173 | 162 | |
174 | 163 | struct NameIndex |
175 | 164 | { |
69 | 69 | #include <google/protobuf/io/printer.h> |
70 | 70 | #include <google/protobuf/io/coded_stream.h> |
71 | 71 | #include <google/protobuf/wire_format.h> |
72 | #include <google/protobuf/descriptor.pb.h> | |
72 | #include <protobuf-c/protobuf-c.pb.h> | |
73 | 73 | |
74 | 74 | namespace google { |
75 | 75 | namespace protobuf { |
79 | 79 | // =================================================================== |
80 | 80 | |
81 | 81 | MessageGenerator::MessageGenerator(const Descriptor* descriptor, |
82 | const string& dllexport_decl) | |
82 | const std::string& dllexport_decl) | |
83 | 83 | : descriptor_(descriptor), |
84 | 84 | dllexport_decl_(dllexport_decl), |
85 | 85 | field_generators_(descriptor), |
110 | 110 | |
111 | 111 | void MessageGenerator:: |
112 | 112 | GenerateStructTypedef(io::Printer* printer) { |
113 | printer->Print("typedef struct _$classname$ $classname$;\n", | |
114 | "classname", FullNameToC(descriptor_->full_name())); | |
113 | printer->Print("typedef struct $classname$ $classname$;\n", | |
114 | "classname", FullNameToC(descriptor_->full_name(), descriptor_->file())); | |
115 | 115 | |
116 | 116 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
117 | 117 | nested_generators_[i]->GenerateStructTypedef(printer); |
136 | 136 | nested_generators_[i]->GenerateStructDefinition(printer); |
137 | 137 | } |
138 | 138 | |
139 | std::map<string, string> vars; | |
140 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
141 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
142 | vars["ucclassname"] = FullNameToUpper(descriptor_->full_name()); | |
139 | std::map<std::string, std::string> vars; | |
140 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
141 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
142 | vars["ucclassname"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()); | |
143 | 143 | vars["field_count"] = SimpleItoa(descriptor_->field_count()); |
144 | 144 | if (dllexport_decl_.empty()) { |
145 | 145 | vars["dllexport"] = ""; |
152 | 152 | const OneofDescriptor *oneof = descriptor_->oneof_decl(i); |
153 | 153 | vars["opt_comma"] = ","; |
154 | 154 | |
155 | vars["oneofname"] = FullNameToUpper(oneof->name()); | |
156 | vars["foneofname"] = FullNameToC(oneof->full_name()); | |
155 | vars["oneofname"] = CamelToUpper(oneof->name()); | |
156 | vars["foneofname"] = FullNameToC(oneof->full_name(), oneof->file()); | |
157 | 157 | |
158 | 158 | printer->Print("typedef enum {\n"); |
159 | 159 | printer->Indent(); |
160 | 160 | printer->Print(vars, "$ucclassname$__$oneofname$__NOT_SET = 0,\n"); |
161 | 161 | for (int j = 0; j < oneof->field_count(); j++) { |
162 | 162 | const FieldDescriptor *field = oneof->field(j); |
163 | vars["fieldname"] = FullNameToUpper(field->name()); | |
163 | vars["fieldname"] = CamelToUpper(field->name()); | |
164 | 164 | vars["fieldnum"] = SimpleItoa(field->number()); |
165 | 165 | bool isLast = j == oneof->field_count() - 1; |
166 | 166 | if (isLast) { |
168 | 168 | } |
169 | 169 | printer->Print(vars, "$ucclassname$__$oneofname$_$fieldname$ = $fieldnum$$opt_comma$\n"); |
170 | 170 | } |
171 | printer->Print(vars, " PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE($ucclassname$__$oneofname$)\n"); | |
171 | printer->Print(vars, " PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE($ucclassname$__$oneofname$__CASE)\n"); | |
172 | 172 | printer->Outdent(); |
173 | 173 | printer->Print(vars, "} $foneofname$Case;\n\n"); |
174 | 174 | } |
177 | 177 | descriptor_->GetSourceLocation(&msgSourceLoc); |
178 | 178 | PrintComment (printer, msgSourceLoc.leading_comments); |
179 | 179 | |
180 | printer->Print(vars, | |
181 | "struct $dllexport$ _$classname$\n" | |
180 | const ProtobufCMessageOptions opt = | |
181 | descriptor_->options().GetExtension(pb_c_msg); | |
182 | vars["base"] = opt.base_field_name(); | |
183 | ||
184 | printer->Print(vars, | |
185 | "struct $dllexport$ $classname$\n" | |
182 | 186 | "{\n" |
183 | " ProtobufCMessage base;\n"); | |
187 | " ProtobufCMessage $base$;\n"); | |
184 | 188 | |
185 | 189 | // Generate fields. |
186 | 190 | printer->Indent(); |
199 | 203 | // Generate unions from oneofs. |
200 | 204 | for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { |
201 | 205 | const OneofDescriptor *oneof = descriptor_->oneof_decl(i); |
202 | vars["oneofname"] = FullNameToLower(oneof->name()); | |
203 | vars["foneofname"] = FullNameToC(oneof->full_name()); | |
206 | vars["oneofname"] = CamelToLower(oneof->name()); | |
207 | vars["foneofname"] = FullNameToC(oneof->full_name(), oneof->file()); | |
204 | 208 | |
205 | 209 | printer->Print(vars, "$foneofname$Case $oneofname$_case;\n"); |
206 | 210 | |
240 | 244 | } |
241 | 245 | for (int i = 0; i < descriptor_->oneof_decl_count(); i++) { |
242 | 246 | const OneofDescriptor *oneof = descriptor_->oneof_decl(i); |
243 | vars["foneofname"] = FullNameToUpper(oneof->full_name()); | |
247 | vars["foneofname"] = FullNameToUpper(oneof->full_name(), oneof->file()); | |
244 | 248 | // Initialize the case enum |
245 | 249 | printer->Print(vars, ", $foneofname$__NOT_SET"); |
246 | 250 | // Initialize the union |
251 | 255 | } |
252 | 256 | |
253 | 257 | void MessageGenerator:: |
254 | GenerateHelperFunctionDeclarations(io::Printer* printer, bool is_submessage) | |
258 | GenerateHelperFunctionDeclarations(io::Printer* printer, | |
259 | bool is_pack_deep, | |
260 | bool gen_pack, | |
261 | bool gen_init) | |
255 | 262 | { |
263 | const ProtobufCMessageOptions opt = | |
264 | descriptor_->options().GetExtension(pb_c_msg); | |
265 | ||
266 | // Override parent settings, if needed | |
267 | if (opt.has_gen_pack_helpers()) | |
268 | gen_pack = opt.gen_pack_helpers(); | |
269 | if (opt.has_gen_init_helpers()) | |
270 | gen_init = opt.gen_init_helpers(); | |
271 | ||
256 | 272 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
257 | nested_generators_[i]->GenerateHelperFunctionDeclarations(printer, true); | |
258 | } | |
259 | ||
260 | std::map<string, string> vars; | |
261 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
262 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
263 | printer->Print(vars, | |
273 | bool nested_pack = !is_pack_deep ? opt.gen_pack_helpers() : gen_pack; | |
274 | nested_generators_[i]->GenerateHelperFunctionDeclarations(printer, true, | |
275 | nested_pack, | |
276 | gen_init); | |
277 | } | |
278 | ||
279 | std::map<std::string, std::string> vars; | |
280 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
281 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
282 | if (gen_init) { | |
283 | printer->Print(vars, | |
264 | 284 | "/* $classname$ methods */\n" |
265 | 285 | "void $lcclassname$__init\n" |
266 | 286 | " ($classname$ *message);\n" |
267 | 287 | ); |
268 | if (!is_submessage) { | |
288 | } | |
289 | if (gen_pack) { | |
269 | 290 | printer->Print(vars, |
270 | 291 | "size_t $lcclassname$__get_packed_size\n" |
271 | 292 | " (const $classname$ *message);\n" |
290 | 311 | void MessageGenerator:: |
291 | 312 | GenerateDescriptorDeclarations(io::Printer* printer) { |
292 | 313 | printer->Print("extern const ProtobufCMessageDescriptor $name$__descriptor;\n", |
293 | "name", FullNameToLower(descriptor_->full_name())); | |
314 | "name", FullNameToLower(descriptor_->full_name(), descriptor_->file())); | |
294 | 315 | |
295 | 316 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
296 | 317 | nested_generators_[i]->GenerateDescriptorDeclarations(printer); |
305 | 326 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
306 | 327 | nested_generators_[i]->GenerateClosureTypedef(printer); |
307 | 328 | } |
308 | std::map<string, string> vars; | |
309 | vars["name"] = FullNameToC(descriptor_->full_name()); | |
329 | std::map<std::string, std::string> vars; | |
330 | vars["name"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
310 | 331 | printer->Print(vars, |
311 | 332 | "typedef void (*$name$_Closure)\n" |
312 | 333 | " (const $name$ *message,\n" |
324 | 345 | } |
325 | 346 | |
326 | 347 | void MessageGenerator:: |
327 | GenerateHelperFunctionDefinitions(io::Printer* printer, bool is_submessage) | |
348 | GenerateHelperFunctionDefinitions(io::Printer* printer, | |
349 | bool is_pack_deep, | |
350 | bool gen_pack, | |
351 | bool gen_init) | |
328 | 352 | { |
353 | const ProtobufCMessageOptions opt = | |
354 | descriptor_->options().GetExtension(pb_c_msg); | |
355 | ||
356 | // Override parent settings, if needed | |
357 | if (opt.has_gen_pack_helpers()) | |
358 | gen_pack = opt.gen_pack_helpers(); | |
359 | if (opt.has_gen_init_helpers()) | |
360 | gen_init = opt.gen_init_helpers(); | |
361 | ||
329 | 362 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
330 | nested_generators_[i]->GenerateHelperFunctionDefinitions(printer, true); | |
331 | } | |
332 | ||
333 | std::map<string, string> vars; | |
334 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
335 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
336 | vars["ucclassname"] = FullNameToUpper(descriptor_->full_name()); | |
337 | printer->Print(vars, | |
363 | bool nested_pack = !is_pack_deep ? opt.gen_pack_helpers() : gen_pack; | |
364 | nested_generators_[i]->GenerateHelperFunctionDefinitions(printer, true, | |
365 | nested_pack, | |
366 | gen_init); | |
367 | } | |
368 | ||
369 | std::map<std::string, std::string> vars; | |
370 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
371 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
372 | vars["ucclassname"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()); | |
373 | vars["base"] = opt.base_field_name(); | |
374 | if (gen_init) { | |
375 | printer->Print(vars, | |
338 | 376 | "void $lcclassname$__init\n" |
339 | 377 | " ($classname$ *message)\n" |
340 | 378 | "{\n" |
341 | 379 | " static const $classname$ init_value = $ucclassname$__INIT;\n" |
342 | 380 | " *message = init_value;\n" |
343 | 381 | "}\n"); |
344 | if (!is_submessage) { | |
382 | } | |
383 | if (gen_pack) { | |
345 | 384 | printer->Print(vars, |
346 | 385 | "size_t $lcclassname$__get_packed_size\n" |
347 | 386 | " (const $classname$ *message)\n" |
348 | 387 | "{\n" |
349 | " assert(message->base.descriptor == &$lcclassname$__descriptor);\n" | |
388 | " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n" | |
350 | 389 | " return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));\n" |
351 | 390 | "}\n" |
352 | 391 | "size_t $lcclassname$__pack\n" |
353 | 392 | " (const $classname$ *message,\n" |
354 | 393 | " uint8_t *out)\n" |
355 | 394 | "{\n" |
356 | " assert(message->base.descriptor == &$lcclassname$__descriptor);\n" | |
395 | " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n" | |
357 | 396 | " return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);\n" |
358 | 397 | "}\n" |
359 | 398 | "size_t $lcclassname$__pack_to_buffer\n" |
360 | 399 | " (const $classname$ *message,\n" |
361 | 400 | " ProtobufCBuffer *buffer)\n" |
362 | 401 | "{\n" |
363 | " assert(message->base.descriptor == &$lcclassname$__descriptor);\n" | |
402 | " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n" | |
364 | 403 | " return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);\n" |
365 | 404 | "}\n" |
366 | 405 | "$classname$ *\n" |
379 | 418 | "{\n" |
380 | 419 | " if(!message)\n" |
381 | 420 | " return;\n" |
382 | " assert(message->base.descriptor == &$lcclassname$__descriptor);\n" | |
421 | " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n" | |
383 | 422 | " protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);\n" |
384 | 423 | "}\n" |
385 | 424 | ); |
387 | 426 | } |
388 | 427 | |
389 | 428 | void MessageGenerator:: |
390 | GenerateMessageDescriptor(io::Printer* printer) { | |
391 | std::map<string, string> vars; | |
429 | GenerateMessageDescriptor(io::Printer* printer, bool gen_init) { | |
430 | std::map<std::string, std::string> vars; | |
392 | 431 | vars["fullname"] = descriptor_->full_name(); |
393 | vars["classname"] = FullNameToC(descriptor_->full_name()); | |
394 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name()); | |
432 | vars["classname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
433 | vars["lcclassname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
395 | 434 | vars["shortname"] = ToCamel(descriptor_->name()); |
396 | 435 | vars["n_fields"] = SimpleItoa(descriptor_->field_count()); |
397 | 436 | vars["packagename"] = descriptor_->file()->package(); |
400 | 439 | descriptor_->file()->options().optimize_for() == |
401 | 440 | FileOptions_OptimizeMode_CODE_SIZE; |
402 | 441 | |
442 | const ProtobufCMessageOptions opt = | |
443 | descriptor_->options().GetExtension(pb_c_msg); | |
444 | // Override parent settings, if needed | |
445 | if (opt.has_gen_init_helpers()) | |
446 | gen_init = opt.gen_init_helpers(); | |
447 | ||
403 | 448 | for (int i = 0; i < descriptor_->nested_type_count(); i++) { |
404 | nested_generators_[i]->GenerateMessageDescriptor(printer); | |
449 | nested_generators_[i]->GenerateMessageDescriptor(printer, gen_init); | |
405 | 450 | } |
406 | 451 | |
407 | 452 | for (int i = 0; i < descriptor_->enum_type_count(); i++) { |
417 | 462 | |
418 | 463 | for (int i = 0; i < descriptor_->field_count(); i++) { |
419 | 464 | const FieldDescriptor *fd = descriptor_->field(i); |
465 | const ProtobufCFieldOptions opt = fd->options().GetExtension(pb_c_field); | |
420 | 466 | if (fd->has_default_value()) { |
421 | 467 | |
422 | 468 | bool already_defined = false; |
455 | 501 | GOOGLE_LOG(DFATAL) << "Messages can't have default values!"; |
456 | 502 | break; |
457 | 503 | case FieldDescriptor::CPPTYPE_STRING: |
458 | if (fd->type() == FieldDescriptor::TYPE_BYTES) | |
504 | if (fd->type() == FieldDescriptor::TYPE_BYTES || opt.string_as_bytes()) | |
459 | 505 | { |
460 | 506 | vars["field_dv_ctype"] = "ProtobufCBinaryData"; |
461 | 507 | } |
470 | 516 | case FieldDescriptor::CPPTYPE_ENUM: |
471 | 517 | { |
472 | 518 | const EnumValueDescriptor *vd = fd->default_value_enum(); |
473 | vars["field_dv_ctype"] = FullNameToC(vd->type()->full_name()); | |
519 | vars["field_dv_ctype"] = FullNameToC(vd->type()->full_name(), vd->type()->file()); | |
474 | 520 | break; |
475 | 521 | } |
476 | 522 | default: |
567 | 613 | } |
568 | 614 | printer->Print(vars, |
569 | 615 | " $n_ranges$," |
570 | " $lcclassname$__number_ranges,\n" | |
571 | " (ProtobufCMessageInit) $lcclassname$__init,\n" | |
616 | " $lcclassname$__number_ranges,\n"); | |
617 | if (gen_init) { | |
618 | printer->Print(vars, | |
619 | " (ProtobufCMessageInit) $lcclassname$__init,\n"); | |
620 | } else { | |
621 | printer->Print(vars, | |
622 | " NULL, /* gen_init_helpers = false */\n"); | |
623 | } | |
624 | printer->Print(vars, | |
572 | 625 | " NULL,NULL,NULL /* reserved[123] */\n" |
573 | 626 | "};\n"); |
574 | 627 | } |
85 | 85 | public: |
86 | 86 | // See generator.cc for the meaning of dllexport_decl. |
87 | 87 | explicit MessageGenerator(const Descriptor* descriptor, |
88 | const string& dllexport_decl); | |
88 | const std::string& dllexport_decl); | |
89 | 89 | ~MessageGenerator(); |
90 | 90 | |
91 | 91 | // Header stuff. |
110 | 110 | void GenerateStructStaticInitMacro(io::Printer* printer); |
111 | 111 | |
112 | 112 | // Generate standard helper functions declarations for this message. |
113 | void GenerateHelperFunctionDeclarations(io::Printer* printer, bool is_submessage); | |
113 | void GenerateHelperFunctionDeclarations(io::Printer* printer, | |
114 | bool is_pack_deep, | |
115 | bool gen_pack, | |
116 | bool gen_init); | |
114 | 117 | |
115 | 118 | // Source file stuff. |
116 | 119 | |
117 | 120 | // Generate code that initializes the global variable storing the message's |
118 | 121 | // descriptor. |
119 | void GenerateMessageDescriptor(io::Printer* printer); | |
120 | void GenerateHelperFunctionDefinitions(io::Printer* printer, bool is_submessage); | |
122 | void GenerateMessageDescriptor(io::Printer* printer, bool gen_init); | |
123 | void GenerateHelperFunctionDefinitions(io::Printer* printer, | |
124 | bool is_pack_deep, | |
125 | bool gen_pack, | |
126 | bool gen_init); | |
121 | 127 | |
122 | 128 | private: |
123 | 129 | |
124 | string GetDefaultValueC(const FieldDescriptor *fd); | |
130 | std::string GetDefaultValueC(const FieldDescriptor *fd); | |
125 | 131 | |
126 | 132 | const Descriptor* descriptor_; |
127 | string dllexport_decl_; | |
133 | std::string dllexport_decl_; | |
128 | 134 | FieldGeneratorMap field_generators_; |
129 | 135 | std::unique_ptr<std::unique_ptr<MessageGenerator>[]> nested_generators_; |
130 | 136 | std::unique_ptr<std::unique_ptr<EnumGenerator>[]> enum_generators_; |
82 | 82 | |
83 | 83 | void MessageFieldGenerator::GenerateStructMembers(io::Printer* printer) const |
84 | 84 | { |
85 | std::map<string, string> vars; | |
85 | std::map<std::string, std::string> vars; | |
86 | 86 | vars["name"] = FieldName(descriptor_); |
87 | vars["type"] = FullNameToC(descriptor_->message_type()->full_name()); | |
87 | vars["type"] = FullNameToC(descriptor_->message_type()->full_name(), descriptor_->message_type()->file()); | |
88 | 88 | vars["deprecated"] = FieldDeprecated(descriptor_); |
89 | 89 | switch (descriptor_->label()) { |
90 | 90 | case FieldDescriptor::LABEL_REQUIRED: |
97 | 97 | break; |
98 | 98 | } |
99 | 99 | } |
100 | string MessageFieldGenerator::GetDefaultValue(void) const | |
100 | std::string MessageFieldGenerator::GetDefaultValue(void) const | |
101 | 101 | { |
102 | 102 | /* XXX: update when protobuf gets support |
103 | 103 | * for default-values of message fields. |
118 | 118 | } |
119 | 119 | void MessageFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const |
120 | 120 | { |
121 | string addr = "&" + FullNameToLower(descriptor_->message_type()->full_name()) + "__descriptor"; | |
121 | std::string addr = "&" + FullNameToLower(descriptor_->message_type()->full_name(), descriptor_->message_type()->file()) + "__descriptor"; | |
122 | 122 | GenerateDescriptorInitializerGeneric(printer, false, "MESSAGE", addr); |
123 | 123 | } |
124 | 124 |
79 | 79 | // implements FieldGenerator --------------------------------------- |
80 | 80 | void GenerateStructMembers(io::Printer* printer) const; |
81 | 81 | void GenerateDescriptorInitializer(io::Printer* printer) const; |
82 | string GetDefaultValue(void) const; | |
82 | std::string GetDefaultValue(void) const; | |
83 | 83 | void GenerateStaticInit(io::Printer* printer) const; |
84 | 84 | |
85 | 85 | private: |
78 | 78 | |
79 | 79 | void PrimitiveFieldGenerator::GenerateStructMembers(io::Printer* printer) const |
80 | 80 | { |
81 | string c_type; | |
82 | std::map<string, string> vars; | |
81 | std::string c_type; | |
82 | std::map<std::string, std::string> vars; | |
83 | 83 | switch (descriptor_->type()) { |
84 | 84 | case FieldDescriptor::TYPE_SINT32 : |
85 | 85 | case FieldDescriptor::TYPE_SFIXED32: |
122 | 122 | break; |
123 | 123 | } |
124 | 124 | } |
125 | string PrimitiveFieldGenerator::GetDefaultValue() const | |
125 | std::string PrimitiveFieldGenerator::GetDefaultValue() const | |
126 | 126 | { |
127 | 127 | /* XXX: SimpleItoa seems woefully inadequate for anything but int32, |
128 | 128 | * but that's what protobuf uses. */ |
148 | 148 | } |
149 | 149 | void PrimitiveFieldGenerator::GenerateStaticInit(io::Printer* printer) const |
150 | 150 | { |
151 | std::map<string, string> vars; | |
151 | std::map<std::string, std::string> vars; | |
152 | 152 | if (descriptor_->has_default_value()) { |
153 | 153 | vars["default_value"] = GetDefaultValue(); |
154 | 154 | } else { |
171 | 171 | |
172 | 172 | void PrimitiveFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const |
173 | 173 | { |
174 | string c_type_macro; | |
174 | std::string c_type_macro; | |
175 | 175 | switch (descriptor_->type()) { |
176 | 176 | #define WRITE_CASE(shortname) case FieldDescriptor::TYPE_##shortname: c_type_macro = #shortname; break; |
177 | 177 | WRITE_CASE(INT32) |
79 | 79 | // implements FieldGenerator --------------------------------------- |
80 | 80 | void GenerateStructMembers(io::Printer* printer) const; |
81 | 81 | void GenerateDescriptorInitializer(io::Printer* printer) const; |
82 | string GetDefaultValue(void) const; | |
82 | std::string GetDefaultValue(void) const; | |
83 | 83 | void GenerateStaticInit(io::Printer* printer) const; |
84 | 84 | |
85 | 85 | private: |
69 | 69 | namespace c { |
70 | 70 | |
71 | 71 | ServiceGenerator::ServiceGenerator(const ServiceDescriptor* descriptor, |
72 | const string& dllexport_decl) | |
72 | const std::string& dllexport_decl) | |
73 | 73 | : descriptor_(descriptor) { |
74 | 74 | vars_["name"] = descriptor_->name(); |
75 | 75 | vars_["fullname"] = descriptor_->full_name(); |
76 | vars_["cname"] = FullNameToC(descriptor_->full_name()); | |
77 | vars_["lcfullname"] = FullNameToLower(descriptor_->full_name()); | |
78 | vars_["ucfullname"] = FullNameToUpper(descriptor_->full_name()); | |
76 | vars_["cname"] = FullNameToC(descriptor_->full_name(), descriptor_->file()); | |
77 | vars_["lcfullname"] = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
78 | vars_["ucfullname"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()); | |
79 | 79 | vars_["lcfullpadd"] = ConvertToSpaces(vars_["lcfullname"]); |
80 | 80 | vars_["package"] = descriptor_->file()->package(); |
81 | 81 | if (dllexport_decl.empty()) { |
97 | 97 | void ServiceGenerator::GenerateVfuncs(io::Printer* printer) |
98 | 98 | { |
99 | 99 | printer->Print(vars_, |
100 | "typedef struct _$cname$_Service $cname$_Service;\n" | |
101 | "struct _$cname$_Service\n" | |
100 | "typedef struct $cname$_Service $cname$_Service;\n" | |
101 | "struct $cname$_Service\n" | |
102 | 102 | "{\n" |
103 | 103 | " ProtobufCService base;\n"); |
104 | 104 | for (int i = 0; i < descriptor_->method_count(); i++) { |
105 | 105 | const MethodDescriptor *method = descriptor_->method(i); |
106 | string lcname = CamelToLower(method->name()); | |
107 | vars_["method"] = lcname; | |
108 | vars_["metpad"] = ConvertToSpaces(lcname); | |
109 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name()); | |
110 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name()); | |
106 | std::string lcname = CamelToLower(method->name()); | |
107 | vars_["method"] = lcname; | |
108 | vars_["metpad"] = ConvertToSpaces(lcname); | |
109 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name(), method->input_type()->file()); | |
110 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name(), method->output_type()->file()); | |
111 | 111 | printer->Print(vars_, |
112 | 112 | " void (*$method$)($cname$_Service *service,\n" |
113 | 113 | " $metpad$ const $input_typename$ *input,\n" |
130 | 130 | " { $ucfullname$__BASE_INIT"); |
131 | 131 | for (int i = 0; i < descriptor_->method_count(); i++) { |
132 | 132 | const MethodDescriptor *method = descriptor_->method(i); |
133 | string lcname = CamelToLower(method->name()); | |
133 | std::string lcname = CamelToLower(method->name()); | |
134 | 134 | vars_["method"] = lcname; |
135 | 135 | vars_["metpad"] = ConvertToSpaces(lcname); |
136 | 136 | printer->Print(vars_, |
143 | 143 | { |
144 | 144 | for (int i = 0; i < descriptor_->method_count(); i++) { |
145 | 145 | const MethodDescriptor *method = descriptor_->method(i); |
146 | string lcname = CamelToLower(method->name()); | |
147 | string lcfullname = FullNameToLower(descriptor_->full_name()); | |
148 | vars_["method"] = lcname; | |
149 | vars_["metpad"] = ConvertToSpaces(lcname); | |
150 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name()); | |
151 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name()); | |
146 | std::string lcname = CamelToLower(method->name()); | |
147 | std::string lcfullname = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
148 | vars_["method"] = lcname; | |
149 | vars_["metpad"] = ConvertToSpaces(lcname); | |
150 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name(), method->input_type()->file()); | |
151 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name(), method->output_type()->file()); | |
152 | 152 | vars_["padddddddddddddddddd"] = ConvertToSpaces(lcfullname + "__" + lcname); |
153 | 153 | printer->Print(vars_, |
154 | 154 | "void $lcfullname$__$method$(ProtobufCService *service,\n" |
207 | 207 | for (int i = 0; i < n_methods; i++) { |
208 | 208 | const MethodDescriptor *method = descriptor_->method(i); |
209 | 209 | vars_["method"] = method->name(); |
210 | vars_["input_descriptor"] = "&" + FullNameToLower(method->input_type()->full_name()) + "__descriptor"; | |
211 | vars_["output_descriptor"] = "&" + FullNameToLower(method->output_type()->full_name()) + "__descriptor"; | |
210 | vars_["input_descriptor"] = "&" + FullNameToLower(method->input_type()->full_name(), method->input_type()->file()) + "__descriptor"; | |
211 | vars_["output_descriptor"] = "&" + FullNameToLower(method->output_type()->full_name(), method->output_type()->file()) + "__descriptor"; | |
212 | 212 | if (optimize_code_size) { |
213 | 213 | printer->Print(vars_, |
214 | 214 | " { NULL, $input_descriptor$, $output_descriptor$ }, /* CODE_SIZE */\n"); |
265 | 265 | { |
266 | 266 | for (int i = 0; i < descriptor_->method_count(); i++) { |
267 | 267 | const MethodDescriptor *method = descriptor_->method(i); |
268 | string lcname = CamelToLower(method->name()); | |
269 | string lcfullname = FullNameToLower(descriptor_->full_name()); | |
270 | vars_["method"] = lcname; | |
271 | vars_["metpad"] = ConvertToSpaces(lcname); | |
272 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name()); | |
273 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name()); | |
268 | std::string lcname = CamelToLower(method->name()); | |
269 | std::string lcfullname = FullNameToLower(descriptor_->full_name(), descriptor_->file()); | |
270 | vars_["method"] = lcname; | |
271 | vars_["metpad"] = ConvertToSpaces(lcname); | |
272 | vars_["input_typename"] = FullNameToC(method->input_type()->full_name(), method->input_type()->file()); | |
273 | vars_["output_typename"] = FullNameToC(method->output_type()->full_name(), method->output_type()->file()); | |
274 | 274 | vars_["padddddddddddddddddd"] = ConvertToSpaces(lcfullname + "__" + lcname); |
275 | 275 | vars_["index"] = SimpleItoa(i); |
276 | 276 |
81 | 81 | public: |
82 | 82 | // See generator.cc for the meaning of dllexport_decl. |
83 | 83 | explicit ServiceGenerator(const ServiceDescriptor* descriptor, |
84 | const string& dllexport_decl); | |
84 | const std::string& dllexport_decl); | |
85 | 85 | ~ServiceGenerator(); |
86 | 86 | |
87 | 87 | // Header stuff. |
98 | 98 | void GenerateCallersImplementations(io::Printer* printer); |
99 | 99 | |
100 | 100 | const ServiceDescriptor* descriptor_; |
101 | std::map<string, string> vars_; | |
101 | std::map<std::string, std::string> vars_; | |
102 | 102 | |
103 | 103 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator); |
104 | 104 | }; |
63 | 63 | #include <protoc-c/c_helpers.h> |
64 | 64 | #include <google/protobuf/io/printer.h> |
65 | 65 | #include <google/protobuf/wire_format.h> |
66 | #include <google/protobuf/descriptor.pb.h> | |
66 | #include <protobuf-c/protobuf-c.pb.h> | |
67 | 67 | |
68 | 68 | namespace google { |
69 | 69 | namespace protobuf { |
73 | 73 | using internal::WireFormat; |
74 | 74 | |
75 | 75 | void SetStringVariables(const FieldDescriptor* descriptor, |
76 | std::map<string, string>* variables) { | |
76 | std::map<std::string, std::string>* variables) { | |
77 | 77 | (*variables)["name"] = FieldName(descriptor); |
78 | (*variables)["default"] = FullNameToLower(descriptor->full_name()) | |
78 | (*variables)["default"] = FullNameToLower(descriptor->full_name(), descriptor->file()) | |
79 | 79 | + "__default_value"; |
80 | 80 | (*variables)["deprecated"] = FieldDeprecated(descriptor); |
81 | 81 | } |
92 | 92 | |
93 | 93 | void StringFieldGenerator::GenerateStructMembers(io::Printer* printer) const |
94 | 94 | { |
95 | const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file); | |
96 | ||
95 | 97 | switch (descriptor_->label()) { |
96 | 98 | case FieldDescriptor::LABEL_REQUIRED: |
97 | 99 | case FieldDescriptor::LABEL_OPTIONAL: |
100 | if (opt.const_strings()) | |
101 | printer->Print(variables_, "const "); | |
98 | 102 | printer->Print(variables_, "char *$name$$deprecated$;\n"); |
99 | 103 | break; |
100 | 104 | case FieldDescriptor::LABEL_REPEATED: |
101 | 105 | printer->Print(variables_, "size_t n_$name$$deprecated$;\n"); |
106 | if (opt.const_strings()) | |
107 | printer->Print(variables_, "const "); | |
102 | 108 | printer->Print(variables_, "char **$name$$deprecated$;\n"); |
103 | 109 | break; |
104 | 110 | } |
109 | 115 | } |
110 | 116 | void StringFieldGenerator::GenerateDefaultValueImplementations(io::Printer* printer) const |
111 | 117 | { |
112 | std::map<string, string> vars; | |
118 | std::map<std::string, std::string> vars; | |
113 | 119 | vars["default"] = variables_.find("default")->second; |
114 | 120 | vars["escaped"] = CEscape(descriptor_->default_value_string()); |
115 | 121 | printer->Print(vars, "char $default$[] = \"$escaped$\";\n"); |
116 | 122 | } |
117 | 123 | |
118 | string StringFieldGenerator::GetDefaultValue(void) const | |
124 | std::string StringFieldGenerator::GetDefaultValue(void) const | |
119 | 125 | { |
120 | 126 | return variables_.find("default")->second; |
121 | 127 | } |
122 | 128 | void StringFieldGenerator::GenerateStaticInit(io::Printer* printer) const |
123 | 129 | { |
124 | std::map<string, string> vars; | |
130 | std::map<std::string, std::string> vars; | |
131 | const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file); | |
125 | 132 | if (descriptor_->has_default_value()) { |
126 | 133 | vars["default"] = GetDefaultValue(); |
127 | 134 | } else if (FieldSyntax(descriptor_) == 2) { |
128 | 135 | vars["default"] = "NULL"; |
136 | } else if (opt.const_strings()) { | |
137 | vars["default"] = "(const char *)protobuf_c_empty_string"; | |
129 | 138 | } else { |
130 | 139 | vars["default"] = "(char *)protobuf_c_empty_string"; |
131 | 140 | } |
81 | 81 | void GenerateDescriptorInitializer(io::Printer* printer) const; |
82 | 82 | void GenerateDefaultValueDeclarations(io::Printer* printer) const; |
83 | 83 | void GenerateDefaultValueImplementations(io::Printer* printer) const; |
84 | string GetDefaultValue(void) const; | |
84 | std::string GetDefaultValue(void) const; | |
85 | 85 | void GenerateStaticInit(io::Printer* printer) const; |
86 | 86 | |
87 | 87 | private: |
88 | std::map<string, string> variables_; | |
88 | std::map<std::string, std::string> variables_; | |
89 | 89 | |
90 | 90 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator); |
91 | 91 | }; |
55 | 55 | T(0), T(2097152), T(268435455), T(127), T(16383), T(16384) }; |
56 | 56 | #undef T |
57 | 57 | |
58 | char *repeated_strings_0[] = { (char*)"onestring" }; | |
59 | char *repeated_strings_1[] = { (char*)"two", (char*)"string" }; | |
60 | char *repeated_strings_2[] = { (char*)"many", (char*)"tiny", (char*)"little", (char*)"strings", (char*)"should", (char*)"be", (char*)"handled" }; | |
61 | char *repeated_strings_3[] = { (char*)"one very long strings XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; | |
58 | const char *repeated_strings_0[] = { "onestring" }; | |
59 | const char *repeated_strings_1[] = { "two", "string" }; | |
60 | const char *repeated_strings_2[] = { "many", "tiny", "little", "strings", "should", "be", "handled" }; | |
61 | const char *repeated_strings_3[] = { "one very long strings XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; |
431 | 431 | #undef DO_TEST |
432 | 432 | } |
433 | 433 | |
434 | static size_t foo__test_mess_optional__get_packed_size | |
435 | (const Foo__TestMessOptional *message) | |
436 | { | |
437 | assert(message->base.descriptor == &foo__test_mess_optional__descriptor); | |
438 | return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); | |
439 | } | |
440 | static size_t foo__test_mess_optional__pack | |
441 | (const Foo__TestMessOptional *message, | |
442 | uint8_t *out) | |
443 | { | |
444 | assert(message->base.descriptor == &foo__test_mess_optional__descriptor); | |
445 | return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); | |
446 | } | |
447 | static Foo__TestMessOptional * | |
448 | foo__test_mess_optional__unpack | |
449 | (ProtobufCAllocator *allocator, | |
450 | size_t len, | |
451 | const uint8_t *data) | |
452 | { | |
453 | return (Foo__TestMessOptional *) | |
454 | protobuf_c_message_unpack (&foo__test_mess_optional__descriptor, | |
455 | allocator, len, data); | |
456 | } | |
457 | static void foo__test_mess_optional__free_unpacked | |
458 | (Foo__TestMessOptional *message, | |
459 | ProtobufCAllocator *allocator) | |
460 | { | |
461 | if(!message) | |
462 | return; | |
463 | assert(message->base.descriptor == &foo__test_mess_optional__descriptor); | |
464 | protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); | |
465 | } | |
466 | ||
434 | 467 | /* === Optional type fields === */ |
435 | 468 | static void test_empty_optional (void) |
436 | 469 | { |
1240 | 1273 | { |
1241 | 1274 | |
1242 | 1275 | #define DO_TEST(static_array, example_packed_data) \ |
1243 | DO_TEST_REPEATED(test_string, (char **), \ | |
1276 | DO_TEST_REPEATED(test_string, (const char **), \ | |
1244 | 1277 | static_array, example_packed_data, \ |
1245 | 1278 | STRING_EQUALS) |
1246 | 1279 | |
2075 | 2108 | Foo__TestMessageCheck__SubMessage sm = FOO__TEST_MESSAGE_CHECK__SUB_MESSAGE__INIT; |
2076 | 2109 | Foo__TestMessageCheck__SubMessage sm2 = FOO__TEST_MESSAGE_CHECK__SUB_MESSAGE__INIT; |
2077 | 2110 | Foo__TestMessageCheck m = FOO__TEST_MESSAGE_CHECK__INIT; |
2078 | char *null = NULL; | |
2079 | char *str = ""; | |
2111 | const char *null = NULL; | |
2112 | const char *str = ""; | |
2080 | 2113 | Foo__TestMessageCheck__SubMessage *sm_p; |
2081 | 2114 | ProtobufCBinaryData bd; |
2082 | 2115 |
0 | #include <stdlib.h> | |
1 | ||
2 | #include "t/issue251/issue251.pb-c.h" | |
3 | ||
4 | int main(void) | |
5 | { | |
6 | TwoOneofs msg = TWO_ONEOFS__INIT; | |
7 | const ProtobufCFieldDescriptor *field; | |
8 | unsigned off1, off2, off_name; | |
9 | field = protobuf_c_message_descriptor_get_field_by_name( | |
10 | msg.base.descriptor, | |
11 | "first_oneof"); | |
12 | assert (field); | |
13 | off_name = field->offset; | |
14 | field = protobuf_c_message_descriptor_get_field( | |
15 | msg.base.descriptor, | |
16 | 10); | |
17 | assert (field); | |
18 | off1 = field->offset; | |
19 | field = protobuf_c_message_descriptor_get_field( | |
20 | msg.base.descriptor, | |
21 | 11); | |
22 | assert (field); | |
23 | off2 = field->offset; | |
24 | ||
25 | assert (off_name == off1); | |
26 | assert (off1 == off2); | |
27 | ||
28 | field = protobuf_c_message_descriptor_get_field_by_name( | |
29 | msg.base.descriptor, | |
30 | "second_oneof"); | |
31 | assert (field); | |
32 | off_name = field->offset; | |
33 | field = protobuf_c_message_descriptor_get_field( | |
34 | msg.base.descriptor, | |
35 | 20); | |
36 | assert (field); | |
37 | off1 = field->offset; | |
38 | field = protobuf_c_message_descriptor_get_field( | |
39 | msg.base.descriptor, | |
40 | 21); | |
41 | assert (field); | |
42 | off2 = field->offset; | |
43 | ||
44 | assert (off_name == off1); | |
45 | assert (off1 == off2); | |
46 | return EXIT_SUCCESS; | |
47 | } |
0 | import "protobuf-c/protobuf-c.proto"; | |
1 | ||
2 | option (pb_c_file).use_oneof_field_name = true; | |
3 | ||
4 | message two_oneofs { | |
5 | oneof first_oneof { | |
6 | bool a = 10; | |
7 | bool b = 11; | |
8 | } | |
9 | ||
10 | oneof second_oneof { | |
11 | bool c = 20; | |
12 | bool d = 21; | |
13 | } | |
14 | } |
7 | 7 | { |
8 | 8 | assert(_MESSAGE_TYPE1__FLAG_IS_INT_SIZE == INT_MAX); |
9 | 9 | assert(_MESSAGE_TYPE2__ANOTHER_FLAG_IS_INT_SIZE == INT_MAX); |
10 | assert(_TOP_LEVEL__SUBMESSAGES_IS_INT_SIZE == INT_MAX); | |
10 | assert(_TOP_LEVEL__SUBMESSAGES__CASE_IS_INT_SIZE == INT_MAX); | |
11 | 11 | return EXIT_SUCCESS; |
12 | 12 | } |
0 | syntax = "proto3"; | |
1 | ||
2 | message EnumIntTest { | |
3 | enum Label { | |
4 | LABEL_1 = 0; | |
5 | LABEL_2 = 1; | |
6 | } | |
7 | oneof label { | |
8 | Label label_label = 123; | |
9 | uint64 label_uint64 = 124; | |
10 | } | |
11 | } |
0 | #include <stdlib.h> | |
1 | #include <string.h> | |
2 | ||
3 | #include "t/issue440/issue440.pb-c.h" | |
4 | ||
5 | int main(void) | |
6 | { | |
7 | /* Output of $ echo "int: 1 int: -142342 int: 0 int: 423423222" | \ | |
8 | * protoc issue440.proto --encode=Int | xxd -i: | |
9 | * 0x0a, 0x11, 0x01, 0xfa, 0xa7, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, | |
10 | * 0x01, 0x00, 0xf6, 0xd9, 0xf3, 0xc9, 0x01 | |
11 | * | |
12 | * Output of $ echo "int: 1 int: -142342 int: 0 int: 423423222" | \ | |
13 | * protoc issue440.proto --encode=Int | protoc issue440.proto \ | |
14 | * --decode=Boolean: boolean: true boolean: true boolean: false boolean: true | |
15 | */ | |
16 | uint8_t protoc[] = {0x0a, 0x11, 0x01, 0xfa, 0xa7, 0xf7, 0xff, 0xff, | |
17 | 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0xf6, 0xd9, 0xf3, 0xc9, | |
18 | 0x01}; | |
19 | Boolean *msg = boolean__unpack (NULL, sizeof protoc, protoc); | |
20 | assert(msg); | |
21 | assert(msg->n_boolean == 4); | |
22 | assert(msg->boolean[0] == 1); | |
23 | assert(msg->boolean[1] == 1); | |
24 | assert(msg->boolean[2] == 0); | |
25 | assert(msg->boolean[3] == 1); | |
26 | boolean__free_unpacked (msg, NULL); | |
27 | ||
28 | return EXIT_SUCCESS; | |
29 | } |
0 | syntax = "proto3"; | |
1 | ||
2 | message Int { | |
3 | repeated int32 int = 1; | |
4 | } | |
5 | ||
6 | message Boolean { | |
7 | repeated bool boolean = 1; | |
8 | } |
0 | 0 | package foo; |
1 | ||
2 | import "protobuf-c/protobuf-c.proto"; | |
3 | ||
4 | option (pb_c_file).const_strings = true; | |
1 | 5 | |
2 | 6 | message SubMess { |
3 | 7 | required int32 test = 4; |
10 | 14 | repeated int32 rep = 4; |
11 | 15 | optional bytes bytes1 = 2 [default = "a \0 char"]; |
12 | 16 | optional string str1 = 3 [default = "hello world\n"]; |
17 | optional string str2 = 5 [default = "hello\0world\n", | |
18 | (pb_c_field).string_as_bytes = true]; | |
13 | 19 | } |
14 | 20 | optional SubSubMess sub1 = 9; |
15 | 21 | optional SubSubMess sub2 = 10; |
114 | 120 | } |
115 | 121 | |
116 | 122 | message TestMessOptional { |
123 | option (pb_c_msg).gen_pack_helpers = false; | |
124 | option (pb_c_msg).gen_init_helpers = false; | |
117 | 125 | optional int32 test_int32 = 1; |
118 | 126 | optional sint32 test_sint32 = 2; |
119 | 127 | optional sfixed32 test_sfixed32 = 3; |