577 Commits

Author SHA1 Message Date
Robert Edmonds
17d26c0af5 ChangeLog: doc updates 2014-06-09 16:49:58 -04:00
Robert Edmonds
cbb0f3dd0d doc/c-code-generator.{html,xml}: delete
most of the relevant material has now been updated and incorporated into
the doxygen documentation.
2014-06-09 16:31:53 -04:00
Robert Edmonds
3e126545b1 protobuf-c: add doxygen documentation derived from doc/c-code-generator.xml 2014-06-09 16:31:41 -04:00
Robert Edmonds
fc266579b8 add doxygen documentation for the protobuf-c implementation
based heavily on kevin lyda's work in PR #140.
2014-06-07 14:40:41 -04:00
Robert Edmonds
21382d1fca protobuf-c: consistently use TRUE and FALSE instead of 1 and 0
partially based on hunks split out of kevin lyda's PR #140.
2014-06-07 14:40:03 -04:00
Robert Edmonds
d14bb42d40 add doxygen documentation for the public header file
this also significantly reorganizes the header file.

based heavily on kevin lyda's work in PR #140.
2014-06-07 14:40:03 -04:00
Robert Edmonds
8655ca076d PROTOBUF_C_{NO_,}DEPRECATED -> PROTOBUF_C__{NO_,}DEPRECATED
these identifiers aren't intended for use by client code. add a double
underscore to indicate this.
2014-06-06 14:55:11 -04:00
Robert Edmonds
d05795c335 PROTOBUF_C_API -> PROTOBUF_C__API
this identifier isn't intended for use by client code. add a double
underscore to indicate this.
2014-06-06 14:52:29 -04:00
Robert Edmonds
af5120e678 PROTOBUF_C_{BEGIN,END}_DECLS -> PROTOBUF_C__{BEGIN,END}_DECLS
these identifiers aren't intended for use by client code. add a double
underscore to indicate this.
2014-06-06 14:50:14 -04:00
Andrei Nigmatulin
94e7cde263 cosmetics 2014-06-06 14:48:59 -04:00
Robert Edmonds
c96fee16c2 PROTOBUF_C_OFFSETOF -> offsetof
offsetof() conforms to the C89 standard, just call it directly.
2014-06-04 17:28:51 -04:00
Robert Edmonds
a1fa70c9b7 'struct _ProtobufC' -> 'struct ProtobufC'
identifiers in any scope that begin with an underscore and a capital
letter are reserved in C.
2014-06-04 17:25:45 -04:00
Robert Edmonds
97b6aa368b use double underscores in the MAGIC identifiers
these magic constants aren't intended for use by client code. add a
double underscore to indicate this.
2014-06-04 17:17:15 -04:00
Robert Edmonds
d0cadf1a4a PROTOBUF_C_ASSERT -> assert
assert() conforms to the C89 standard, just call it directly.
2014-06-04 17:14:44 -04:00
Robert Edmonds
298066893e remove PROTOBUF_C_ASSERT_NOT_REACHED from the public API
this macro isn't used anywhere except in the libprotobuf-c
implementation.
2014-06-04 17:11:49 -04:00
Robert Edmonds
6df737e0ca Doxyfile.in: enable MACRO_EXPANSION
this avoids littering function definitions in the documentation with
"PROTOBUF_C_API".
2014-06-03 17:57:27 -04:00
Robert Edmonds
ecc4febaba _PROTOBUF_C_FORCE_ENUM_TO_BE_INT_SIZE -> PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE
identifiers that begin with an underscore are reserved. instead, use a
double underscore in the *middle* of the identifier to indicate that
it's an "internal" identifier.
2014-06-03 17:43:21 -04:00
Robert Edmonds
de041d44ff protobuf-c: __PROTOBUF_C_RUNTIME_H_ -> PROTOBUF_C_H
identifiers that begin with a double underscore are reserved.
2014-06-03 17:39:49 -04:00
Robert Edmonds
0df53ea0c5 switch to a more automake-ish method of generating the html doxygen documentation 2014-06-03 17:30:13 -04:00
Robert Edmonds
e38b90f52b DoxygenLayout.xml: initial customizations 2014-06-03 17:29:22 -04:00
Robert Edmonds
aa5617bc1f Doxyfile.in: initial customizations 2014-06-03 17:29:22 -04:00
Robert Edmonds
693f98dea7 DoxygenLayout.xml: new
this is the unmodified output from "doxygen -l DoxygenLayout.xml".
2014-06-03 17:00:44 -04:00
Robert Edmonds
ef418275f2 Doxyfile.in: new
this is the completely unmodified output output from running
"doxygen -g Doxyfile.in".  (note that this is doxygen 1.8.7.)

