ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/modules/rpc/include/json/rpc.h
Revision: 1.1
Committed: Thu Jul 19 08:24:56 2007 UTC (19 years, 4 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Log Message:
initial import. the most important changes since Atheme are:
- fixed many memory leaks
- fixed many bugs
- converted to C++ and use more STL containers
- added a (not very enhanced yet) perl module
- greatly improved XML-RPC speed
- added a JSON-RPC module with code from json-cpp
- added a valgrind memcheck module to operserv
- added a more object oriented base64 implementation
- added a specialised unit test framework
- improved stability
- use gettimeofday() if available
- reworked adding/removing commands
- MemoServ IGNORE DEL can now remove indices

File Contents

# User Rev Content
1 pippijn 1.1 #ifndef JSONRPC_H
2     #define JSONRPC_H
3    
4     /*
5     * JSON-RPC implementation in C++
6     *
7     * See the rpctest example for reference.
8     */
9    
10     #include <stddef.h>
11    
12     #include "json/json.h"
13    
14     namespace json
15     {
16     struct jsonrpc_event
17     {
18     long id;
19     char *type;
20     time_t tm;
21     Value data;
22     };
23    
24     typedef void (*jsonrpc_method) (void *userdata, Value &request, Value &response);
25     extern void jsonrpc_add_method (char *name, jsonrpc_method method);
26     extern void jsonrpc_service (void *userdata, Value &request, Value &response);
27     extern void jsonrpc_process (void *userdata, char *response, char const *request, size_t response_len);
28     }
29    
30     #endif