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
2016-02-28 12:52:38 +01:00
compiler add approprate per-file license headers 2016-02-28 12:47:42 +01:00
.gitignore Fix build 2014-08-03 22:18:08 +03:00
.travis.yml travis: remove sudo requirement in order to be able to build on faster container system 2015-08-04 11:11:54 -07: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 add approprate per-file license headers 2016-02-28 12:47:42 +01:00
capn.h add approprate per-file license headers 2016-02-28 12:47:42 +01:00
LICENSE Add MIT license 2013-09-12 15:17:22 -04:00
Makefile Re-fix signed/unsigned warnings 2016-02-28 12:42:52 +01:00
README.md Update merged forks 2016-02-28 12:52:38 +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.