customization will come in a subsequent commit so that we have a record
of exactly what was changed from the default values.
2014-06-03 16:37:44 -04:00
Robert Edmonds
d46d52dfaa configure.ac: use the 5-argument form of AC_INIT() and also define our own PACKAGE_DESCRIPTION 2014-06-03 16:34:38 -04:00
Robert Edmonds
9fa749d679 loosen the coupling between protoc-c and the protobuf-c headers
exact version coupling between the compiler and the public headers is
too strict because some existing projects (such as collectd,
riemann-c-client, and nmsg) directly embed .pb-c.h files generated by
protoc-c into their exported headers. this would cause unnecessary build
failures in downstream clients of these libraries if a newer version of
the protobuf-c headers is installed.

however, it's still desireable to be able to explicitly declare when
compatibility is broken between the headers and the compiler, so
introduce new variables that allow independently setting the minimum
header version required by the compiler and the minimum compiler version
required by the header.

this follows the protobuf C++ implementation a little bit more closely,
though we don't have an analogous facility for verifying that the header
and *library* are compatible. (this seems like overkill for a C project;
in practice the headers and the library will be from the same version,
especially in downstream distributors like debian where the -dev package
has an exact versioned dependency on the shared library package.)
2014-06-03 13:54:50 -04:00
Robert Edmonds
f406c9c537 protobuf-c/libprotobuf-c.pc.in: export the 'bindir' variable 2014-06-02 18:34:21 -04:00
Robert Edmonds
fd53cf5516 README.md: add coveralls.io badge 2014-06-02 18:17:02 -04:00
Robert Edmonds
1dc2c8dd78 ChangeLog: --enable-code-coverage 2014-06-02 18:05:22 -04:00
Robert Edmonds
54881f489b .travis.yml: enable code coverage checks and upload data to coveralls.io 2014-06-02 18:04:35 -04:00
Robert Edmonds
e72e7e7e81 add code coverage option to the build system
configure now has a "--enable-code-coverage" option, and if the
lcov/gcov tools are available a code coverage report can be built with
"make check-code-coverage".

this is mostly based on the AX_CODE_COVERAGE / GNOME_CODE_COVERAGE
macro:

    http://savannah.gnu.org/patch/?8451

but i also looked at knot-dns's code coverage implementation:

    https://github.com/CZNIC-Labs/knot/blob/master/m4/code-coverage.m4

and kevin lyda's pull request:

    https://github.com/protobuf-c/protobuf-c/pull/131/files
