summaryrefslogtreecommitdiff
path: root/src/modules/json.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/json.h')
-rw-r--r--src/modules/json.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/modules/json.h b/src/modules/json.h
index 385b7c559..ca9ed8d3f 100644
--- a/src/modules/json.h
+++ b/src/modules/json.h
@@ -532,9 +532,18 @@ namespace json
{
namespace rpc
{
- typedef void (*method) (HTTPRequest *http, Value &request, Value &response);
- void init (void);
- void add_method (char *name, method mth);
+ typedef void (Module::*method) (HTTPRequest *http, Value &request, Value &response);
+
+ struct mfp
+ {
+ Module const *mod;
+ method mth;
+ };
+
+ typedef std::map<std::string, mfp> method_map;
+ extern method_map methods;
+
+ void add_method (char *name, Module const *mod, method mth);
void service (HTTPRequest *http, Value &request, Value &response);
void process (HTTPRequest *http, std::string &response, char const *request);
}