Codebase list protobuf-c / 98337b9
Import upstream version 1.4.0 Debian Janitor 2 years ago
55 changed file(s) with 1283 addition(s) and 592 deletion(s). Raw diff Collapse all Expand all
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
038 protobuf-c (1.3.3)
139
240 [ Robert Edmonds ]
4141 protobuf-c/libprotobuf-c.la
4242
4343 nobase_include_HEADERS += \
44 protobuf-c/protobuf-c.h
44 protobuf-c/protobuf-c.h \
45 protobuf-c/protobuf-c.proto
4546
4647 protobuf_c_libprotobuf_c_la_SOURCES = \
4748 protobuf-c/protobuf-c.c \
9899 protoc-c/c_service.h \
99100 protoc-c/c_string_field.cc \
100101 protoc-c/c_string_field.h \
102 protobuf-c/protobuf-c.pb.cc \
103 protobuf-c/protobuf-c.pb.h \
101104 protoc-c/main.cc
102105 protoc_c_protoc_gen_c_CXXFLAGS = \
103106 $(AM_CXXFLAGS) \
106109 $(protobuf_LIBS) \
107110 -lprotoc
108111
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
109118 #
110119 # protoc-c compat link
111120 #
154163
155164 t_generated_code2_cxx_generate_packed_data_SOURCES = \
156165 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
158168 $(t_generated_code2_cxx_generate_packed_data_OBJECTS): t/test-full.pb.h
159169 t_generated_code2_cxx_generate_packed_data_CXXFLAGS = \
160170 $(AM_CXXFLAGS) \
215225 t_version_version_LDADD = \
216226 protobuf-c/libprotobuf-c.la
217227
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
218245 # Issue #220
219246 check_PROGRAMS += \
220247 t/issue220/issue220
264291 $(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
265292 BUILT_SOURCES += \
266293 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
267319 endif # BUILD_PROTO3
268320 EXTRA_DIST += \
269321 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.
11 # @configure_input@
22
3 # Copyright (C) 1994-2018 Free Software Foundation, Inc.
3 # Copyright (C) 1994-2020 Free Software Foundation, Inc.
44
55 # This Makefile.in is free software; the Free Software Foundation
66 # gives unlimited permission to copy and/or distribute it,
107107 # protoc-gen-c
108108 #
109109 @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
114113
115114 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_5 = \
116115 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code/test-generated-code \
118117 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version
119118
120119 @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 = \
121125 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/cxx-generate-packed-data
122126
123 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_7 = \
127 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_8 = \
124128 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test.pb-c.c t/test.pb-c.h \
125129 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb-c.c t/test-full.pb-c.h \
126130 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-optimized.pb-c.c t/test-optimized.pb-c.h \
127131 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/test-full.pb.cc t/test-full.pb.h \
128132 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-full-cxx-output.inc
129133
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
133134 @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@am__append_9 = \
134135 @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code3/test-generated-code3
135136
136137 @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 = \
137141 @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ t/test-proto3.pb-c.c t/test-proto3.pb-c.h
138142
139143
144 # Issue #204
145
140146 # Issue #220
141147
142148 # 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 \
144151 @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 \
146154 @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 \
148158 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.pb-c.h \
149159 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue251/issue251.pb-c.c \
150160 @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 \
154179 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.proto
155180
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
167181 # Issue #375
168 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_18 = \
182 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_21 = \
169183 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375
170184
171 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_19 = \
185 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_22 = \
172186 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375
173187
174 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_20 = \
188 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__append_23 = \
175189 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.pb-c.c t/issue375/issue375.pb-c.h
176190
177191 subdir = .
202216 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/generated-code2/test-generated-code2$(EXEEXT) \
203217 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/version/version$(EXEEXT)
204218 @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) \
206221 @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)
208224 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_6 = t/issue375/issue375$(EXEEXT)
209225 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am__EXEEXT_7 = t/generated-code2/cxx-generate-packed-data$(EXEEXT)
210226 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
261277 protoc-c/c_message_field.h protoc-c/c_primitive_field.cc \
262278 protoc-c/c_primitive_field.h protoc-c/c_service.cc \
263279 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
265282 @BUILD_COMPILER_TRUE@am_protoc_c_protoc_gen_c_OBJECTS = protoc-c/protoc_gen_c-c_bytes_field.$(OBJEXT) \
266283 @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_enum.$(OBJEXT) \
267284 @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_enum_field.$(OBJEXT) \
275292 @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_primitive_field.$(OBJEXT) \
276293 @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-c_service.$(OBJEXT) \
277294 @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) \
278296 @BUILD_COMPILER_TRUE@ protoc-c/protoc_gen_c-main.$(OBJEXT)
279297 protoc_c_protoc_gen_c_OBJECTS = $(am_protoc_c_protoc_gen_c_OBJECTS)
280298 am__DEPENDENCIES_1 =
293311 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code_test_generated_code_DEPENDENCIES = protobuf-c/libprotobuf-c.la
294312 am__t_generated_code2_cxx_generate_packed_data_SOURCES_DIST = \
295313 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
297315 @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)
299318 t_generated_code2_cxx_generate_packed_data_OBJECTS = \
300319 $(am_t_generated_code2_cxx_generate_packed_data_OBJECTS)
301320 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_DEPENDENCIES = $(am__DEPENDENCIES_1)
320339 t_generated_code3_test_generated_code3_OBJECTS = \
321340 $(am_t_generated_code3_test_generated_code3_OBJECTS)
322341 @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
323348 am__t_issue220_issue220_SOURCES_DIST = t/issue220/issue220.c \
324349 t/issue220/issue220.pb-c.c
325350 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_issue220_issue220_OBJECTS = t/issue220/issue220.$(OBJEXT) \
333358 t_issue251_issue251_OBJECTS = $(am_t_issue251_issue251_OBJECTS)
334359 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue251_issue251_DEPENDENCIES = protobuf-c/libprotobuf-c.la
335360 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
337362 @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)
339365 t_issue330_issue330_OBJECTS = $(am_t_issue330_issue330_OBJECTS)
340366 @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@t_issue330_issue330_DEPENDENCIES = protobuf-c/libprotobuf-c.la
341367 am__t_issue375_issue375_SOURCES_DIST = t/issue375/issue375.c \
344370 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue375/issue375.pb-c.$(OBJEXT)
345371 t_issue375_issue375_OBJECTS = $(am_t_issue375_issue375_OBJECTS)
346372 @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
347379 am__t_version_version_SOURCES_DIST = t/version/version.c
348380 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@am_t_version_version_OBJECTS = t/version/version.$(OBJEXT)
349381 t_version_version_OBJECTS = $(am_t_version_version_OBJECTS)
364396 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
365397 am__maybe_remake_depfiles = depfiles
366398 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 \
367401 protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po \
368402 protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po \
369403 protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po \
386420 t/generated-code/$(DEPDIR)/test-generated-code.Po \
387421 t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po \
388422 t/generated-code2/$(DEPDIR)/test-generated-code2.Po \
423 t/issue204/$(DEPDIR)/issue204.Po \
424 t/issue204/$(DEPDIR)/issue204.pb-c.Po \
389425 t/issue220/$(DEPDIR)/issue220.Po \
390426 t/issue220/$(DEPDIR)/issue220.pb-c.Po \
391427 t/issue251/$(DEPDIR)/issue251.Po \
394430 t/issue330/$(DEPDIR)/issue330.pb-c.Po \
395431 t/issue375/$(DEPDIR)/issue375.Po \
396432 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 \
397436 t/version/$(DEPDIR)/version.Po
398437 am__mv = mv -f
399438 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
438477 $(t_generated_code2_cxx_generate_packed_data_SOURCES) \
439478 $(t_generated_code2_test_generated_code2_SOURCES) \
440479 $(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) \
443483 $(t_version_version_SOURCES)
444484 DIST_SOURCES = $(protobuf_c_libprotobuf_c_la_SOURCES) \
445485 $(am__protoc_c_protoc_gen_c_SOURCES_DIST) \
447487 $(am__t_generated_code2_cxx_generate_packed_data_SOURCES_DIST) \
448488 $(am__t_generated_code2_test_generated_code2_SOURCES_DIST) \
449489 $(am__t_generated_code3_test_generated_code3_SOURCES_DIST) \
490 $(am__t_issue204_issue204_SOURCES_DIST) \
450491 $(am__t_issue220_issue220_SOURCES_DIST) \
451492 $(am__t_issue251_issue251_SOURCES_DIST) \
452493 $(am__t_issue330_issue330_SOURCES_DIST) \
453494 $(am__t_issue375_issue375_SOURCES_DIST) \
495 $(am__t_issue440_issue440_SOURCES_DIST) \
454496 $(am__t_version_version_SOURCES_DIST)
455497 am__can_run_installinfo = \
456498 case $$AM_UPDATE_INFO_DIR in \
459501 esac
460502 DATA = $(pkgconfig_DATA)
461503 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
464506 # Read a list of newline-separated strings from the standard input,
465507 # and print each of them once, without duplicates. Input order is
466508 # *not* preserved.
636678 bases='$(TEST_LOGS)'; \
637679 bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
638680 bases=`echo $$bases`
681 AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
639682 RECHECK_LOGS = $(TEST_LOGS)
640683 TEST_SUITE_LOG = test-suite.log
641684 TEST_EXTENSIONS = @EXEEXT@ .test
683726 DIST_ARCHIVES = $(distdir).tar.gz
684727 GZIP_ENV = --best
685728 DIST_TARGETS = dist-gzip
729 # Exists only to be overridden by the user if desired.
730 AM_DISTCHECK_DVI_TARGET = dvi
686731 distuninstallcheck_listfiles = find . -type f -print
687732 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
688733 | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
827872 top_builddir = @top_builddir@
828873 top_srcdir = @top_srcdir@
829874 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
831877 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)
834880
835881 #
836882 #
838884 CLEANFILES = protobuf-c/libprotobuf-c.pc $(BUILT_SOURCES)
839885 DISTCLEANFILES =
840886 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 \
842889 t/test-full.proto t/test-optimized.proto t/test-proto3.proto \
843890 t/generated-code2/common-test-arrays.h Doxyfile.in \
844891 DoxygenLayout.xml build-cmake/CMakeLists.txt
896943 @BUILD_COMPILER_TRUE@ protoc-c/c_service.h \
897944 @BUILD_COMPILER_TRUE@ protoc-c/c_string_field.cc \
898945 @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 \
899948 @BUILD_COMPILER_TRUE@ protoc-c/main.cc
900949
901950 @BUILD_COMPILER_TRUE@protoc_c_protoc_gen_c_CXXFLAGS = \
932981
933982 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_SOURCES = \
934983 @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
936986
937987 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_generated_code2_cxx_generate_packed_data_CXXFLAGS = \
938988 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ $(AM_CXXFLAGS) \
9571007 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_version_version_LDADD = \
9581008 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la
9591009
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
9601017 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue220_issue220_SOURCES = \
9611018 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.c \
9621019 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ t/issue220/issue220.pb-c.c
9711028 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue251_issue251_LDADD = \
9721029 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la
9731030
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
9781048 @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 = \
9791056 @BUILD_COMPILER_TRUE@@BUILD_PROTO3_TRUE@@CROSS_COMPILING_FALSE@ protobuf-c/libprotobuf-c.la
9801057
9811058 @BUILD_COMPILER_TRUE@@CROSS_COMPILING_FALSE@t_issue375_issue375_SOURCES = \
11871264 protoc-c/$(DEPDIR)/$(am__dirstamp)
11881265 protoc-c/protoc_gen_c-c_string_field.$(OBJEXT): \
11891266 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)
11901270 protoc-c/protoc_gen_c-main.$(OBJEXT): protoc-c/$(am__dirstamp) \
11911271 protoc-c/$(DEPDIR)/$(am__dirstamp)
11921272
12241304 t/generated-code2/$(DEPDIR)/$(am__dirstamp)
12251305 t/generated_code2_cxx_generate_packed_data-test-full.pb.$(OBJEXT): \
12261306 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)
12271310
12281311 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)
12291312 @rm -f t/generated-code2/cxx-generate-packed-data$(EXEEXT)
12511334 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)
12521335 @rm -f t/generated-code3/test-generated-code3$(EXEEXT)
12531336 $(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)
12541351 t/issue220/$(am__dirstamp):
12551352 @$(MKDIR_P) t/issue220
12561353 @: > t/issue220/$(am__dirstamp)
12891386 t/issue330/$(DEPDIR)/$(am__dirstamp)
12901387 t/issue330/issue330.pb-c.$(OBJEXT): t/issue330/$(am__dirstamp) \
12911388 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)
12921397
12931398 t/issue330/issue330$(EXEEXT): $(t_issue330_issue330_OBJECTS) $(t_issue330_issue330_DEPENDENCIES) $(EXTRA_t_issue330_issue330_DEPENDENCIES) t/issue330/$(am__dirstamp)
12941399 @rm -f t/issue330/issue330$(EXEEXT)
13071412 t/issue375/issue375$(EXEEXT): $(t_issue375_issue375_OBJECTS) $(t_issue375_issue375_DEPENDENCIES) $(EXTRA_t_issue375_issue375_DEPENDENCIES) t/issue375/$(am__dirstamp)
13081413 @rm -f t/issue375/issue375$(EXEEXT)
13091414 $(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)
13101429 t/version/$(am__dirstamp):
13111430 @$(MKDIR_P) t/version
13121431 @: > t/version/$(am__dirstamp)
13281447 -rm -f t/*.$(OBJEXT)
13291448 -rm -f t/generated-code/*.$(OBJEXT)
13301449 -rm -f t/generated-code2/*.$(OBJEXT)
1450 -rm -f t/issue204/*.$(OBJEXT)
13311451 -rm -f t/issue220/*.$(OBJEXT)
13321452 -rm -f t/issue251/*.$(OBJEXT)
13331453 -rm -f t/issue330/*.$(OBJEXT)
13341454 -rm -f t/issue375/*.$(OBJEXT)
1455 -rm -f t/issue389/*.$(OBJEXT)
1456 -rm -f t/issue440/*.$(OBJEXT)
13351457 -rm -f t/version/*.$(OBJEXT)
13361458
13371459 distclean-compile:
13381460 -rm -f *.tab.c
13391461
13401462 @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
13411465 @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po@am__quote@ # am--include-marker
13421466 @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po@am__quote@ # am--include-marker
13431467 @AMDEP_TRUE@@am__include@ @am__quote@protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po@am__quote@ # am--include-marker
13611485 @AMDEP_TRUE@@am__include@ @am__quote@t/generated-code/$(DEPDIR)/test-generated-code.Po@am__quote@ # am--include-marker
13621486 @AMDEP_TRUE@@am__include@ @am__quote@t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po@am__quote@ # am--include-marker
13631487 @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
13641490 @AMDEP_TRUE@@am__include@ @am__quote@t/issue220/$(DEPDIR)/issue220.Po@am__quote@ # am--include-marker
13651491 @AMDEP_TRUE@@am__include@ @am__quote@t/issue220/$(DEPDIR)/issue220.pb-c.Po@am__quote@ # am--include-marker
13661492 @AMDEP_TRUE@@am__include@ @am__quote@t/issue251/$(DEPDIR)/issue251.Po@am__quote@ # am--include-marker
13691495 @AMDEP_TRUE@@am__include@ @am__quote@t/issue330/$(DEPDIR)/issue330.pb-c.Po@am__quote@ # am--include-marker
13701496 @AMDEP_TRUE@@am__include@ @am__quote@t/issue375/$(DEPDIR)/issue375.Po@am__quote@ # am--include-marker
13711497 @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
13721501 @AMDEP_TRUE@@am__include@ @am__quote@t/version/$(DEPDIR)/version.Po@am__quote@ # am--include-marker
13731502
13741503 $(am__depfiles_remade):
16351764 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
16361765 @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`
16371766
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
16381781 protoc-c/protoc_gen_c-main.o: protoc-c/main.cc
16391782 @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
16401783 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) protoc-c/$(DEPDIR)/protoc_gen_c-main.Tpo protoc-c/$(DEPDIR)/protoc_gen_c-main.Po
16761819 @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@
16771820 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
16781821 @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`
16791836
16801837 mostlyclean-libtool:
16811838 -rm -f *.lo
16871844 -rm -rf t/generated-code/.libs t/generated-code/_libs
16881845 -rm -rf t/generated-code2/.libs t/generated-code2/_libs
16891846 -rm -rf t/generated-code3/.libs t/generated-code3/_libs
1847 -rm -rf t/issue204/.libs t/issue204/_libs
16901848 -rm -rf t/issue220/.libs t/issue220/_libs
16911849 -rm -rf t/issue251/.libs t/issue251/_libs
16921850 -rm -rf t/issue330/.libs t/issue330/_libs
16931851 -rm -rf t/issue375/.libs t/issue375/_libs
1852 -rm -rf t/issue440/.libs t/issue440/_libs
16941853 -rm -rf t/version/.libs t/version/_libs
16951854
16961855 distclean-libtool:
19072066 test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
19082067 fi; \
19092068 echo "$${col}$$br$${std}"; \
1910 echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
2069 echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
19112070 echo "$${col}$$br$${std}"; \
19122071 create_testsuite_report --maybe-color; \
19132072 echo "$$col$$br$$std"; \
19692128 --log-file $$b.log --trs-file $$b.trs \
19702129 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
19712130 "$$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)
19722138 t/issue220/issue220.log: t/issue220/issue220$(EXEEXT)
19732139 @p='t/issue220/issue220$(EXEEXT)'; \
19742140 b='t/issue220/issue220'; \
19862152 t/issue330/issue330.log: t/issue330/issue330$(EXEEXT)
19872153 @p='t/issue330/issue330$(EXEEXT)'; \
19882154 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'; \
19892162 $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
19902163 --log-file $$b.log --trs-file $$b.trs \
19912164 $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
20732246 tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
20742247 $(am__post_remove_distdir)
20752248
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
20762253 dist-tarZ: distdir
20772254 @echo WARNING: "Support for distribution archives compressed with" \
20782255 "legacy program 'compress' is deprecated." >&2
21152292 eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
21162293 *.zip*) \
21172294 unzip $(distdir).zip ;;\
2295 *.tar.zst*) \
2296 zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
21182297 esac
21192298 chmod -R a-w $(distdir)
21202299 chmod u+w $(distdir)
21302309 $(DISTCHECK_CONFIGURE_FLAGS) \
21312310 --srcdir=../.. --prefix="$$dc_install_base" \
21322311 && $(MAKE) $(AM_MAKEFLAGS) \
2133 && $(MAKE) $(AM_MAKEFLAGS) dvi \
2312 && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
21342313 && $(MAKE) $(AM_MAKEFLAGS) check \
21352314 && $(MAKE) $(AM_MAKEFLAGS) install \
21362315 && $(MAKE) $(AM_MAKEFLAGS) installcheck \
21962375 done
21972376 install: $(BUILT_SOURCES)
21982377 $(MAKE) $(AM_MAKEFLAGS) install-am
2199 install-exec: install-exec-am
2378 install-exec: $(BUILT_SOURCES)
2379 $(MAKE) $(AM_MAKEFLAGS) install-exec-am
22002380 install-data: install-data-am
22012381 uninstall: uninstall-am
22022382
22362416 -rm -f t/generated-code2/$(DEPDIR)/$(am__dirstamp)
22372417 -rm -f t/generated-code2/$(am__dirstamp)
22382418 -rm -f t/generated-code3/$(am__dirstamp)
2419 -rm -f t/issue204/$(DEPDIR)/$(am__dirstamp)
2420 -rm -f t/issue204/$(am__dirstamp)
22392421 -rm -f t/issue220/$(DEPDIR)/$(am__dirstamp)
22402422 -rm -f t/issue220/$(am__dirstamp)
22412423 -rm -f t/issue251/$(DEPDIR)/$(am__dirstamp)
22442426 -rm -f t/issue330/$(am__dirstamp)
22452427 -rm -f t/issue375/$(DEPDIR)/$(am__dirstamp)
22462428 -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)
22472433 -rm -f t/version/$(DEPDIR)/$(am__dirstamp)
22482434 -rm -f t/version/$(am__dirstamp)
22492435 -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
22642450 distclean: distclean-am
22652451 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
22662452 -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
22672455 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po
22682456 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po
22692457 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po
22872475 -rm -f t/generated-code/$(DEPDIR)/test-generated-code.Po
22882476 -rm -f t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po
22892477 -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
22902480 -rm -f t/issue220/$(DEPDIR)/issue220.Po
22912481 -rm -f t/issue220/$(DEPDIR)/issue220.pb-c.Po
22922482 -rm -f t/issue251/$(DEPDIR)/issue251.Po
22952485 -rm -f t/issue330/$(DEPDIR)/issue330.pb-c.Po
22962486 -rm -f t/issue375/$(DEPDIR)/issue375.Po
22972487 -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
22982491 -rm -f t/version/$(DEPDIR)/version.Po
22992492 -rm -f Makefile
23002493 distclean-am: clean-am distclean-compile distclean-generic \
23462539 -rm -f $(am__CONFIG_DISTCLEAN_FILES)
23472540 -rm -rf $(top_srcdir)/autom4te.cache
23482541 -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
23492544 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_bytes_field.Po
23502545 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum.Po
23512546 -rm -f protoc-c/$(DEPDIR)/protoc_gen_c-c_enum_field.Po
23692564 -rm -f t/generated-code/$(DEPDIR)/test-generated-code.Po
23702565 -rm -f t/generated-code2/$(DEPDIR)/cxx_generate_packed_data-cxx-generate-packed-data.Po
23712566 -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
23722569 -rm -f t/issue220/$(DEPDIR)/issue220.Po
23732570 -rm -f t/issue220/$(DEPDIR)/issue220.pb-c.Po
23742571 -rm -f t/issue251/$(DEPDIR)/issue251.Po
23772574 -rm -f t/issue330/$(DEPDIR)/issue330.pb-c.Po
23782575 -rm -f t/issue375/$(DEPDIR)/issue375.Po
23792576 -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
23802580 -rm -f t/version/$(DEPDIR)/version.Po
23812581 -rm -f Makefile
23822582 maintainer-clean-am: distclean-am maintainer-clean-generic
23982598 uninstall-nobase_includeHEADERS uninstall-pkgconfigDATA
23992599
24002600 .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
24022602
24032603 .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles am--refresh check \
24042604 check-TESTS check-am clean clean-binPROGRAMS \
24062606 clean-libLTLIBRARIES clean-libtool clean-local \
24072607 clean-noinstPROGRAMS cscope cscopelist-am ctags ctags-am dist \
24082608 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 \
24102610 distclean-compile distclean-generic distclean-hdr \
24112611 distclean-libtool distclean-tags distcleancheck distdir \
24122612 distuninstallcheck dvi dvi-am html html-am html-local info \
24282628
24292629 @CODE_COVERAGE_RULES@
24302630
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
24312633 #
24322634 # protoc-c compat link
24332635 #
24542656
24552657 @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
24562658 @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
24572661 @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
24582662 @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
24592663 @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
24602664 @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
24612665 @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
24622666 @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
24632671 @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
24642672 @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
24652673
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)
11
22 ## Overview
33
1919
2020 ./autogen.sh && ./configure && make && make install
2121
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
2228 ## Documentation
2329
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:
2531
2632 make html
2733
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.
33
44 # This file is free software; the Free Software Foundation
55 # gives unlimited permission to copy and/or distribute it,
1919 If you have problems, you may need to regenerate the build system entirely.
2020 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
2121
22 # Copyright (C) 2002-2018 Free Software Foundation, Inc.
22 # Copyright (C) 2002-2020 Free Software Foundation, Inc.
2323 #
2424 # This file is free software; the Free Software Foundation
2525 # gives unlimited permission to copy and/or distribute it,
3434 [am__api_version='1.16'
3535 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
3636 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], [],
3838 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
3939 ])
4040
5050 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5151 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
5252 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
53 [AM_AUTOMAKE_VERSION([1.16.1])dnl
53 [AM_AUTOMAKE_VERSION([1.16.3])dnl
5454 m4_ifndef([AC_AUTOCONF_VERSION],
5555 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
5656 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
5757
5858 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
5959
60 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
60 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
6161 #
6262 # This file is free software; the Free Software Foundation
6363 # gives unlimited permission to copy and/or distribute it,
109109
110110 # AM_COND_IF -*- Autoconf -*-
111111
112 # Copyright (C) 2008-2018 Free Software Foundation, Inc.
112 # Copyright (C) 2008-2020 Free Software Foundation, Inc.
113113 #
114114 # This file is free software; the Free Software Foundation
115115 # gives unlimited permission to copy and/or distribute it,
146146
147147 # AM_CONDITIONAL -*- Autoconf -*-
148148
149 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
149 # Copyright (C) 1997-2020 Free Software Foundation, Inc.
150150 #
151151 # This file is free software; the Free Software Foundation
152152 # gives unlimited permission to copy and/or distribute it,
177177 Usually this means the macro was only invoked conditionally.]])
178178 fi])])
179179
180 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
180 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
181181 #
182182 # This file is free software; the Free Software Foundation
183183 # gives unlimited permission to copy and/or distribute it,
368368
369369 # Generate code to set up dependency tracking. -*- Autoconf -*-
370370
371 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
371 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
372372 #
373373 # This file is free software; the Free Software Foundation
374374 # gives unlimited permission to copy and/or distribute it,
407407 done
408408 if test $am_rc -ne 0; then
409409 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
411413 '--disable-dependency-tracking' option to at least be able to build
412414 the package (albeit without support for automatic dependency tracking).])
413415 fi
434436
435437 # Do all the work for Automake. -*- Autoconf -*-
436438
437 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
439 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
438440 #
439441 # This file is free software; the Free Software Foundation
440442 # gives unlimited permission to copy and/or distribute it,
631633 done
632634 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
633635
634 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
636 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
635637 #
636638 # This file is free software; the Free Software Foundation
637639 # gives unlimited permission to copy and/or distribute it,
652654 fi
653655 AC_SUBST([install_sh])])
654656
655 # Copyright (C) 2003-2018 Free Software Foundation, Inc.
657 # Copyright (C) 2003-2020 Free Software Foundation, Inc.
656658 #
657659 # This file is free software; the Free Software Foundation
658660 # gives unlimited permission to copy and/or distribute it,
673675
674676 # Check to see how 'make' treats includes. -*- Autoconf -*-
675677
676 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
678 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
677679 #
678680 # This file is free software; the Free Software Foundation
679681 # gives unlimited permission to copy and/or distribute it,
716718
717719 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
718720
719 # Copyright (C) 1997-2018 Free Software Foundation, Inc.
721 # Copyright (C) 1997-2020 Free Software Foundation, Inc.
720722 #
721723 # This file is free software; the Free Software Foundation
722724 # gives unlimited permission to copy and/or distribute it,
737739 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
738740 AC_REQUIRE_AUX_FILE([missing])dnl
739741 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'"
746743 fi
747744 # Use eval to expand $SHELL
748745 if eval "$MISSING --is-lightweight"; then
755752
756753 # Helper functions for option handling. -*- Autoconf -*-
757754
758 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
755 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
759756 #
760757 # This file is free software; the Free Software Foundation
761758 # gives unlimited permission to copy and/or distribute it,
784781 AC_DEFUN([_AM_IF_OPTION],
785782 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
786783
787 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
784 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
788785 #
789786 # This file is free software; the Free Software Foundation
790787 # gives unlimited permission to copy and/or distribute it,
831828 # For backward compatibility.
832829 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
833830
834 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
831 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
835832 #
836833 # This file is free software; the Free Software Foundation
837834 # gives unlimited permission to copy and/or distribute it,
850847
851848 # Check to make sure that the build environment is sane. -*- Autoconf -*-
852849
853 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
850 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
854851 #
855852 # This file is free software; the Free Software Foundation
856853 # gives unlimited permission to copy and/or distribute it,
931928 rm -f conftest.file
932929 ])
933930
934 # Copyright (C) 2009-2018 Free Software Foundation, Inc.
931 # Copyright (C) 2009-2020 Free Software Foundation, Inc.
935932 #
936933 # This file is free software; the Free Software Foundation
937934 # gives unlimited permission to copy and/or distribute it,
991988 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
992989 ])
993990
994 # Copyright (C) 2001-2018 Free Software Foundation, Inc.
991 # Copyright (C) 2001-2020 Free Software Foundation, Inc.
995992 #
996993 # This file is free software; the Free Software Foundation
997994 # gives unlimited permission to copy and/or distribute it,
10191016 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
10201017 AC_SUBST([INSTALL_STRIP_PROGRAM])])
10211018
1022 # Copyright (C) 2006-2018 Free Software Foundation, Inc.
1019 # Copyright (C) 2006-2020 Free Software Foundation, Inc.
10231020 #
10241021 # This file is free software; the Free Software Foundation
10251022 # gives unlimited permission to copy and/or distribute it,
10381035
10391036 # Check how to create a tarball. -*- Autoconf -*-
10401037
1041 # Copyright (C) 2004-2018 Free Software Foundation, Inc.
1038 # Copyright (C) 2004-2020 Free Software Foundation, Inc.
10421039 #
10431040 # This file is free software; the Free Software Foundation
10441041 # gives unlimited permission to copy and/or distribute it,
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
66 # Written by Tom Tromey <tromey@cygnus.com>.
77 #
88 # This program is free software; you can redistribute it and/or modify
5252 MINGW*)
5353 file_conv=mingw
5454 ;;
55 CYGWIN*)
55 CYGWIN* | MSYS*)
5656 file_conv=cygwin
5757 ;;
5858 *)
6666 mingw/*)
6767 file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
6868 ;;
69 cygwin/*)
69 cygwin/* | msys/*)
7070 file=`cygpath -m "$file" || echo "$file"`
7171 ;;
7272 wine/*)
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1999-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1999-2020 Free Software Foundation, Inc.
66
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
00 #!/bin/sh
11 # install - install a program, script, or datafile
22
3 scriptversion=2018-03-11.20; # UTC
3 scriptversion=2020-11-14.01; # UTC
44
55 # This originates from X11R5 (mit/util/scripts/install.sh), which was
66 # later released in X11R6 (xc/config/util/install.sh) with the
6868 # Desired mode of installed file.
6969 mode=0755
7070
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=
7176 chgrpcmd=
7277 chmodcmd=$chmodprog
7378 chowncmd=
98103 --version display version info and exit.
99104
100105 -c (ignored)
101 -C install only if different (preserve the last data modification time)
106 -C install only if different (preserve data modification time)
102107 -d create directories instead of installing files.
103108 -g GROUP $chgrpprog installed files to GROUP.
104109 -m MODE $chmodprog installed files to MODE.
105110 -o USER $chownprog installed files to USER.
111 -p pass -p to $cpprog.
106112 -s $stripprog installed files.
113 -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
107114 -t DIRECTORY install into DIRECTORY.
108115 -T report an error if DSTFILE is a directory.
109116
110117 Environment variables override the default commands:
111118 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
112119 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/
113128 "
114129
115130 while test $# -ne 0; do
136151 -o) chowncmd="$chownprog $2"
137152 shift;;
138153
154 -p) cpprog="$cpprog -p";;
155
139156 -s) stripcmd=$stripprog;;
157
158 -S) backupsuffix="$2"
159 shift;;
140160
141161 -t)
142162 is_target_a_directory=always
254274 dstdir=$dst
255275 test -d "$dstdir"
256276 dstdir_status=$?
277 # Don't chown directories that already exist.
278 if test $dstdir_status = 0; then
279 chowncmd=""
280 fi
257281 else
258282
259283 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
300324 if test $dstdir_status != 0; then
301325 case $posix_mkdir in
302326 '')
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
319327 # With -d, create the new directory with the user-specified mode.
320328 # Otherwise, rely on $mkdir_umask.
321329 if test -n "$dir_arg"; then
325333 fi
326334
327335 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;;
374379 esac
375380
376381 if
381386 then :
382387 else
383388
384 # The umask is ridiculous, or mkdir does not conform to POSIX,
389 # mkdir does not conform to POSIX,
385390 # or it failed possibly due to a race condition. Create the
386391 # directory the slow way, step by step, checking for races as we go.
387392
410415 prefixes=
411416 else
412417 if $posix_mkdir; then
413 (umask=$mkdir_umask &&
418 (umask $mkdir_umask &&
414419 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
415420 # Don't fail if two instances are running concurrently.
416421 test -d "$prefix" || exit 1
450455 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
451456
452457 # 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") &&
454470
455471 # and set any options; do chmod last to preserve setuid bits.
456472 #
476492 then
477493 rm -f "$dsttmp"
478494 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
479502 # Rename the file to the real destination.
480503 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
481504
490513 # file should still install successfully.
491514 {
492515 test ! -f "$dst" ||
493 $doit $rmcmd -f "$dst" 2>/dev/null ||
516 $doit $rmcmd "$dst" 2>/dev/null ||
494517 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
495 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
518 { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
496519 } ||
497520 { echo "$0: cannot unlink or rename $dst" >&2
498521 (exit 1); exit 1
3030
3131 PROGRAM=libtool
3232 PACKAGE=libtool
33 VERSION="2.4.6 Debian-2.4.6-12"
33 VERSION="2.4.6 Debian-2.4.6-15"
3434 package_revision=2.4.6
3535
3636
21402140 compiler: $LTCC
21412141 compiler flags: $LTCFLAGS
21422142 linker: $LD (gnu? $with_gnu_ld)
2143 version: $progname $scriptversion Debian-2.4.6-12
2143 version: $progname $scriptversion Debian-2.4.6-15
21442144 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
21452145 autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
21462146
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 1996-2018 Free Software Foundation, Inc.
5 # Copyright (C) 1996-2020 Free Software Foundation, Inc.
66 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
77
88 # This program is free software; you can redistribute it and/or modify
22
33 scriptversion=2018-03-07.03; # UTC
44
5 # Copyright (C) 2011-2018 Free Software Foundation, Inc.
5 # Copyright (C) 2011-2020 Free Software Foundation, Inc.
66 #
77 # This program is free software; you can redistribute it and/or modify
88 # it under the terms of the GNU General Public License as published by
4141 {
4242 cat <<END
4343 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}] [--]
4747 TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
48
4849 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
50 See the GNU Automake documentation for information.
4951 END
5052 }
5153
00 SET(PACKAGE protobuf-c)
11 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)
67
78 PROJECT(protobuf-c)
89
910 #options
10 option(MSVC_STATIC_BUILD "MSVC_STATIC_BUILD" OFF)
1111 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()
1218
1319 INCLUDE(TestBigEndian)
1420 TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
2026 ADD_DEFINITIONS(-DWORDS_BIGENDIAN)
2127 endif()
2228
29 IF (MSVC AND BUILD_SHARED_LIBS)
30 ADD_DEFINITIONS(-DPROTOBUF_C_USE_SHARED_LIB)
31 ENDIF (MSVC AND BUILD_SHARED_LIBS)
32
2333 if(MSVC)
2434 # using Visual Studio C++
2535 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244")
3646 ${MAIN_DIR}/protobuf-c/protobuf-c.h)
3747
3848 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)
3953
4054 INCLUDE_DIRECTORIES(${MAIN_DIR})
4155 INCLUDE_DIRECTORIES(${MAIN_DIR}/protobuf-c)
56
57 IF(BUILD_PROTOC)
4258 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)
4363
4464 FIND_PACKAGE(Protobuf REQUIRED)
4565 INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR})
4767 if (BUILD_PROTO3)
4868 ADD_DEFINITIONS(-DHAVE_PROTO3)
4969 endif()
50
51 if (MSVC AND MSVC_STATIC_BUILD)
70 ENDIF()
71
72 if (MSVC AND NOT BUILD_SHARED_LIBS)
5273 # In case we are building static libraries, link also the runtime library statically
5374 # so that MSVCR*.DLL is not required at runtime.
5475 # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
6384 string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
6485 endif(${flag_var} MATCHES "/MD")
6586 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)
6796 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)
6998
7099 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)
71107
72108 IF(CMAKE_HOST_UNIX)
73109 ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
83119 ENDFUNCTION()
84120
85121
86 IF(CMAKE_BUILD_TYPE MATCHES Debug)
122 IF(BUILD_TESTS)
87123 ENABLE_TESTING()
88124
89125 GENERATE_TEST_SOURCES(${TEST_DIR}/test.proto t/test.pb-c.c t/test.pb-c.h)
98134
99135 GENERATE_TEST_SOURCES(${TEST_DIR}/test-full.proto t/test-full.pb-c.c t/test-full.pb-c.h)
100136
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)
102138 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)
103142
104143 FILE(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/t/generated-code2)
105144 ADD_CUSTOM_COMMAND(OUTPUT t/generated-code2/test-full-cxx-output.inc
130169 TARGET_COMPILE_DEFINITIONS(test-generated-code3 PUBLIC -DPROTO3)
131170 TARGET_LINK_LIBRARIES(test-generated-code3 protobuf-c)
132171
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)
137188 INSTALL(FILES ${MAIN_DIR}/protobuf-c/protobuf-c.h DESTINATION include)
189 INSTALL(FILES ${CMAKE_BINARY_DIR}/protobuf-c.pdb DESTINATION lib OPTIONAL)
138190
139191 IF(CMAKE_HOST_UNIX)
140192 INSTALL(CODE "EXECUTE_PROCESS (COMMAND ln -sf protoc-gen-c protoc-c WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)")
141193 ENDIF()
142194
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)
143205 INCLUDE(Dart)
144206
145207 SET(DART_TESTING_TIMEOUT 5)
149211 ADD_TEST(test-issue220 test-issue220)
150212 ADD_TEST(test-issue251 test-issue251)
151213 ADD_TEST(test-version test-version)
214 ENDIF()
152215
153216
154217 INCLUDE(CPack)
00 #! /bin/sh
11 # 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.
33 #
44 # Report bugs to <https://github.com/protobuf-c/protobuf-c/issues>.
55 #
589589 # Identity of this package.
590590 PACKAGE_NAME='protobuf-c'
591591 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'
594594 PACKAGE_BUGREPORT='https://github.com/protobuf-c/protobuf-c/issues'
595595 PACKAGE_URL='https://github.com/protobuf-c/protobuf-c'
596596
13771377 # Omit some internal or obsolete options to make the list less imposing.
13781378 # This message is too long to be a string in the A/UX 3.1 sh.
13791379 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.
13811381
13821382 Usage: $0 [OPTION]... [VAR=VALUE]...
13831383
14481448
14491449 if test -n "$ac_init_help"; then
14501450 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:";;
14521452 esac
14531453 cat <<\_ACEOF
14541454
15811581 test -n "$ac_init_help" && exit $ac_status
15821582 if $ac_init_version; then
15831583 cat <<\_ACEOF
1584 protobuf-c configure 1.3.3
1584 protobuf-c configure 1.4.0
15851585 generated by GNU Autoconf 2.69
15861586
15871587 Copyright (C) 2012 Free Software Foundation, Inc.
22042204 This file contains any messages produced by compilers while
22052205 running configure, to aid debugging if configure makes a mistake.
22062206
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
22082208 generated by GNU Autoconf 2.69. Invocation command line was
22092209
22102210 $ $0 $@
27612761 am_aux_dir=`cd "$ac_aux_dir" && pwd`
27622762
27632763 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'"
27702765 fi
27712766 # Use eval to expand $SHELL
27722767 if eval "$MISSING --is-lightweight"; then
30713066
30723067 # Define the identity of the package.
30733068 PACKAGE='protobuf-c'
3074 VERSION='1.3.3'
3069 VERSION='1.4.0'
30753070
30763071
30773072 cat >>confdefs.h <<_ACEOF
88758870 # to the OS version, if on x86, and 10.4, the deployment
88768871 # target defaults to 10.4. Don't you love it?
88778872 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]*)
88798874 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
88808875 10.[012][,.]*)
88818876 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
8882 10.*)
8877 10.*|11.*)
88838878 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
88848879 esac
88858880 ;;
1885818853 # report actual input values of CONFIG_FILES etc. instead of their
1885918854 # values after options handling.
1886018855 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
1886218857 generated by GNU Autoconf 2.69. Invocation command line was
1886318858
1886418859 CONFIG_FILES = $CONFIG_FILES
1892518920 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1892618921 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1892718922 ac_cs_version="\\
18928 protobuf-c config.status 1.3.3
18923 protobuf-c config.status 1.4.0
1892918924 configured by $0, generated by GNU Autoconf 2.69,
1893018925 with options \\"\$ac_cs_config\\"
1893118926
2011820113 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2011920114 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2012020115 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
2012220119 '--disable-dependency-tracking' option to at least be able to build
2012320120 the package (albeit without support for automatic dependency tracking).
2012420121 See \`config.log' for more details" "$LINENO" 5; }
00 AC_PREREQ(2.63)
11
22 AC_INIT([protobuf-c],
3 [1.3.3],
3 [1.4.0],
44 [https://github.com/protobuf-c/protobuf-c/issues],
55 [protobuf-c],
66 [https://github.com/protobuf-c/protobuf-c])
10701070 # to the OS version, if on x86, and 10.4, the deployment
10711071 # target defaults to 10.4. Don't you love it?
10721072 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]]*)
10741074 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10751075 10.[[012]][[,.]]*)
10761076 _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1077 10.*)
1077 10.*|11.*)
10781078 _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10791079 esac
10801080 ;;
33 includedir=@includedir@
44 bindir=@bindir@
55
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@
910 Libs: -L${libdir} -lprotobuf-c
1011 Libs.private:
1112 Cflags: -I${includedir}
8383 # define PROTOBUF_C_UNPACK_ERROR(...)
8484 #endif
8585
86 #if !defined(_WIN32) || !defined(PROTOBUF_C_USE_SHARED_LIB)
8687 const char protobuf_c_empty_string[] = "";
88 #endif
8789
8890 /**
8991 * Internal `ProtobufCMessage` manipulation macro.
147149 static void *
148150 system_alloc(void *allocator_data, size_t size)
149151 {
152 (void)allocator_data;
150153 return malloc(size);
151154 }
152155
153156 static void
154157 system_free(void *allocator_data, void *data)
155158 {
159 (void)allocator_data;
156160 free(data);
157161 }
158162
16171621 break;
16181622 }
16191623 case PROTOBUF_C_TYPE_MESSAGE: {
1620 uint8_t simple_buffer_scratch[256];
1621 size_t sublen;
16221624 const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member;
1623 ProtobufCBufferSimple simple_buffer =
1624 PROTOBUF_C_BUFFER_SIMPLE_INIT(simple_buffer_scratch);
1625
1625
16261626 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 }
16361637 break;
16371638 }
16381639 default:
20622063 parse_tag_and_wiretype(size_t len,
20632064 const uint8_t *data,
20642065 uint32_t *tag_out,
2065 ProtobufCWireType *wiretype_out)
2066 uint8_t *wiretype_out)
20662067 {
20672068 unsigned max_rv = len > 5 ? 5 : len;
20682069 uint32_t tag = (data[0] & 0x7f) >> 3;
20942095
20952096 /* sizeof(ScannedMember) must be <= (1UL<<BOUND_SIZEOF_SCANNED_MEMBER_LOG2) */
20962097 #define BOUND_SIZEOF_SCANNED_MEMBER_LOG2 5
2097 typedef struct _ScannedMember ScannedMember;
2098 typedef struct ScannedMember ScannedMember;
20982099 /** Field as it's being read. */
2099 struct _ScannedMember {
2100 struct ScannedMember {
21002101 uint32_t tag; /**< Field tag. */
21012102 uint8_t wire_type; /**< Field type. */
21022103 uint8_t length_prefix_len; /**< Prefix length. */
21312132 // Protobuf messages should always be less than 2 GiB in size.
21322133 // We also want to return early here so that hdr_len + val does
21332134 // 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);
21352137 return 0;
21362138 }
21372139 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);
21392142 return 0;
21402143 }
21412144 return hdr_len + val;
24972500 {
24982501 unsigned len = scanned_member->len;
24992502 const uint8_t *data = scanned_member->data;
2500 ProtobufCWireType wire_type = scanned_member->wire_type;
2503 uint8_t wire_type = scanned_member->wire_type;
25012504
25022505 switch (scanned_member->field->type) {
25032506 case PROTOBUF_C_TYPE_ENUM:
25782581 {
25792582 do_free(allocator, bd->data);
25802583 }
2581 if (len - pref_len > 0) {
2584 if (len > pref_len) {
25822585 bd->data = do_alloc(allocator, len - pref_len);
25832586 if (bd->data == NULL)
25842587 return FALSE;
27462749 const uint8_t *at = scanned_member->data + scanned_member->length_prefix_len;
27472750 size_t rem = scanned_member->len - scanned_member->length_prefix_len;
27482751 size_t count = 0;
2752 #if defined(WORDS_BIGENDIAN)
27492753 unsigned i;
2754 #endif
27502755
27512756 switch (field->type) {
27522757 case PROTOBUF_C_TYPE_SFIXED32:
28392844 }
28402845 break;
28412846 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) {
28452850 PROTOBUF_C_UNPACK_ERROR("bad packed-repeated boolean value");
28462851 return FALSE;
28472852 }
2848 ((protobuf_c_boolean *) array)[i] = at[i];
2853 ((protobuf_c_boolean *) array)[count++] = parse_boolean(s, at);
2854 at += s;
2855 rem -= s;
28492856 }
28502857 break;
28512858 default:
30793086
30803087 while (rem > 0) {
30813088 uint32_t tag;
3082 ProtobufCWireType wire_type;
3089 uint8_t wire_type;
30833090 size_t used = parse_tag_and_wiretype(rem, at, &tag, &wire_type);
30843091 const ProtobufCFieldDescriptor *field;
30853092 ScannedMember tmp;
237237 #define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af
238238
239239 /* 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
240243 extern const char protobuf_c_empty_string[];
244 #endif
241245
242246 /**
243247 * \defgroup api Public API
789793 * The version of the protobuf-c headers, represented as a string using the same
790794 * format as protobuf_c_version().
791795 */
792 #define PROTOBUF_C_VERSION "1.3.3"
796 #define PROTOBUF_C_VERSION "1.4.0"
793797
794798 /**
795799 * The version of the protobuf-c headers, represented as an integer using the
796800 * same format as protobuf_c_version_number().
797801 */
798 #define PROTOBUF_C_VERSION_NUMBER 1003003
802 #define PROTOBUF_C_VERSION_NUMBER 1004000
799803
800804 /**
801805 * 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 }
6363 #include <protoc-c/c_helpers.h>
6464 #include <google/protobuf/io/printer.h>
6565 #include <google/protobuf/wire_format.h>
66 #include <google/protobuf/descriptor.pb.h>
66 #include <protobuf-c/protobuf-c.pb.h>
6767
6868 namespace google {
6969 namespace protobuf {
7373 using internal::WireFormat;
7474
7575 void SetBytesVariables(const FieldDescriptor* descriptor,
76 std::map<string, string>* variables) {
76 std::map<std::string, std::string>* variables) {
7777 (*variables)["name"] = FieldName(descriptor);
7878 (*variables)["default"] =
7979 "\"" + CEscape(descriptor->default_value_string()) + "\"";
8888 SetBytesVariables(descriptor, &variables_);
8989 variables_["default_value"] = descriptor->has_default_value()
9090 ? GetDefaultValue()
91 : string("{0,NULL}");
91 : std::string("{0,NULL}");
9292 }
9393
9494 BytesFieldGenerator::~BytesFieldGenerator() {}
112112 }
113113 void BytesFieldGenerator::GenerateDefaultValueDeclarations(io::Printer* printer) const
114114 {
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())
117117 + "__default_value_data";
118118 printer->Print(vars, "extern uint8_t $default_value_data$[];\n");
119119 }
120120
121121 void BytesFieldGenerator::GenerateDefaultValueImplementations(io::Printer* printer) const
122122 {
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())
125125 + "__default_value_data";
126126 vars["escaped"] = CEscape(descriptor_->default_value_string());
127127 printer->Print(vars, "uint8_t $default_value_data$[] = \"$escaped$\";\n");
128128 }
129 string BytesFieldGenerator::GetDefaultValue(void) const
129 std::string BytesFieldGenerator::GetDefaultValue(void) const
130130 {
131131 return "{ "
132132 + SimpleItoa(descriptor_->default_value_string().size())
133133 + ", "
134 + FullNameToLower(descriptor_->full_name())
134 + FullNameToLower(descriptor_->full_name(), descriptor_->file())
135135 + "__default_value_data }";
136136 }
137137 void BytesFieldGenerator::GenerateStaticInit(io::Printer* printer) const
8181 void GenerateDescriptorInitializer(io::Printer* printer) const;
8282 void GenerateDefaultValueDeclarations(io::Printer* printer) const;
8383 void GenerateDefaultValueImplementations(io::Printer* printer) const;
84 string GetDefaultValue(void) const;
84 std::string GetDefaultValue(void) const;
8585 void GenerateStaticInit(io::Printer* printer) const;
8686
8787 private:
88 std::map<string, string> variables_;
88 std::map<std::string, std::string> variables_;
8989
9090 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(BytesFieldGenerator);
9191 };
7272 namespace c {
7373
7474 EnumGenerator::EnumGenerator(const EnumDescriptor* descriptor,
75 const string& dllexport_decl)
75 const std::string& dllexport_decl)
7676 : descriptor_(descriptor),
7777 dllexport_decl_(dllexport_decl) {
7878 }
8080 EnumGenerator::~EnumGenerator() {}
8181
8282 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());
8585 vars["shortname"] = descriptor_->name();
86 vars["uc_name"] = FullNameToUpper(descriptor_->full_name());
86 vars["uc_name"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file());
8787
8888 SourceLocation sourceLoc;
8989 descriptor_->GetSourceLocation(&sourceLoc);
9797
9898
9999 vars["opt_comma"] = ",";
100 vars["prefix"] = FullNameToUpper(descriptor_->full_name()) + "__";
100 vars["prefix"] = FullNameToUpper(descriptor_->full_name(), descriptor_->file()) + "__";
101101 for (int i = 0; i < descriptor_->value_count(); i++) {
102102 vars["name"] = descriptor_->value(i)->name();
103103 vars["number"] = SimpleItoa(descriptor_->value(i)->number());
125125 }
126126
127127 void EnumGenerator::GenerateDescriptorDeclarations(io::Printer* printer) {
128 std::map<string, string> vars;
128 std::map<std::string, std::string> vars;
129129 if (dllexport_decl_.empty()) {
130130 vars["dllexport"] = "";
131131 } else {
132132 vars["dllexport"] = dllexport_decl_ + " ";
133133 }
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());
136136
137137 printer->Print(vars,
138138 "extern $dllexport$const ProtobufCEnumDescriptor $lcclassname$__descriptor;\n");
148148 void EnumGenerator::GenerateValueInitializer(io::Printer *printer, int index)
149149 {
150150 const EnumValueDescriptor *vd = descriptor_->value(index);
151 std::map<string, string> vars;
151 std::map<std::string, std::string> vars;
152152 bool optimize_code_size = descriptor_->file()->options().has_optimize_for() &&
153153 descriptor_->file()->options().optimize_for() ==
154154 FileOptions_OptimizeMode_CODE_SIZE;
155155 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();
157157 vars["value"] = SimpleItoa(vd->number());
158158 if (optimize_code_size)
159159 printer->Print(vars, " { NULL, NULL, $value$ }, /* CODE_SIZE */\n");
181181 }
182182
183183 void EnumGenerator::GenerateEnumDescriptor(io::Printer* printer) {
184 std::map<string, string> vars;
184 std::map<std::string, std::string> vars;
185185 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());
188188 vars["shortname"] = descriptor_->name();
189189 vars["packagename"] = descriptor_->file()->package();
190190 vars["value_count"] = SimpleItoa(descriptor_->value_count());
8080 public:
8181 // See generator.cc for the meaning of dllexport_decl.
8282 explicit EnumGenerator(const EnumDescriptor* descriptor,
83 const string& dllexport_decl);
83 const std::string& dllexport_decl);
8484 ~EnumGenerator();
8585
8686 // Header stuff.
104104
105105 private:
106106 const EnumDescriptor* descriptor_;
107 string dllexport_decl_;
107 std::string dllexport_decl_;
108108
109109 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator);
110110 };
7474 // TODO(kenton): Factor out a "SetCommonFieldVariables()" to get rid of
7575 // repeat code between this and the other field types.
7676 void SetEnumVariables(const FieldDescriptor* descriptor,
77 std::map<string, string>* variables) {
77 std::map<std::string, std::string>* variables) {
7878
7979 (*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());
8181 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())
8383 + "__" + default_value->name();
8484 (*variables)["deprecated"] = FieldDeprecated(descriptor);
8585 }
113113 }
114114 }
115115
116 string EnumFieldGenerator::GetDefaultValue(void) const
116 std::string EnumFieldGenerator::GetDefaultValue(void) const
117117 {
118118 return variables_.find("default")->second;
119119 }
137137
138138 void EnumFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const
139139 {
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";
141141 GenerateDescriptorInitializerGeneric(printer, true, "ENUM", addr);
142142 }
143143
7979 // implements FieldGenerator ---------------------------------------
8080 void GenerateStructMembers(io::Printer* printer) const;
8181 void GenerateDescriptorInitializer(io::Printer* printer) const;
82 string GetDefaultValue(void) const;
82 std::string GetDefaultValue(void) const;
8383 void GenerateStaticInit(io::Printer* printer) const;
8484
8585 private:
86 std::map<string, string> variables_;
86 std::map<std::string, std::string> variables_;
8787
8888 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator);
8989 };
6969 namespace c {
7070
7171 ExtensionGenerator::ExtensionGenerator(const FieldDescriptor* descriptor,
72 const string& dllexport_decl)
72 const std::string& dllexport_decl)
7373 : descriptor_(descriptor),
7474 dllexport_decl_(dllexport_decl) {
7575 }
8484 public:
8585 // See generator.cc for the meaning of dllexport_decl.
8686 explicit ExtensionGenerator(const FieldDescriptor* descriptor,
87 const string& dllexport_decl);
87 const std::string& dllexport_decl);
8888 ~ExtensionGenerator();
8989
9090 // Header stuff.
9595
9696 private:
9797 const FieldDescriptor* descriptor_;
98 string type_traits_;
99 string dllexport_decl_;
98 std::string type_traits_;
99 std::string dllexport_decl_;
100100
101101 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
102102 };
6666 #include <protoc-c/c_enum_field.h>
6767 #include <protoc-c/c_message_field.h>
6868 #include <protoc-c/c_helpers.h>
69 #include <google/protobuf/descriptor.pb.h>
69 #include <protobuf-c/protobuf-c.pb.h>
7070 #include <google/protobuf/stubs/common.h>
7171 #include <google/protobuf/io/printer.h>
7272
102102
103103 void FieldGenerator::GenerateDescriptorInitializerGeneric(io::Printer* printer,
104104 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
107107 {
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);
109111 variables["TYPE"] = type_macro;
110 variables["classname"] = FullNameToC(FieldScope(descriptor_)->full_name());
112 variables["classname"] = FullNameToC(FieldScope(descriptor_)->full_name(), FieldScope(descriptor_)->file());
111113 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();
113118 variables["descriptor_addr"] = descriptor_addr;
114119 variables["value"] = SimpleItoa(descriptor_->number());
115 const OneofDescriptor *oneof = descriptor_->containing_oneof();
116120 if (oneof != NULL)
117 variables["oneofname"] = FullNameToLower(oneof->name());
121 variables["oneofname"] = CamelToLower(oneof->name());
118122
119123 if (FieldSyntax(descriptor_) == 3 &&
120124 descriptor_->label() == FieldDescriptor::LABEL_OPTIONAL) {
125129 }
126130
127131 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())
130134 + "__default_value";
131135 } else if (FieldSyntax(descriptor_) == 3 &&
132136 descriptor_->type() == FieldDescriptor::TYPE_STRING) {
202206 }
203207
204208 FieldGenerator* FieldGeneratorMap::MakeGenerator(const FieldDescriptor* field) {
209 const ProtobufCFieldOptions opt = field->options().GetExtension(pb_c_field);
205210 switch (field->type()) {
206211 case FieldDescriptor::TYPE_MESSAGE:
207212 return new MessageFieldGenerator(field);
208213 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);
210218 case FieldDescriptor::TYPE_BYTES:
211219 return new BytesFieldGenerator(field);
212220 case FieldDescriptor::TYPE_ENUM:
9090
9191 virtual void GenerateDefaultValueDeclarations(io::Printer* printer) const { }
9292 virtual void GenerateDefaultValueImplementations(io::Printer* printer) const { }
93 virtual string GetDefaultValue() const = 0;
93 virtual std::string GetDefaultValue() const = 0;
9494
9595 // Generate members to initialize this field from a static initializer
9696 virtual void GenerateStaticInit(io::Printer* printer) const = 0;
9999 protected:
100100 void GenerateDescriptorInitializerGeneric(io::Printer* printer,
101101 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;
104104 const FieldDescriptor *descriptor_;
105105
106106 private:
6767 #include <protoc-c/c_helpers.h>
6868 #include <protoc-c/c_message.h>
6969 #include <google/protobuf/io/printer.h>
70 #include <google/protobuf/descriptor.pb.h>
70 #include <protobuf-c/protobuf-c.pb.h>
7171
7272 #include "protobuf-c.h"
7373
7979 // ===================================================================
8080
8181 FileGenerator::FileGenerator(const FileDescriptor* file,
82 const string& dllexport_decl)
82 const std::string& dllexport_decl)
8383 : file_(file),
8484 message_generators_(
8585 new std::unique_ptr<MessageGenerator>[file->message_type_count()]),
109109 extension_generators_[i].reset(
110110 new ExtensionGenerator(file->extension(i), dllexport_decl));
111111 }
112
113 SplitStringUsing(file_->package(), ".", &package_parts_);
114112 }
115113
116114 FileGenerator::~FileGenerator() {}
117115
118116 void FileGenerator::GenerateHeader(io::Printer* printer) {
119 string filename_identifier = FilenameIdentifier(file_->name());
117 std::string filename_identifier = FilenameIdentifier(file_->name());
120118
121119 int min_header_version = 1000000;
122120 #if defined(HAVE_PROTO3)
156154 "protoc_version", SimpleItoa(PROTOBUF_C_VERSION_NUMBER));
157155
158156 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 }
162164 }
163165
164166 printer->Print("\n");
186188 }
187189
188190 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());
190198 }
191199
192200 printer->Print("/* --- per-message closures --- */\n\n");
237245 "filename", file_->name(),
238246 "basename", StripProto(file_->name()));
239247
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());
268260 }
269261 for (int i = 0; i < file_->enum_type_count(); i++) {
270262 enum_generators_[i]->GenerateEnumDescriptor(printer);
8989 public:
9090 // See generator.cc for the meaning of dllexport_decl.
9191 explicit FileGenerator(const FileDescriptor* file,
92 const string& dllexport_decl);
92 const std::string& dllexport_decl);
9393 ~FileGenerator();
9494
9595 void GenerateHeader(io::Printer* printer);
103103 std::unique_ptr<std::unique_ptr<ServiceGenerator>[]> service_generators_;
104104 std::unique_ptr<std::unique_ptr<ExtensionGenerator>[]> extension_generators_;
105105
106 // E.g. if the package is foo.bar, package_parts_ is {"foo", "bar"}.
107 std::vector<string> package_parts_;
108
109106 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FileGenerator);
110107 };
111108
6969 #include <protoc-c/c_helpers.h>
7070 #include <google/protobuf/io/printer.h>
7171 #include <google/protobuf/io/zero_copy_stream.h>
72 #include <google/protobuf/descriptor.pb.h>
72 #include <protobuf-c/protobuf-c.pb.h>
7373
7474 namespace google {
7575 namespace protobuf {
8080 // "foo=bar,baz,qux=corge"
8181 // parses to the pairs:
8282 // ("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;
8585 SplitStringUsing(text, ",", &parts);
8686
8787 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) {
9191 value.first = parts[i];
9292 value.second = "";
9393 } else {
102102 CGenerator::~CGenerator() {}
103103
104104 bool CGenerator::Generate(const FileDescriptor* file,
105 const string& parameter,
105 const std::string& parameter,
106106 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;
109112 ParseOptions(parameter, &options);
110113
111114 // -----------------------------------------------------------------
128131 // }
129132 // FOO_EXPORT is a macro which should expand to __declspec(dllexport) or
130133 // __declspec(dllimport) depending on what is being compiled.
131 string dllexport_decl;
134 std::string dllexport_decl;
132135
133136 for (unsigned i = 0; i < options.size(); i++) {
134137 if (options[i].first == "dllexport_decl") {
142145 // -----------------------------------------------------------------
143146
144147
145 string basename = StripProto(file->name());
148 std::string basename = StripProto(file->name());
146149 basename.append(".pb-c");
147150
148151 FileGenerator file_generator(file, dllexport_decl);
6767 #include <string>
6868 #include <google/protobuf/compiler/code_generator.h>
6969
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
7076 namespace google {
7177 namespace protobuf {
7278 namespace compiler {
7682 // header. If you create your own protocol compiler binary and you want
7783 // it to support C++ output, you can do so by registering an instance of this
7884 // CodeGenerator with the CommandLineInterface in your main() function.
79 class LIBPROTOC_EXPORT CGenerator : public CodeGenerator {
85 class PROTOC_C_EXPORT CGenerator : public CodeGenerator {
8086 public:
8187 CGenerator();
8288 ~CGenerator();
8389
8490 // implements CodeGenerator ----------------------------------------
8591 bool Generate(const FileDescriptor* file,
86 const string& parameter,
92 const std::string& parameter,
8793 OutputDirectory* output_directory,
88 string* error) const;
94 std::string* error) const;
8995
9096 private:
9197 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(CGenerator);
8686 #pragma warning(disable:4996)
8787 #endif
8888
89 string DotsToUnderscores(const string& name) {
89 std::string DotsToUnderscores(const std::string& name) {
9090 return StringReplace(name, ".", "_", true);
9191 }
9292
93 string DotsToColons(const string& name) {
93 std::string DotsToColons(const std::string& name) {
9494 return StringReplace(name, ".", "::", true);
9595 }
9696
97 string SimpleFtoa(float f) {
97 std::string SimpleFtoa(float f) {
9898 char buf[100];
9999 snprintf(buf,sizeof(buf),"%.*g", FLT_DIG, f);
100100 buf[sizeof(buf)-1] = 0; /* should NOT be necessary */
101101 return buf;
102102 }
103 string SimpleDtoa(double d) {
103 std::string SimpleDtoa(double d) {
104104 char buf[100];
105105 snprintf(buf,sizeof(buf),"%.*g", DBL_DIG, d);
106106 buf[sizeof(buf)-1] = 0; /* should NOT be necessary */
107107 return buf;
108108 }
109109
110 string CamelToUpper(const string &name) {
110 std::string CamelToUpper(const std::string &name) {
111111 bool was_upper = true; // suppress initial _
112 string rv = "";
112 std::string rv = "";
113113 int len = name.length();
114114 for (int i = 0; i < len; i++) {
115115 bool is_upper = isupper(name[i]);
124124 }
125125 return rv;
126126 }
127 string CamelToLower(const string &name) {
127 std::string CamelToLower(const std::string &name) {
128128 bool was_upper = true; // suppress initial _
129 string rv = "";
129 std::string rv = "";
130130 int len = name.length();
131131 for (int i = 0; i < len; i++) {
132132 bool is_upper = isupper(name[i]);
143143 }
144144
145145
146 string ToUpper(const string &name) {
147 string rv = "";
146 std::string ToUpper(const std::string &name) {
147 std::string rv = "";
148148 int len = name.length();
149149 for (int i = 0; i < len; i++) {
150150 rv += toupper(name[i]);
151151 }
152152 return rv;
153153 }
154 string ToLower(const string &name) {
155 string rv = "";
154 std::string ToLower(const std::string &name) {
155 std::string rv = "";
156156 int len = name.length();
157157 for (int i = 0; i < len; i++) {
158158 rv += tolower(name[i]);
159159 }
160160 return rv;
161161 }
162 string ToCamel(const string &name) {
163 string rv = "";
162 std::string ToCamel(const std::string &name) {
163 std::string rv = "";
164164 int len = name.length();
165165 bool next_is_upper = true;
166166 for (int i = 0; i < len; i++) {
176176 return rv;
177177 }
178178
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 = "";
183197 for (unsigned i = 0; i < pieces.size(); i++) {
184198 if (pieces[i] == "") continue;
185199 if (rv != "") rv += "__";
187201 }
188202 return rv;
189203 }
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 = "";
194209 for (unsigned i = 0; i < pieces.size(); i++) {
195210 if (pieces[i] == "") continue;
196211 if (rv != "") rv += "__";
198213 }
199214 return rv;
200215 }
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 = "";
205221 for (unsigned i = 0; i < pieces.size(); i++) {
206222 if (pieces[i] == "") continue;
207223 if (rv != "") rv += "__";
210226 return rv;
211227 }
212228
213 void PrintComment (io::Printer* printer, string comment)
229 void PrintComment (io::Printer* printer, std::string comment)
214230 {
215231 if (!comment.empty())
216232 {
217 std::vector<string> comment_lines;
233 std::vector<std::string> comment_lines;
218234 SplitStringUsing (comment, "\r\n", &comment_lines);
219235 printer->Print ("/*\n");
220236 for (int i = 0; i < comment_lines.size(); i++)
227243
228244 /* Or cause other compiler issues. */
229245 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)
231247 comment_lines[i][delim_i] = ' ';
232248
233 while ((delim_i = comment_lines[i].find("*/")) != string::npos)
249 while ((delim_i = comment_lines[i].find("*/")) != std::string::npos)
234250 comment_lines[i][delim_i + 1] = ' ';
235251
236252 printer->Print (" *$line$\n", "line", comment_lines[i]);
240256 }
241257 }
242258
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(), ' ');
245261 }
246262
247263 int compare_name_indices_by_name(const void *a, const void *b)
252268 }
253269
254270
255 string CEscape(const string& src);
271 std::string CEscape(const std::string& src);
256272
257273 const char* const kKeywordList[] = {
258274 "and", "and_eq", "asm", "auto", "bitand", "bitor", "bool", "break", "case",
267283 "void", "volatile", "wchar_t", "while", "xor", "xor_eq"
268284 };
269285
270 std::set<string> MakeKeywordsMap() {
271 std::set<string> result;
286 std::set<std::string> MakeKeywordsMap() {
287 std::set<std::string> result;
272288 for (int i = 0; i < GOOGLE_ARRAYSIZE(kKeywordList); i++) {
273289 result.insert(kKeywordList[i]);
274290 }
275291 return result;
276292 }
277293
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());
313298 if (kKeywords.count(result) > 0) {
314299 result.append("_");
315300 }
316301 return result;
317302 }
318303
319 string FieldDeprecated(const FieldDescriptor* field) {
304 std::string FieldDeprecated(const FieldDescriptor* field) {
320305 if (field->options().deprecated()) {
321306 return " PROTOBUF_C__DEPRECATED";
322307 }
323308 return "";
324309 }
325310
326 string StripProto(const string& filename) {
311 std::string StripProto(const std::string& filename) {
327312 if (HasSuffixString(filename, ".protodevel")) {
328313 return StripSuffixString(filename, ".protodevel");
329314 } else {
332317 }
333318
334319 // 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;
337322 for (unsigned i = 0; i < filename.size(); i++) {
338323 if (isalnum(filename[i])) {
339324 result.push_back(filename[i]);
349334 }
350335
351336 // 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) {
353338 return "proto_BuildDescriptors_" + FilenameIdentifier(filename);
354339 }
355340
356 string GetLabelName(FieldDescriptor::Label label) {
341 std::string GetLabelName(FieldDescriptor::Label label) {
357342 switch (label) {
358343 case FieldDescriptor::LABEL_OPTIONAL: return "optional";
359344 case FieldDescriptor::LABEL_REQUIRED: return "required";
363348 }
364349
365350 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)
367352 {
368 std::map<string, string> vars;
353 std::map<std::string, std::string> vars;
369354 vars["name"] = name;
370355 if (n_values > 0) {
371356 int n_ranges = 1;
419404 // it only replaces the first instance of "old."
420405 // ----------------------------------------------------------------------
421406
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) {
425410 if (oldsub.empty()) {
426411 res->append(s); // if empty, append the given string.
427412 return;
428413 }
429414
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;
432417 do {
433418 pos = s.find(oldsub, start_pos);
434 if (pos == string::npos) {
419 if (pos == std::string::npos) {
435420 break;
436421 }
437422 res->append(s, start_pos, pos - start_pos);
451436 // happened or not.
452437 // ----------------------------------------------------------------------
453438
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;
457442 StringReplace(s, oldsub, newsub, replace_all, &ret);
458443 return ret;
459444 }
468453 // ----------------------------------------------------------------------
469454 template <typename ITR>
470455 static inline
471 void SplitStringToIteratorUsing(const string& full,
456 void SplitStringToIteratorUsing(const std::string& full,
472457 const char* delim,
473458 ITR& result) {
474459 // Optimize the common case where delim is a single character.
482467 } else {
483468 const char* start = p;
484469 while (++p != end && *p != c);
485 *result++ = string(start, p - start);
470 *result++ = std::string(start, p - start);
486471 }
487472 }
488473 return;
489474 }
490475
491 string::size_type begin_index, end_index;
476 std::string::size_type begin_index, end_index;
492477 begin_index = full.find_first_not_of(delim);
493 while (begin_index != string::npos) {
478 while (begin_index != std::string::npos) {
494479 end_index = full.find_first_of(delim, begin_index);
495 if (end_index == string::npos) {
480 if (end_index == std::string::npos) {
496481 *result++ = full.substr(begin_index);
497482 return;
498483 }
501486 }
502487 }
503488
504 void SplitStringUsing(const string& full,
489 void SplitStringUsing(const std::string& full,
505490 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);
508493 SplitStringToIteratorUsing(full, delim, it);
509494 }
510495
557542 dest[used] = '\0'; // doesn't count towards return value though
558543 return used;
559544 }
560 string CEscape(const string& src) {
545 std::string CEscape(const std::string& src) {
561546 const int dest_length = src.size() * 4 + 1; // Maximum possible expansion
562547 std::unique_ptr<char[]> dest(new char[dest_length]);
563548 const int len = CEscapeInternal(src.data(), src.size(),
564549 dest.get(), dest_length, false);
565550 GOOGLE_DCHECK_GE(len, 0);
566 return string(dest.get(), len);
551 return std::string(dest.get(), len);
567552 }
568553
569554 } // namespace c
6666 #include <vector>
6767 #include <sstream>
6868 #include <google/protobuf/descriptor.h>
69 #include <google/protobuf/descriptor.pb.h>
69 #include <protobuf-c/protobuf-c.pb.h>
7070 #include <google/protobuf/io/printer.h>
7171
7272 namespace google {
7474 namespace compiler {
7575 namespace c {
7676
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
8877 // --- Borrowed from stubs. ---
89 template <typename T> string SimpleItoa(T n) {
78 template <typename T> std::string SimpleItoa(T n) {
9079 std::stringstream stream;
9180 stream << n;
9281 return stream.str();
9382 }
9483
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; } }
10291 char* FastHexToBuffer(int i, char* buffer);
10392
10493
10695 // The name is coerced to lower-case to emulate proto1 behavior. People
10796 // should be using lowercase-with-underscores style for proto field names
10897 // anyway, so normally this just returns field->name().
109 string FieldName(const FieldDescriptor* field);
98 std::string FieldName(const FieldDescriptor* field);
11099
111100 // Get macro string for deprecated field
112 string FieldDeprecated(const FieldDescriptor* field);
101 std::string FieldDeprecated(const FieldDescriptor* field);
113102
114103 // Returns the scope where the field was defined (for extensions, this is
115104 // different from the message type to which the field applies).
120109
121110 // convert a CamelCase class name into an all uppercase affair
122111 // 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);
125114
126115 // lowercased, underscored name to camel case
127 string ToCamel(const string &name);
116 std::string ToCamel(const std::string &name);
128117
129118 // 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);
132121
133122 // 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);
136125
137126 // 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);
139128
140129 // Splits, indents, formats, and prints comment lines
141 void PrintComment (io::Printer* printer, string comment);
130 void PrintComment (io::Printer* printer, std::string comment);
142131
143132 // make a string of spaces as long as input
144 string ConvertToSpaces(const string &input);
133 std::string ConvertToSpaces(const std::string &input);
145134
146135 // Strips ".proto" or ".protodevel" from the end of a filename.
147 string StripProto(const string& filename);
136 std::string StripProto(const std::string& filename);
148137
149138 // Get the C++ type name for a primitive type (e.g. "double", "::google::protobuf::int32", etc.).
150139 // Note: non-built-in type names will be qualified, meaning they will start
158147 const char* DeclaredTypeMethodName(FieldDescriptor::Type type);
159148
160149 // Convert a file name into a valid identifier.
161 string FilenameIdentifier(const string& filename);
150 std::string FilenameIdentifier(const std::string& filename);
162151
163152 // 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);
165154
166155 // return 'required', 'optional', or 'repeated'
167 string GetLabelName(FieldDescriptor::Label label);
156 std::string GetLabelName(FieldDescriptor::Label label);
168157
169158
170159 // write IntRanges entries for a bunch of sorted values.
171160 // 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);
173162
174163 struct NameIndex
175164 {
6969 #include <google/protobuf/io/printer.h>
7070 #include <google/protobuf/io/coded_stream.h>
7171 #include <google/protobuf/wire_format.h>
72 #include <google/protobuf/descriptor.pb.h>
72 #include <protobuf-c/protobuf-c.pb.h>
7373
7474 namespace google {
7575 namespace protobuf {
7979 // ===================================================================
8080
8181 MessageGenerator::MessageGenerator(const Descriptor* descriptor,
82 const string& dllexport_decl)
82 const std::string& dllexport_decl)
8383 : descriptor_(descriptor),
8484 dllexport_decl_(dllexport_decl),
8585 field_generators_(descriptor),
110110
111111 void MessageGenerator::
112112 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()));
115115
116116 for (int i = 0; i < descriptor_->nested_type_count(); i++) {
117117 nested_generators_[i]->GenerateStructTypedef(printer);
136136 nested_generators_[i]->GenerateStructDefinition(printer);
137137 }
138138
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());
143143 vars["field_count"] = SimpleItoa(descriptor_->field_count());
144144 if (dllexport_decl_.empty()) {
145145 vars["dllexport"] = "";
152152 const OneofDescriptor *oneof = descriptor_->oneof_decl(i);
153153 vars["opt_comma"] = ",";
154154
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());
157157
158158 printer->Print("typedef enum {\n");
159159 printer->Indent();
160160 printer->Print(vars, "$ucclassname$__$oneofname$__NOT_SET = 0,\n");
161161 for (int j = 0; j < oneof->field_count(); j++) {
162162 const FieldDescriptor *field = oneof->field(j);
163 vars["fieldname"] = FullNameToUpper(field->name());
163 vars["fieldname"] = CamelToUpper(field->name());
164164 vars["fieldnum"] = SimpleItoa(field->number());
165165 bool isLast = j == oneof->field_count() - 1;
166166 if (isLast) {
168168 }
169169 printer->Print(vars, "$ucclassname$__$oneofname$_$fieldname$ = $fieldnum$$opt_comma$\n");
170170 }
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");
172172 printer->Outdent();
173173 printer->Print(vars, "} $foneofname$Case;\n\n");
174174 }
177177 descriptor_->GetSourceLocation(&msgSourceLoc);
178178 PrintComment (printer, msgSourceLoc.leading_comments);
179179
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"
182186 "{\n"
183 " ProtobufCMessage base;\n");
187 " ProtobufCMessage $base$;\n");
184188
185189 // Generate fields.
186190 printer->Indent();
199203 // Generate unions from oneofs.
200204 for (int i = 0; i < descriptor_->oneof_decl_count(); i++) {
201205 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());
204208
205209 printer->Print(vars, "$foneofname$Case $oneofname$_case;\n");
206210
240244 }
241245 for (int i = 0; i < descriptor_->oneof_decl_count(); i++) {
242246 const OneofDescriptor *oneof = descriptor_->oneof_decl(i);
243 vars["foneofname"] = FullNameToUpper(oneof->full_name());
247 vars["foneofname"] = FullNameToUpper(oneof->full_name(), oneof->file());
244248 // Initialize the case enum
245249 printer->Print(vars, ", $foneofname$__NOT_SET");
246250 // Initialize the union
251255 }
252256
253257 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)
255262 {
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
256272 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,
264284 "/* $classname$ methods */\n"
265285 "void $lcclassname$__init\n"
266286 " ($classname$ *message);\n"
267287 );
268 if (!is_submessage) {
288 }
289 if (gen_pack) {
269290 printer->Print(vars,
270291 "size_t $lcclassname$__get_packed_size\n"
271292 " (const $classname$ *message);\n"
290311 void MessageGenerator::
291312 GenerateDescriptorDeclarations(io::Printer* printer) {
292313 printer->Print("extern const ProtobufCMessageDescriptor $name$__descriptor;\n",
293 "name", FullNameToLower(descriptor_->full_name()));
314 "name", FullNameToLower(descriptor_->full_name(), descriptor_->file()));
294315
295316 for (int i = 0; i < descriptor_->nested_type_count(); i++) {
296317 nested_generators_[i]->GenerateDescriptorDeclarations(printer);
305326 for (int i = 0; i < descriptor_->nested_type_count(); i++) {
306327 nested_generators_[i]->GenerateClosureTypedef(printer);
307328 }
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());
310331 printer->Print(vars,
311332 "typedef void (*$name$_Closure)\n"
312333 " (const $name$ *message,\n"
324345 }
325346
326347 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)
328352 {
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
329362 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,
338376 "void $lcclassname$__init\n"
339377 " ($classname$ *message)\n"
340378 "{\n"
341379 " static const $classname$ init_value = $ucclassname$__INIT;\n"
342380 " *message = init_value;\n"
343381 "}\n");
344 if (!is_submessage) {
382 }
383 if (gen_pack) {
345384 printer->Print(vars,
346385 "size_t $lcclassname$__get_packed_size\n"
347386 " (const $classname$ *message)\n"
348387 "{\n"
349 " assert(message->base.descriptor == &$lcclassname$__descriptor);\n"
388 " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n"
350389 " return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));\n"
351390 "}\n"
352391 "size_t $lcclassname$__pack\n"
353392 " (const $classname$ *message,\n"
354393 " uint8_t *out)\n"
355394 "{\n"
356 " assert(message->base.descriptor == &$lcclassname$__descriptor);\n"
395 " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n"
357396 " return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);\n"
358397 "}\n"
359398 "size_t $lcclassname$__pack_to_buffer\n"
360399 " (const $classname$ *message,\n"
361400 " ProtobufCBuffer *buffer)\n"
362401 "{\n"
363 " assert(message->base.descriptor == &$lcclassname$__descriptor);\n"
402 " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n"
364403 " return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);\n"
365404 "}\n"
366405 "$classname$ *\n"
379418 "{\n"
380419 " if(!message)\n"
381420 " return;\n"
382 " assert(message->base.descriptor == &$lcclassname$__descriptor);\n"
421 " assert(message->$base$.descriptor == &$lcclassname$__descriptor);\n"
383422 " protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);\n"
384423 "}\n"
385424 );
387426 }
388427
389428 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;
392431 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());
395434 vars["shortname"] = ToCamel(descriptor_->name());
396435 vars["n_fields"] = SimpleItoa(descriptor_->field_count());
397436 vars["packagename"] = descriptor_->file()->package();
400439 descriptor_->file()->options().optimize_for() ==
401440 FileOptions_OptimizeMode_CODE_SIZE;
402441
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
403448 for (int i = 0; i < descriptor_->nested_type_count(); i++) {
404 nested_generators_[i]->GenerateMessageDescriptor(printer);
449 nested_generators_[i]->GenerateMessageDescriptor(printer, gen_init);
405450 }
406451
407452 for (int i = 0; i < descriptor_->enum_type_count(); i++) {
417462
418463 for (int i = 0; i < descriptor_->field_count(); i++) {
419464 const FieldDescriptor *fd = descriptor_->field(i);
465 const ProtobufCFieldOptions opt = fd->options().GetExtension(pb_c_field);
420466 if (fd->has_default_value()) {
421467
422468 bool already_defined = false;
455501 GOOGLE_LOG(DFATAL) << "Messages can't have default values!";
456502 break;
457503 case FieldDescriptor::CPPTYPE_STRING:
458 if (fd->type() == FieldDescriptor::TYPE_BYTES)
504 if (fd->type() == FieldDescriptor::TYPE_BYTES || opt.string_as_bytes())
459505 {
460506 vars["field_dv_ctype"] = "ProtobufCBinaryData";
461507 }
470516 case FieldDescriptor::CPPTYPE_ENUM:
471517 {
472518 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());
474520 break;
475521 }
476522 default:
567613 }
568614 printer->Print(vars,
569615 " $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,
572625 " NULL,NULL,NULL /* reserved[123] */\n"
573626 "};\n");
574627 }
8585 public:
8686 // See generator.cc for the meaning of dllexport_decl.
8787 explicit MessageGenerator(const Descriptor* descriptor,
88 const string& dllexport_decl);
88 const std::string& dllexport_decl);
8989 ~MessageGenerator();
9090
9191 // Header stuff.
110110 void GenerateStructStaticInitMacro(io::Printer* printer);
111111
112112 // 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);
114117
115118 // Source file stuff.
116119
117120 // Generate code that initializes the global variable storing the message's
118121 // 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);
121127
122128 private:
123129
124 string GetDefaultValueC(const FieldDescriptor *fd);
130 std::string GetDefaultValueC(const FieldDescriptor *fd);
125131
126132 const Descriptor* descriptor_;
127 string dllexport_decl_;
133 std::string dllexport_decl_;
128134 FieldGeneratorMap field_generators_;
129135 std::unique_ptr<std::unique_ptr<MessageGenerator>[]> nested_generators_;
130136 std::unique_ptr<std::unique_ptr<EnumGenerator>[]> enum_generators_;
8282
8383 void MessageFieldGenerator::GenerateStructMembers(io::Printer* printer) const
8484 {
85 std::map<string, string> vars;
85 std::map<std::string, std::string> vars;
8686 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());
8888 vars["deprecated"] = FieldDeprecated(descriptor_);
8989 switch (descriptor_->label()) {
9090 case FieldDescriptor::LABEL_REQUIRED:
9797 break;
9898 }
9999 }
100 string MessageFieldGenerator::GetDefaultValue(void) const
100 std::string MessageFieldGenerator::GetDefaultValue(void) const
101101 {
102102 /* XXX: update when protobuf gets support
103103 * for default-values of message fields.
118118 }
119119 void MessageFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const
120120 {
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";
122122 GenerateDescriptorInitializerGeneric(printer, false, "MESSAGE", addr);
123123 }
124124
7979 // implements FieldGenerator ---------------------------------------
8080 void GenerateStructMembers(io::Printer* printer) const;
8181 void GenerateDescriptorInitializer(io::Printer* printer) const;
82 string GetDefaultValue(void) const;
82 std::string GetDefaultValue(void) const;
8383 void GenerateStaticInit(io::Printer* printer) const;
8484
8585 private:
7878
7979 void PrimitiveFieldGenerator::GenerateStructMembers(io::Printer* printer) const
8080 {
81 string c_type;
82 std::map<string, string> vars;
81 std::string c_type;
82 std::map<std::string, std::string> vars;
8383 switch (descriptor_->type()) {
8484 case FieldDescriptor::TYPE_SINT32 :
8585 case FieldDescriptor::TYPE_SFIXED32:
122122 break;
123123 }
124124 }
125 string PrimitiveFieldGenerator::GetDefaultValue() const
125 std::string PrimitiveFieldGenerator::GetDefaultValue() const
126126 {
127127 /* XXX: SimpleItoa seems woefully inadequate for anything but int32,
128128 * but that's what protobuf uses. */
148148 }
149149 void PrimitiveFieldGenerator::GenerateStaticInit(io::Printer* printer) const
150150 {
151 std::map<string, string> vars;
151 std::map<std::string, std::string> vars;
152152 if (descriptor_->has_default_value()) {
153153 vars["default_value"] = GetDefaultValue();
154154 } else {
171171
172172 void PrimitiveFieldGenerator::GenerateDescriptorInitializer(io::Printer* printer) const
173173 {
174 string c_type_macro;
174 std::string c_type_macro;
175175 switch (descriptor_->type()) {
176176 #define WRITE_CASE(shortname) case FieldDescriptor::TYPE_##shortname: c_type_macro = #shortname; break;
177177 WRITE_CASE(INT32)
7979 // implements FieldGenerator ---------------------------------------
8080 void GenerateStructMembers(io::Printer* printer) const;
8181 void GenerateDescriptorInitializer(io::Printer* printer) const;
82 string GetDefaultValue(void) const;
82 std::string GetDefaultValue(void) const;
8383 void GenerateStaticInit(io::Printer* printer) const;
8484
8585 private:
6969 namespace c {
7070
7171 ServiceGenerator::ServiceGenerator(const ServiceDescriptor* descriptor,
72 const string& dllexport_decl)
72 const std::string& dllexport_decl)
7373 : descriptor_(descriptor) {
7474 vars_["name"] = descriptor_->name();
7575 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());
7979 vars_["lcfullpadd"] = ConvertToSpaces(vars_["lcfullname"]);
8080 vars_["package"] = descriptor_->file()->package();
8181 if (dllexport_decl.empty()) {
9797 void ServiceGenerator::GenerateVfuncs(io::Printer* printer)
9898 {
9999 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"
102102 "{\n"
103103 " ProtobufCService base;\n");
104104 for (int i = 0; i < descriptor_->method_count(); i++) {
105105 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());
111111 printer->Print(vars_,
112112 " void (*$method$)($cname$_Service *service,\n"
113113 " $metpad$ const $input_typename$ *input,\n"
130130 " { $ucfullname$__BASE_INIT");
131131 for (int i = 0; i < descriptor_->method_count(); i++) {
132132 const MethodDescriptor *method = descriptor_->method(i);
133 string lcname = CamelToLower(method->name());
133 std::string lcname = CamelToLower(method->name());
134134 vars_["method"] = lcname;
135135 vars_["metpad"] = ConvertToSpaces(lcname);
136136 printer->Print(vars_,
143143 {
144144 for (int i = 0; i < descriptor_->method_count(); i++) {
145145 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());
152152 vars_["padddddddddddddddddd"] = ConvertToSpaces(lcfullname + "__" + lcname);
153153 printer->Print(vars_,
154154 "void $lcfullname$__$method$(ProtobufCService *service,\n"
207207 for (int i = 0; i < n_methods; i++) {
208208 const MethodDescriptor *method = descriptor_->method(i);
209209 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";
212212 if (optimize_code_size) {
213213 printer->Print(vars_,
214214 " { NULL, $input_descriptor$, $output_descriptor$ }, /* CODE_SIZE */\n");
265265 {
266266 for (int i = 0; i < descriptor_->method_count(); i++) {
267267 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());
274274 vars_["padddddddddddddddddd"] = ConvertToSpaces(lcfullname + "__" + lcname);
275275 vars_["index"] = SimpleItoa(i);
276276
8181 public:
8282 // See generator.cc for the meaning of dllexport_decl.
8383 explicit ServiceGenerator(const ServiceDescriptor* descriptor,
84 const string& dllexport_decl);
84 const std::string& dllexport_decl);
8585 ~ServiceGenerator();
8686
8787 // Header stuff.
9898 void GenerateCallersImplementations(io::Printer* printer);
9999
100100 const ServiceDescriptor* descriptor_;
101 std::map<string, string> vars_;
101 std::map<std::string, std::string> vars_;
102102
103103 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ServiceGenerator);
104104 };
6363 #include <protoc-c/c_helpers.h>
6464 #include <google/protobuf/io/printer.h>
6565 #include <google/protobuf/wire_format.h>
66 #include <google/protobuf/descriptor.pb.h>
66 #include <protobuf-c/protobuf-c.pb.h>
6767
6868 namespace google {
6969 namespace protobuf {
7373 using internal::WireFormat;
7474
7575 void SetStringVariables(const FieldDescriptor* descriptor,
76 std::map<string, string>* variables) {
76 std::map<std::string, std::string>* variables) {
7777 (*variables)["name"] = FieldName(descriptor);
78 (*variables)["default"] = FullNameToLower(descriptor->full_name())
78 (*variables)["default"] = FullNameToLower(descriptor->full_name(), descriptor->file())
7979 + "__default_value";
8080 (*variables)["deprecated"] = FieldDeprecated(descriptor);
8181 }
9292
9393 void StringFieldGenerator::GenerateStructMembers(io::Printer* printer) const
9494 {
95 const ProtobufCFileOptions opt = descriptor_->file()->options().GetExtension(pb_c_file);
96
9597 switch (descriptor_->label()) {
9698 case FieldDescriptor::LABEL_REQUIRED:
9799 case FieldDescriptor::LABEL_OPTIONAL:
100 if (opt.const_strings())
101 printer->Print(variables_, "const ");
98102 printer->Print(variables_, "char *$name$$deprecated$;\n");
99103 break;
100104 case FieldDescriptor::LABEL_REPEATED:
101105 printer->Print(variables_, "size_t n_$name$$deprecated$;\n");
106 if (opt.const_strings())
107 printer->Print(variables_, "const ");
102108 printer->Print(variables_, "char **$name$$deprecated$;\n");
103109 break;
104110 }
109115 }
110116 void StringFieldGenerator::GenerateDefaultValueImplementations(io::Printer* printer) const
111117 {
112 std::map<string, string> vars;
118 std::map<std::string, std::string> vars;
113119 vars["default"] = variables_.find("default")->second;
114120 vars["escaped"] = CEscape(descriptor_->default_value_string());
115121 printer->Print(vars, "char $default$[] = \"$escaped$\";\n");
116122 }
117123
118 string StringFieldGenerator::GetDefaultValue(void) const
124 std::string StringFieldGenerator::GetDefaultValue(void) const
119125 {
120126 return variables_.find("default")->second;
121127 }
122128 void StringFieldGenerator::GenerateStaticInit(io::Printer* printer) const
123129 {
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);
125132 if (descriptor_->has_default_value()) {
126133 vars["default"] = GetDefaultValue();
127134 } else if (FieldSyntax(descriptor_) == 2) {
128135 vars["default"] = "NULL";
136 } else if (opt.const_strings()) {
137 vars["default"] = "(const char *)protobuf_c_empty_string";
129138 } else {
130139 vars["default"] = "(char *)protobuf_c_empty_string";
131140 }
8181 void GenerateDescriptorInitializer(io::Printer* printer) const;
8282 void GenerateDefaultValueDeclarations(io::Printer* printer) const;
8383 void GenerateDefaultValueImplementations(io::Printer* printer) const;
84 string GetDefaultValue(void) const;
84 std::string GetDefaultValue(void) const;
8585 void GenerateStaticInit(io::Printer* printer) const;
8686
8787 private:
88 std::map<string, string> variables_;
88 std::map<std::string, std::string> variables_;
8989
9090 GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(StringFieldGenerator);
9191 };
5555 T(0), T(2097152), T(268435455), T(127), T(16383), T(16384) };
5656 #undef T
5757
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" };
431431 #undef DO_TEST
432432 }
433433
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
434467 /* === Optional type fields === */
435468 static void test_empty_optional (void)
436469 {
12401273 {
12411274
12421275 #define DO_TEST(static_array, example_packed_data) \
1243 DO_TEST_REPEATED(test_string, (char **), \
1276 DO_TEST_REPEATED(test_string, (const char **), \
12441277 static_array, example_packed_data, \
12451278 STRING_EQUALS)
12461279
20752108 Foo__TestMessageCheck__SubMessage sm = FOO__TEST_MESSAGE_CHECK__SUB_MESSAGE__INIT;
20762109 Foo__TestMessageCheck__SubMessage sm2 = FOO__TEST_MESSAGE_CHECK__SUB_MESSAGE__INIT;
20772110 Foo__TestMessageCheck m = FOO__TEST_MESSAGE_CHECK__INIT;
2078 char *null = NULL;
2079 char *str = "";
2111 const char *null = NULL;
2112 const char *str = "";
20802113 Foo__TestMessageCheck__SubMessage *sm_p;
20812114 ProtobufCBinaryData bd;
20822115
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 }
77 {
88 assert(_MESSAGE_TYPE1__FLAG_IS_INT_SIZE == INT_MAX);
99 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);
1111 return EXIT_SUCCESS;
1212 }
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 }
00 package foo;
1
2 import "protobuf-c/protobuf-c.proto";
3
4 option (pb_c_file).const_strings = true;
15
26 message SubMess {
37 required int32 test = 4;
1014 repeated int32 rep = 4;
1115 optional bytes bytes1 = 2 [default = "a \0 char"];
1216 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];
1319 }
1420 optional SubSubMess sub1 = 9;
1521 optional SubSubMess sub2 = 10;
114120 }
115121
116122 message TestMessOptional {
123 option (pb_c_msg).gen_pack_helpers = false;
124 option (pb_c_msg).gen_init_helpers = false;
117125 optional int32 test_int32 = 1;
118126 optional sint32 test_sint32 = 2;
119127 optional sfixed32 test_sfixed32 = 3;
00 package foo;
1
2 import "protobuf-c/protobuf-c.proto";
3
4 option (pb_c_file).c_package = "foo";
15
26 message Person {
37 required string name = 1;