2014-06-02 17:56:41 -04:00
Robert Edmonds
44a71ee675 ChangeLog: fix formatting of author names 2014-05-30 17:25:34 -04:00
Robert Edmonds
c89aaed7c4 README.md: link to the protobuf project, not the Protocol Buffers documentation 2014-04-05 14:35:08 -04:00
Robert Edmonds
a4030b5689 README.md: update the overview 2014-04-05 14:34:09 -04:00
Robert Edmonds
1b7dfbbf6d README.md: update the synopsis 2014-04-05 14:28:09 -04:00
Robert Edmonds
66f608be48 README.md: add a "Mailing list" section near the top 2014-04-05 14:13:10 -04:00
Robert Edmonds
c11a598e3c protobuf-c: bump PROTOBUF_C_VERSION to 1.0.0-rc1 v1.0.0-rc1 2014-04-04 19:23:42 -04:00
Robert Edmonds
84be226396 configure.ac: bump version to 1.0.0-rc1 2014-04-04 19:21:31 -04:00
Robert Edmonds
9eb868d33d TODO: remove 'dispatch-within-dispatch'
it's related to the RPC code, and that's been split out into
protobuf-c-rpc now.
2014-04-04 19:20:51 -04:00
Robert Edmonds
5353ba7432 Makefile.am: ship LICENSE and README.md in the tarball 2014-04-03 19:08:21 -04:00
Robert Edmonds
cbb27d53c8 ProtobufCFieldFlagType -> ProtobufCFieldFlag
this was inadvertently reverted when i was editing e9627054.
2014-04-03 18:36:26 -04:00
Robert Edmonds
58c9e066e7 ChangeLog: protoc-c/protobuf-c.h version coupling 2014-04-03 18:26:19 -04:00
Robert Edmonds
c7c7850b51 tightly couple protoc-c output with the protobuf-c headers
this adds a version guard like the protobuf C++ implementation. it
ensures that protoc-c and <protobuf-c.h> are from the exact same version
of protobuf-c.
2014-04-03 18:19:00 -04:00
Robert Edmonds
516f72286a ChangeLog: versioning updates related to Issue #53 2014-04-03 17:58:04 -04:00
Robert Edmonds
626b138fa6 t/: add new test program 'version' 2014-04-03 17:09:39 -04:00
Robert Edmonds
c821ac3c83 rework header/library versioning
this replaces the changes in Issue #53 with a slightly different way of
representing / retrieving the version number.

protobuf_c_version() returns the version of the *library* as a string.

protobuf_c_version_number() returns the version of the *library* as an
integer.

PROTOBUF_C_VERSION is the version of the *headers* as a string constant.

PROTOBUF_C_VERSION_NUMBER is the version of the *headers* as an integer.
2014-04-03 16:36:39 -04:00
Robert Edmonds
4d525f2fff ChangeLog: credit Andrei Nigmatulin for #138 2014-04-03 12:14:03 -04:00
Robert Edmonds
3fccff9381 t/: add test case test_field_flags 2014-04-03 12:09:54 -04:00
Andrei Nigmatulin
e962705437 added deprecated flag into ProtobufCFieldDescriptor->flags
[edmonds@fsi.io: resolve merge conflicts, add documentation]
2014-04-03 11:41:13 -04:00
Robert Edmonds
8a71fdab60 minor adjustments to the field flags patch
rename PROTOBUF_C_FIELD_FLAGS_PACKED to PROTOBUF_C_FIELD_FLAG_PACKED.

rename ProtobufCFieldFlagType to ProtobufCFieldFlag.

wrap some particular long lines.

update documentation.

