convert fs publish to MQ
[oweals/gnunet.git] / src / include / gnunet_rest_lib.h
index ea254cc9bfd2623e123a21bd185cbf34683ae4e0..243c38403a871a712e35dd8ad0dd898abd9abd21 100644 (file)
 
 #include "gnunet_util_lib.h"
 #include "microhttpd.h"
-#include <jansson.h>
 
 #define GNUNET_REST_HANDLER_END {NULL, NULL, NULL}
 
-struct RestConnectionDataHandle
+struct GNUNET_REST_RequestHandle
 {
   struct GNUNET_CONTAINER_MultiHashMap *url_param_map;
   const char *method;
   const char *url;
   const char *data;
   size_t data_size;
+};
 
+struct GNUNET_REST_RequestHandlerError
+{
+  int error_code;
+  char* error_text;
 };
 
-struct GNUNET_REST_RestConnectionHandler
+struct GNUNET_REST_RequestHandler
 {
   /**
    * Http method to handle
@@ -62,7 +66,7 @@ struct GNUNET_REST_RestConnectionHandler
   /**
    * callback handler
    */
-  void (*proc) (struct RestConnectionDataHandle *handle,
+  void (*proc) (struct GNUNET_REST_RequestHandle *handle,
                 const char *url,
                 void *cls);
 
@@ -91,18 +95,19 @@ int
 GNUNET_REST_namespace_match (const char *url, const char *namespace);
 
 /**
- * Create JSON API MHD response
+ * Create REST MHD response
  *
- * @param data JSON result
+ * @param data result
  * @retun MHD response
  */
  struct MHD_Response*
-GNUNET_REST_create_json_response (const char *data);
+GNUNET_REST_create_response (const char *data);
 
 
 int
-GNUNET_REST_handle_request (struct RestConnectionDataHandle *conn,
-                            const struct GNUNET_REST_RestConnectionHandler *handlers,
+GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn,
+                            const struct GNUNET_REST_RequestHandler *handlers,
+                            struct GNUNET_REST_RequestHandlerError *err,
                             void *cls);