Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port rpcgen to mercury for hg_proc_cb_t function generation
Port sunrpc rpcgen to mercury to allow mercury users to generate hg_proc_cb_t functions from .x files (as an additional alternative to hand coding or using the boost preprocessor macros). The mercury version of rpcgen (hg_rpcgen) parses standard .x files (though it ignores the 'program' section) and emits code that uses the mercury proc API. The port includes: - rpcgen itself, in util/rpc_gen (hg_info is moved to util/hg_info) - mercury proc versions of helper xdr functions like xdr_array() in src/proc_extra. we update the legacy string functions in src/proc_extra to use hg_proc_string() for a backend. - a new unit test in Testing/unit/hg/test_hg_rpcgen.c The unit test's input .x file (Testing/unit/hg/test_hg_rpcgen.x) also documents the the .x file syntax. Note that the hg_rpcgen reinitialize() code has been updated to free() previously allocated parse tree memory rather than discard (leak) it. To do this, the char* strings in parse.h were changed to tokens (since the token type/kind value can be used to determine if the token string was allocated with malloc() or not).
- Loading branch information