for clarity, use a "uint32_t" instead of "unsigned" for the 'flags'
field in _ProtobufCFieldDescriptor.
2014-04-03 10:17:14 -04:00
Andrei Nigmatulin
9c6f2fe4d3 turned ProtobufCFieldDescriptor->packed into ->flags 2014-04-03 09:56:03 -04:00
Robert Edmonds
db49f8e889 .travis.yml: test on both gcc and clang 2014-03-31 17:47:29 -04:00
Robert Edmonds
53dcda6c31 ChangeLog: credit Andrei Nigmatulin for #136, #137 2014-03-31 17:35:51 -04:00
Robert Edmonds
d9a2f8470d protobuf_c_message_unpack(): revert hash-based required field detection
Originally, someone complained about protobuf_c_message_unpack() using
alloca() for the allocation of the temporary bitmap used to detect that
all required fields were present in the unpacked message (Issue #60).
Commit 248eae1d eliminated the use of alloca(), replacing the
variable-length alloca()'d bitmap with a 16 byte stack-allocated bitmap,
treating field numbers mod 128.

Andrei Nigmatulin noted in PR #137 problems with this approach:

    Apparently 248eae1d has introduced a serious problem to protobuf-c
    decoder.

    Originally the function of required_fields_bitmap was to prevent
    decoder from returning incomplete messages. That means, each
    required field in the message either must have a default_value or be
    present in the protobuf stream. The purpose of this behaviour was to
    provide user with 100% complete ProtobufCMessage struct on return
    from protobuf_c_message_unpack(), which does not need to be checked
    for completeness just after. This is exactly how original protobuf
    C++ decoder behaves. The patch 248eae1d broke this functionality by
    hashing bits of required fields instead of storing them separately.

    Consider a protobuf message with 129 fields where the first and the
    last fields set as 'required'. In this case it is possible to trick
    decoder to return incomplete ProtobufCMessage struct with missing
    required fields by providing only one of the two fields in the
    source byte stream. This can be considered as a security issue as
    well because user's code do not expect incomplete messages with
    missing required fields out from protobuf_c_message_unpack(). Such a
    change could introduce undefined behaviour to user programs.

This patch is based on Andrei's fix and restores the exact detection of
missing required fields, but avoids doing a separate allocation for the
required fields bitmap except for messages whose descriptors define a
large number of fields. In the "typical" case where the message
descriptor has <= 128 fields we can just use a 16 byte array allocated
on the stack. (Note that the hash-based approach also used a 16 byte
stack allocated array.)
2014-03-31 16:55:52 -04:00
Robert Edmonds
ec961cb007 t/: rename the required fields bitmap test case 2014-03-31 16:14:33 -04:00
Andrei Nigmatulin
cfb919f100 added unit test for required_fields_bitmap hashing issue 2014-03-31 16:10:41 -04:00
Andrei Nigmatulin
613b367596 fixed gcc warnings 'integer constant is so large that it is unsigned' for large 64 bit constants (default values) 2014-03-29 14:02:37 -04:00
Robert Edmonds
e1e044da01 configure.ac: search the pkg-config exec_prefix for the protobuf compiler
protoc may not be on the default PATH, so augment $PATH with the
executable path registered by pkg-config for the protobuf package.

additionally declare PROTOC as a precious variable, thus allowing it to
be explicitly set by the user at ./configure time.

based on a patch from Andrei Nigmatulin.
2014-03-28 14:03:59 -04:00
Robert Edmonds
e633dda6e4 configure.ac: use $protobuf_CFLAGS to find protobuf header files
the protobuf header files may be installed in a non-standard location
and thus we need to use the CFLAGS registered for protobuf in pkg-config
in order to find them.

based on a patch from Andrei Nigmatulin.
2014-03-28 14:03:59 -04:00
Robert Edmonds
66005093be Makefile.am: use CXXFLAGS instead of CFLAGS for protoc-c/protoc-c, t/generated_code2_cxx_generate_packed_data
these are C++ programs, not C programs, so use CXXFLAGS instead of
CFLAGS.

based on a patch from Andrei Nigmatulin.
2014-03-28 14:03:59 -04:00
Robert Edmonds
b635119a98 ChangeLog: more updates 2014-03-27 19:34:34 -04:00
Robert Edmonds
ab6de80ed1 ChangeLog: update 2014-03-27 18:56:50 -04:00
Robert Edmonds
c6f43d347f configure.ac: make pkg-config optional when building with --disable-protoc
if pkg-config is installed, the libprotobuf-c .pc file will be
installed; if pkg-config is not installed, the .pc file won't be
installed.

this behavior only applies when we're building with ./configure
--disable-protoc, since pkg-config is required in order to detect the
protobuf dependency.
2014-03-27 16:57:21 -04:00
Robert Edmonds
daad5868cf version the libprotobuf-c symbols on compatible linkers (Issue #116)
this is conditional on whether the linker supports version scripts, for
which we use the gl_LD_VERSION_SCRIPT macro from the gnulib project.

on platforms without version scripts, we fall back to libtool's
-export-symbols-regex.
2014-03-27 15:22:55 -04:00
Robert Edmonds
4da97eeaa3 protobuf-c/: update copyright notices 2014-03-26 15:51:47 -04:00
Robert Edmonds
0429d675c1 README.md: add note about semantic versioning 2014-03-26 15:31:03 -04:00
Robert Edmonds
6ea3b7c39f README.md: mention the <google/protobuf-c/protobuf-c.h> compat symlink 2014-03-26 14:15:45 -04:00
Robert Edmonds
8c8df07e39 LICENSE: update the copyright notice 2014-03-26 14:14:58 -04:00
Robert Edmonds
82635d618d .gitignore: anchor Makefile and Makefile.in at the top of the tree 2014-03-26 14:06:17 -04:00
Robert Edmonds
16e3465d21 configure.ac: check for a libprotoc header file
it's possible for the <google/protobuf/compiler/> header files to be
shipped in a separate package (e.g., debian's libprotoc-dev). check for
this at configure time rather than allowing the build process to fail.
2014-03-24 19:04:15 -04:00
Oleg Efimov
9c7f8ce798 t/: add test case for Issue #129 from Oleg Efimov 2014-03-24 18:07:04 -04:00
Robert Edmonds
d2658e25fe protoc-c: preserve case in C enum value names (Issue #129)
there is some confusion with regard to the use of lower case letters in
enum values. take the following message definition:

    message LowerCase {
      enum CaseEnum {
        UPPER = 1;
        lower = 2;
      }
      optional CaseEnum value = 1 [default = lower];
    }

this generates the following C enum:

    typedef enum _LowerCase__CaseEnum {
      LOWER_CASE__CASE_ENUM__UPPER = 1,
      LOWER_CASE__CASE_ENUM__lower = 2
        _PROTOBUF_C_FORCE_ENUM_TO_BE_INT_SIZE(LOWER_CASE__CASE_ENUM)
    } LowerCase__CaseEnum;

note that the case of the enum value 'lower' was preserved in the C
symbol name as 'LOWER_CASE__CASE_ENUM__lower', but that the _INIT macro
references the same enum value with the (non-existent) C symbol name
'LOWER_CASE__CASE_ENUM__LOWER':

    #define LOWER_CASE__INIT \
     { PROTOBUF_C_MESSAGE_INIT (&lower_case__descriptor) \
        , 0,LOWER_CASE__CASE_ENUM__LOWER }

additionally, the ProtobufCEnumValue array generated also refers to the
same enum value with the (non-existent) upper cased version:

    const ProtobufCEnumValue lower_case__case_enum__enum_values_by_number[2] =
    {
      { "UPPER", "LOWER_CASE__CASE_ENUM__UPPER", 1 },
      { "lower", "LOWER_CASE__CASE_ENUM__LOWER", 2 },
    };

we should preserve the existing behavior of copying the case from the
enum values in the message definition and fix up the places where the
(non-existent) upper case version is used, rather than changing the enum
definition itself to match the case used in the _INIT macro and
enum_values_by_number array, because it's possible that there might be
existing working code that uses enum values with lower case letters that
would be affected by such a change.

incidentally, google's C++ protobuf implementation preserves case in
enum values. protoc --cpp_out generates the following enum declaration
for the message descriptor above:

    enum LowerCase_CaseEnum {
      LowerCase_CaseEnum_UPPER = 1,
      LowerCase_CaseEnum_lower = 2
    };
2014-03-24 18:07:04 -04:00
Robert Edmonds
1f15ba9cdf protobuf-c: minor style fixes 2014-03-19 15:15:27 -04:00
Robert Edmonds
3429d8b197 protobuf-c: rename protobuf_c_message_init_generic() and update the TODO comment
this function is now static, so it shouldn't have the "protobuf_c_"
prefix in its name.
2014-03-19 15:14:52 -04:00
Tomasz Wasilczyk
4e3ace9757 Don't export private function as an external symbol 2014-03-14 23:59:18 +01:00
Tomasz Wasilczyk
05c7e4892c Don't use C++ style comments in C code 2014-03-14 23:56:21 +01:00
Tomasz Wasilczyk
1ab4acf919 Fix -Wcast-align warnings when compiled with clang 2014-03-14 22:21:07 +01:00
Robert Edmonds
2976be8666 configure.ac: tweak the ${has_doxygen} status display 2014-03-06 22:05:27 -05:00
Kevin Lyda
7881332164 Disable dot in Doxyfile. 2014-02-17 09:29:01 +00:00
Kevin Lyda
369f7e58a1 Default doxygen-doc to not enabled.
Also, don't default dot support to on and emit something to say if
the dogygen-doc target is enabled.
2014-02-17 09:24:51 +00:00
Kevin Lyda
b9f94db3cc Autoconf configuration for doxygen.
Still need to add the comments in the source code. Currently I've
seeded it with the libprotobuf-c files.  I've configured it
to make man pages and html pages.  Might not be ideal, but makes it easy
for me to check things (html is nicer, but man pages are handier for
remote servers).
2014-02-16 21:45:02 +00:00
Robert Edmonds
7ea757dd13 configure.ac: bump version to 1.0.0-pre 2014-02-10 10:57:27 -05:00
Kevin Lyda
f52f500995 Autoconf portability tweaks.
Use MKDIR_P and LN_S rather than their usual expansions.
2014-01-25 15:56:40 +00:00
Robert Edmonds
ed036b769f Revert "protobuf-c/libprotobuf-c.sym: new" (fixes #116)
This reverts commit aaa40c5881f12877cca63c06a798d8422f9470de.
2014-01-17 11:10:39 -05:00
Robert Edmonds
447964eee4 .travis.yml: add back "language: c"
of course, protobuf-c uses both C and C++.
2014-01-14 13:52:21 -05:00
Robert Edmonds
28e70e5e9a .travis.yml: remove "make clean" at end of build script 2014-01-14 13:51:30 -05:00
Robert Edmonds
dd0f0ea3ef Makefile.am: AM_TESTS_ENVIRONMENT -> LOG_COMPILER
It’s important to note that, differently from what we’ve seen for
    the serial test harness (see Parallel Test Harness), the
    AM_TESTS_ENVIRONMENT and TESTS_ENVIRONMENT variables cannot be use
    to define a custom test runner; the LOG_COMPILER and LOG_FLAGS (or
    their extension-specific counterparts) should be used instead:

    ## This is WRONG!
    AM_TESTS_ENVIRONMENT = PERL5LIB='$(srcdir)/lib' $(PERL) -Mstrict -w

    ## Do this instead.
    AM_TESTS_ENVIRONMENT = PERL5LIB='$(srcdir)/lib'; export PERL5LIB;
    LOG_COMPILER = $(PERL)
    AM_LOG_FLAGS = -Mstrict -w

(http://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html)
2014-01-14 13:46:19 -05:00
Robert Edmonds
bfd88382e6 .travis.yml: add VERBOSE=1 to make flags in order to log test failures
"As with the serial harness above, by default one status line is printed
per completed test, and a short summary after the suite has completed.
However, standard output and standard error of the test are redirected
to a per-test log file, so that parallel execution does not produce
intermingled output. The output from failed tests is collected in the
test-suite.log file. If the variable ‘VERBOSE’ is set, this file is
output after the summary."

(http://www.gnu.org/software/automake/manual/html_node/Parallel-Test-Harness.html)
2014-01-14 13:39:33 -05:00
Ilya Lipnitskiy
d74ef06435 .travis.yml: install valgrind on the CI VM 2014-01-14 00:20:05 -08:00
Ilya Lipnitskiy
baa3ab296d .travis.yml: add a travis build entry to run tests under valgrind
Makefile.am: add valgrind to the AM_TESTS_ENVIRONMENT
configure.ac: enable valgrind testing option for ./configure
m4/valgrind-tests.m4: enable tracing children for libtool wrapper
script compatibility, but ignore standard binaries in /usr or /bin
2014-01-14 00:20:05 -08:00
Ilya Lipnitskiy
2b371c154f m4/valgrind-tests.m4: add valgrind testing support to automake 2014-01-14 00:19:24 -08:00
Robert Edmonds
847091c86e ChangeLog: mention google compat symlink and protobuf-c-rpc splitout 2014-01-13 21:55:43 -05:00
Robert Edmonds
d10a022eb4 ChangeLog: configure --disable-protoc has been restored 2014-01-13 21:51:50 -05:00
Robert Edmonds
6f0237a6c6 ChangeLog: the entries about the rpc code have been moved to protobuf-c-rpc's ChangeLog 2014-01-13 21:51:14 -05:00
Robert Edmonds
caff46e1f6 make .alloc and .free methods of ProtobufCAllocator callable again
it turned out to be a bad idea to not export the default allocator's
methods via the ProtobufCAllocator's function pointers. there is at
least one user (protobuf-c-rpc) that makes allocations by directly
invoking those methods.
2014-01-13 21:47:28 -05:00
Robert Edmonds
aaa40c5881 protobuf-c/libprotobuf-c.sym: new
use a linker script rather than relying on libtool's
-export-symbols-regex. this lets us start versioning the library's
exported symbols.
2014-01-13 20:17:39 -05:00
Robert Edmonds
606c27b411 protobuf-c: update #include comments
in particular we no longer use abort().
2014-01-13 19:53:41 -05:00
Robert Edmonds
e8bf07dee0 protobuf-c: just use <stdint.h>
according to microsoft's platform evangelist, "we recommend that you
consider using a different compiler such as Intel or gcc" if you need a
conforming C compiler. since there's already a project that maintains
the stdint.h / inttypes.h headers for microsoft compilers
(https://code.google.com/p/msinttypes/) there's not much point in
maintaining this ourselves.
2014-01-13 19:53:41 -05:00
Robert Edmonds
677c3f0bdf remove protobuf-c-private.h
there's not much point to having the "private" definitions split out
into a separate header file. they're still in the namespace and there's
nothing that can be done to prevent "unauthorized" uses. just integrate
the definitions into the main header file but put them in the bottom and
note that they're "private".

this makes it very slightly easier to copy the protobuf-c support
library into another project wholesale, since one less file is required.
2014-01-13 19:53:41 -05:00
Robert Edmonds
85847c494e protobuf-c: remove PROTOBUF_C_PLEASE_INCLUDE_CTYPE, ProtobufC_CType
i'm not quite sure what this thing is used for or how useful it could
possibly be. it's not used anywhere in protobuf-c or protobuf-c-rpc, and
it wasn't in protobuf-c 0.14 or earlier. just delete it; if anything
actually needs this kind of logic, it's easy enough to replicate it.
2014-01-13 19:53:41 -05:00
Robert Edmonds
f6cee05cf0 protobuf-c: make it a bit harder to generate output to stdio
libraries should never generate output on their own to stdout/stderr.
remove the PRINT_UNPACK_ERRORS macro and rename UNPACK_ERROR to
PROTOBUF_C_UNPACK_ERROR.

the error strings are left in but compiled out by default. they could
theoretically be re-enabled for a debugging session by changing the
PROTOBUF_C_UNPACK_ERROR macro to something like:

	#define PROTOBUF_C_UNPACK_ERROR(...) do { fprintf(stderr, __VA_ARGS__); fputc('\n', stderr); } while (0)
2014-01-13 19:53:41 -05:00