/* * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team * Rights to this code are as documented in doc/pod/license.pod. * * JSON-RPC for Ermyth * * $Id: rpc.h,v 1.3 2007/09/05 11:23:15 pippijn Exp $ */ #ifndef JSONRPC_H #define JSONRPC_H /* * JSON-RPC implementation in C++ * * See the rpctest example for reference. */ #include #include "json/json.h" namespace json { struct jsonrpc_event { long id; char *type; time_t tm; Value data; }; typedef void (*jsonrpc_method) (void *userdata, Value &request, Value &response); extern void jsonrpc_add_method (char const * const name, jsonrpc_method method); extern void jsonrpc_service (void *userdata, Value &request, Value &response); extern void jsonrpc_process (void *userdata, char *response, char const *request, size_t response_len); } #endif