This is a C plugin for [Cap'n Proto](http://kentonv.github.io/capnproto), an efficient protocol for sharing data and capabilities.
Find a file
David Lamparter 332076e522 Fix empty-object pointers
Pointers are written as offsets to the segment start;  leaving p->data
as NULL results in invalid pointers for zero-size objects (particularly,
lists.)
2016-03-08 14:49:10 +01:00
ac tack on autoconf/automake build 2016-02-28 13:55:23 +01:00
compiler add approprate per-file license headers 2016-02-28 12:47:42 +01:00
m4 tack on autoconf/automake build 2016-02-28 13:55:23 +01:00
.gitignore tack on autoconf/automake build 2016-02-28 13:55:23 +01:00
.travis.yml Travis CI: whatever. 2016-02-28 18:38:41 +01:00
capn-list.inc add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn-malloc.c add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn-stream-test.cpp add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn-stream.c add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn-test.cpp add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn.c Fix empty-object pointers 2016-03-08 14:49:10 +01:00
capn.h add approprate per-file license headers 2016-02-28 12:47:42 +01:00
configure.ac Fix Travis CI even more... 2016-02-28 18:31:43 +01:00
COPYING tack on autoconf/automake build 2016-02-28 13:55:23 +01:00
Makefile.am tack on autoconf/automake build 2016-02-28 13:55:23 +01:00
README.md Update Travis icon URL 2016-02-28 18:23:23 +01:00

capnpc-c

This is a C plugin for Cap'n Proto, an efficient protocol for sharing data and capabilities.

This is only the plugin, to properly make use of it you need to download, build and install capnpc and then build and install this project and then you can utilize it as:

capnpc compiler/test.capnp -oc

Build Status

status

This is a merge of 3 forks of James McKaskill's great work, which has been untouched for a while:

usage

The compiler directory contains the C language plugin (capnpc-c) for use with the capnp tool: https://capnproto.org/capnp-tool.html.

capnp will by default search $PATH for capnpc-c - if it's on your PATH, you can generate code for your schema as follows:

$ capnp compile -o c myschema.capnp

Otherwise, you can specify the path to the c plugin:

$ capnp compile -o ./capnpc-c myschema.capnp

capnp generates a C struct that corresponds to each capn proto struct, along with read/write functions that convert to/from capn proto form.

TBD whether it will make sense in the future to provide accessor functions for struct members, rather than converting entire structs.