546 Commits

Author SHA1 Message Date
Robert Edmonds
61e5bee03d .travis.yml: fix 'language' declaration
It turns out that in YAML,

    language: c
    language: cpp

Actually means:

    language: cpp

I'm not sure if travis-ci actually supports providing a list of values
for the 'language' parameter, but let's try it anyway.
2014-09-05 14:35:50 -04:00
Robert S. Edmonds
1ccc5d4239 .travis.yml: install protobuf 2.5.0 from source
The travis-ci environment is based on Ubuntu 12.04 LTS, which has an
older protobuf version (2.4.1). We need to depend on features that are
only available in 2.5.0 (and, later, 2.6.0), so instead of satisfying
the protobuf build dependencies from the Ubuntu repository, download and
install our own copy of protobuf.

The travis-ci build from this commit should succeed, since we are
compatible with protobuf 2.5.0.

Based on a patch from Ilya Lipnitskiy.
2014-09-05 14:00:45 -04:00
Robert S. Edmonds
0c774499ef README.md: update protobuf URL to point to the new github location 2014-09-03 14:11:01 -04:00
Robert Edmonds
ce90c3be88 ChangeLog: 1.0.1 v1.0.1 2014-08-05 14:35:02 -04:00
Robert Edmonds
5c3a7b9464 bump version to 1.0.1 2014-08-05 14:30:33 -04:00
Robert Edmonds
108635a35f protobuf-c: parse_required_member(): zero bd->data in 0-length byte string case
in the case that we are unpacking a 0-length byte string, we need to
explicitly set bd->data to NULL, otherwise we may try to free() a stray
pointer when protobuf_c_message_free_unpacked() is called on the
containing message.

(Issue #157.)
2014-08-05 14:20:29 -04:00
Robert Edmonds
4c2225d0a7 ChangeLog: finalize for 1.0.0 v1.0.0 2014-07-22 19:19:46 -04:00
Robert Edmonds
b1c2ca4cf1 configure.ac: bump version to 1.0.0 2014-07-22 19:19:38 -04:00
Robert Edmonds
94ee39c8cb bump PROTOBUF_C_VERSION to 1.0.0 2014-07-22 19:19:13 -04:00
Robert Edmonds
a2fb491088 README.md: add details to the Versioning section 2014-07-15 00:14:27 -04:00
Andrei Nigmatulin
6136f54b22 added check for PROTOBUF_C_TYPE_BYTES fields, including repeated
added check that repeated fields vectors are not NULL
fixed repeated field quantity type: it's "size_t", not "unsigned"
cleaner code, no cast porn
all covered with tests
2014-06-30 19:28:04 +01:00
Robert Edmonds
93b9674e93 configure.ac: bump version to 1.0.0-rc2 v1.0.0-rc2 2014-06-27 17:59:43 -04:00
Robert Edmonds
448f04acd1 protobuf-c: bump PROTOBUF_C_VERSION to 1.0.0-rc2 2014-06-27 17:59:07 -04:00
Robert Edmonds
aa2f8697d8 Revert "protobuf-c: Add vim modeline magic at the end of the files"
This reverts commit e7dc76c54bf5869247ec0a330ae9cf7f5499154d.

i really dislike cluttering up files with editor-specific modelines, and
anyway the //-comments run afoul of #124.
2014-06-27 17:34:30 -04:00
Ilya Lipnitskiy
a2100d1f39 protobuf-c.c: Fix repeated field concatenation order in merge_messages (fixes #147) 2014-06-27 17:32:32 -04:00
Ilya Lipnitskiy
e7dc76c54b protobuf-c: Add vim modeline magic at the end of the files 2014-06-19 16:12:10 -07:00
Ilya Lipnitskiy
cc2506b948 protobuf-c.c: Fix compiler warnings 2014-06-19 16:12:10 -07:00
Robert Edmonds
713a748e62 ChangeLog: document the removal of protobuf_c_default_allocator and protobuf_c_system_allocator 2014-06-09 18:52:35 -04:00
Robert Edmonds
3decba7a16 remove protobuf_c_default_allocator
"protobuf_c_default_allocator" is the last bit of global data in
libprotobuf-c, and it can be hidden with some relatively easy (though
API/ABI-breaking) changes to ProtobufCBufferSimple.

all exported functions that take a ProtobufCAllocator either use the
provided allocator (if non-NULL), or switch to the default allocator (if
NULL). there are now two relatively unambiguous choices when a
ProtobufCAllocator is required by an exported function:

    1) use NULL. the vast majority of callers should pick this option.

    2) implement your own allocation functions, and enclose these in a
    ProtobufCAllocator struct.

in previous versions of protobuf-c there were two other possibilities:

    3) maybe use &protobuf_c_system_allocator?

    4) maybe use &protobuf_c_default_allocator?

this was relatively confusing, and by removing these latter two options
we can avoid having global library state.
2014-06-09 18:18:24 -04:00
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