aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_rest_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_rest_lib.h')
-rw-r--r--src/include/gnunet_rest_lib.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/include/gnunet_rest_lib.h b/src/include/gnunet_rest_lib.h
index 83741ab95..e70759590 100644
--- a/src/include/gnunet_rest_lib.h
+++ b/src/include/gnunet_rest_lib.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -34,10 +34,9 @@
34#include "gnunet_util_lib.h" 34#include "gnunet_util_lib.h"
35#include <microhttpd.h> 35#include <microhttpd.h>
36 36
37#define GNUNET_REST_HANDLER_END {NULL, NULL, NULL} 37#define GNUNET_REST_HANDLER_END { NULL, NULL, NULL }
38 38
39struct GNUNET_REST_RequestHandle 39struct GNUNET_REST_RequestHandle {
40{
41 /** 40 /**
42 * Map of url parameters 41 * Map of url parameters
43 */ 42 */
@@ -69,14 +68,12 @@ struct GNUNET_REST_RequestHandle
69 size_t data_size; 68 size_t data_size;
70}; 69};
71 70
72struct GNUNET_REST_RequestHandlerError 71struct GNUNET_REST_RequestHandlerError {
73{
74 int error_code; 72 int error_code;
75 char* error_text; 73 char* error_text;
76}; 74};
77 75
78struct GNUNET_REST_RequestHandler 76struct GNUNET_REST_RequestHandler {
79{
80 /** 77 /**
81 * Http method to handle 78 * Http method to handle
82 */ 79 */
@@ -93,7 +90,6 @@ struct GNUNET_REST_RequestHandler
93 void (*proc) (struct GNUNET_REST_RequestHandle *handle, 90 void (*proc) (struct GNUNET_REST_RequestHandle *handle,
94 const char *url, 91 const char *url,
95 void *cls); 92 void *cls);
96
97}; 93};
98 94
99 95
@@ -116,7 +112,7 @@ typedef void (*GNUNET_REST_ResultProcessor) (void *cls,
116 * @return GNUNET_YES if namespace matches 112 * @return GNUNET_YES if namespace matches
117 */ 113 */
118int 114int
119GNUNET_REST_namespace_match (const char *url, const char *namespace); 115GNUNET_REST_namespace_match(const char *url, const char *namespace);
120 116
121/** 117/**
122 * Create REST MHD response 118 * Create REST MHD response
@@ -124,15 +120,15 @@ GNUNET_REST_namespace_match (const char *url, const char *namespace);
124 * @param data result 120 * @param data result
125 * @return MHD response 121 * @return MHD response
126 */ 122 */
127 struct MHD_Response* 123struct MHD_Response*
128GNUNET_REST_create_response (const char *data); 124GNUNET_REST_create_response(const char *data);
129 125
130 126
131int 127int
132GNUNET_REST_handle_request (struct GNUNET_REST_RequestHandle *conn, 128GNUNET_REST_handle_request(struct GNUNET_REST_RequestHandle *conn,
133 const struct GNUNET_REST_RequestHandler *handlers, 129 const struct GNUNET_REST_RequestHandler *handlers,
134 struct GNUNET_REST_RequestHandlerError *err, 130 struct GNUNET_REST_RequestHandlerError *err,
135 void *cls); 131 void *cls);
136 132
137 133
138#endif 134#endif