]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/json.h
Now, json-rpc _ONLY_ supports member function pointers. An example is given in
[user/henk/code/inspircd.git] / src / modules / json.h
index 385b7c559eba57670a34cd369f2c77c7c3db15e1..ca9ed8d3f862d642cb659e011795672ca90eed5f 100644 (file)
@@ -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);
   }