| Revision: | 1.2 |
| Committed: | Tue Aug 28 17:08:12 2007 UTC (19 years, 2 months ago) by pippijn |
| Content type: | text/plain |
| Branch: | MAIN |
| Changes since 1.1: | +10 -1 lines |
| Log Message: | - changed name - updated the example config to the new system - added more documentation - enhanced documentation generators - added a link to the pdf to the website - added an RSS feed generator - transitioned hooks to c++ callbacks - did various merges with upstream along the way - added const where appropriate - removed the old block allocator - fixed most memory leaks - transitioned some dictionaries to std::map - transitioned some lists to std::vector - made some free functions members where appropriate - renamed string to dynstr and added a static string ststr - use NOW instead of time (NULL) if possible - completely reworked database backends, crypto handlers and protocol handlers to use an object factory - removed the old module system. ermyth does not do any dynamic loading anymore - fixed most of the build system - reworked how protocol commands work |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | pippijn | 1.2 | /* |
| 2 | * Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team | ||
| 3 | * Rights to this code are as documented in doc/pod/gplicense.pod. | ||
| 4 | * | ||
| 5 | * JSON-RPC for Ermyth | ||
| 6 | * | ||
| 7 | * $Id: jsonrpc.C,v 1.4 2007-07-25 00:03:21 pippijn Exp $ | ||
| 8 | */ | ||
| 9 | |||
| 10 | pippijn | 1.1 | #ifndef JSONRPC_H |
| 11 | #define JSONRPC_H | ||
| 12 | |||
| 13 | /* | ||
| 14 | * JSON-RPC implementation in C++ | ||
| 15 | * | ||
| 16 | * See the rpctest example for reference. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #include <stddef.h> | ||
| 20 | |||
| 21 | #include "json/json.h" | ||
| 22 | |||
| 23 | namespace json | ||
| 24 | { | ||
| 25 | struct jsonrpc_event | ||
| 26 | { | ||
| 27 | long id; | ||
| 28 | char *type; | ||
| 29 | time_t tm; | ||
| 30 | Value data; | ||
| 31 | }; | ||
| 32 | |||
| 33 | typedef void (*jsonrpc_method) (void *userdata, Value &request, Value &response); | ||
| 34 | pippijn | 1.2 | extern void jsonrpc_add_method (char const * const name, jsonrpc_method method); |
| 35 | pippijn | 1.1 | extern void jsonrpc_service (void *userdata, Value &request, Value &response); |
| 36 | extern void jsonrpc_process (void *userdata, char *response, char const *request, size_t response_len); | ||
| 37 | } | ||
| 38 | |||
| 39 | #endif |