opensourcerouting / c-capnproto

C library/compiler for the Cap'n Proto serialization/RPC protocol
MIT License
118 stars 40 forks source link

add a capnp annotation for creating name spaces #52

Closed cbrune closed 1 year ago

cbrune commented 2 years ago

This patch adds an annotation for creating name spaces within capnproto files with the C-language code generator.

Use the annotation like this:

  using C = import "/c.capnp";
  $C.namespace("foo_");

The string passed into the namespace annotation is prepended to the name of all the struct's in the schema file.