Protocol Buffers text format routines for C library
Shell Makefile C M4 Protocol Buffer
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
am Tweak docs. Apr 3, 2014
build-aux Update for newest autoconf tools. Sep 8, 2014
m4
man Renamed the man pages. Apr 3, 2014
protobuf-c-text Fixed memory leak in parse.re. Jul 2, 2015
t Fix #1. Sep 8, 2014
.gitignore Update for newest autoconf tools. Sep 8, 2014
.travis.yml And another dependency... Sep 8, 2014
AUTHORS Reorganising files. Mar 21, 2014
COPYING A more permissive license. Mar 22, 2014
ChangeLog Updated changelog. Apr 12, 2014
Doxyfile Move doxygen and code coverage docs. Apr 3, 2014
INSTALL Update for newest autoconf tools. Sep 8, 2014
Makefile.am Fix #1. Sep 8, 2014
Makefile.in Fix #1. Sep 8, 2014
NEWS A little more progress. Mar 21, 2014
README
README.md Update dependencies. Sep 8, 2014
TODO Doc fixes. Apr 4, 2014
aclocal.m4 Update for newest autoconf tools. Sep 8, 2014
autogen.sh Reorganising files. Mar 21, 2014
configure
configure.ac Nudge up test coverage. Do 1.0.0 release. Apr 12, 2014

README.md

Build Status

Protobuf Text Format Support for C

Python, C++ and Java protobufs support text format but C protobufs did not. This is a project that fixed that. It is a supplement to the libprotobuf-c library in the protobuf-c project.

If you want to just get started using it, grab the code, run ./configure && make && sudo make install and then read the docs.

Contents

The protobuf-c-text/ directory has the code for the library. Tests are in t/.

Dependencies

The re2c parser is required to generate the lexer (parser.re).

Coverage needs the lcov tool.

Documentation needs the doxygen and graphviz tools.

Testing

The t/c-* programs use the BROKEN_MALLOC and BROKEN_MALLOC_SEGV environment vars to control when and how malloc will fail. The BROKEN_MALLOC var is set to the number of times for malloc to succeed until it fails. When the BROKEN_MALLOC_SEGV var is set the test program will segfault on the first failure. This is useful for tracking down errors.

Note that the error message will print out the gdb line and the run command you need to issue to reproduce the error.

Useful make Targets

Beyond the normal autotools make targets, the following useful targets exist:

  • coverage-html: If you ran ./configure --enable-gcov this will generate test code coverage reports along with marked up source files to show what is missing.
  • analyze: If clang is on your system the static analyzer from the llvm project will be run.
  • doxygen-doc: This will generate local versions of the docs available online. They'll be found in docs/html.

Maintainer Notes

make gh-pages notes:

The initial steps was done as follows. This should not need to be repeated but is documented here for future projects.

mkdir foo
git checkout --orphan gh-pages
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree foo status
touch foo/.nojekyll
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree foo add .nojekyll
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree foo commit -m 'Turn off Jekyll'
git checkout master
rm -rf foo

Subsequent updates are done like so (starting in master):

./configure --enable-gcov
make clean doxygen-doc coverage-html
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html checkout gh-pages
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html checkout .nojekyll
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html checkout CNAME
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html add .
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html ls-files --deleted | GIT_INDEX_FILE=$PWD/.git/index.gh-pages xargs git --work-tree $PWD/docs/html rm
GIT_INDEX_FILE=$PWD/.git/index.gh-pages git --work-tree $PWD/docs/html commit -m "Update docs."
git checkout master
git push

Note that all references to files are done relative to the dir specified in --work-tree. Changing dir into that would make things easier, but the --work-tree flag still needs to be set as would GIT_INDEX_FILE.

Also for reference, github pages docs are quite handy.