This is a design I mocked up for my CS class this term.
This library is supposed to pass function calls and arguments back and forth between a robot and a host computer. In short, it's a remote procedure call library.
Each function that can be called remotely must be registered with the library, providing a wrapper function that takes an array of void pointers and an integer length. The wrapper must cast them and call the original function with those arguments.
On the calling side, a remote function is called by using a function that takes a remote function name, a format string describing its arguments, and a variable-length list of those arguments. It's probably best to either write a function or a macro wrapping that call.
Thus, no custom code must be written to make a function remote-callable other than a very simple wrapper method.
Every data type that can be transmitted across the wire must have functions that serialize it and deserialize it.
Those functions are kept track of in two tables mapping the data type's format string notation to its serialization functions.
For the first version of this library, the serialization functions will be hard-coded into the library, but I may implement a registration system later.