aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <mschanzenbach@posteo.de>2016-05-05 10:18:01 +0000
committerMartin Schanzenbach <mschanzenbach@posteo.de>2016-05-05 10:18:01 +0000
commit8aad5eb78dc229a519dca35099ba9e9ce86bc956 (patch)
treec239dcf65af268e82c84f01bf29daa48a98291a0 /src
parent9bfec4362916ca79314265af464a096706a1c963 (diff)
downloadgnunet-8aad5eb78dc229a519dca35099ba9e9ce86bc956.tar.gz
gnunet-8aad5eb78dc229a519dca35099ba9e9ce86bc956.zip
- ignore
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_jsonapi_util.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/include/gnunet_jsonapi_util.h b/src/include/gnunet_jsonapi_util.h
new file mode 100644
index 000000000..4289a5062
--- /dev/null
+++ b/src/include/gnunet_jsonapi_util.h
@@ -0,0 +1,62 @@
1/*
2 This file is part of GNUnet
3 Copyright (C) 2014, 2015, 2016 GNUnet e.V.
4
5 GNUnet is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3, or (at your option) any later version.
8
9 GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License along with
14 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
15*/
16/**
17 * @file gnunet_jsonapi_util.h
18 * @brief utility functions for jsonapi
19 * @author Martin Schanzenbach
20 */
21#ifndef GNUNET_JSONAPI_UTIL_H
22#define GNUNET_JSONAPI_UTIL_H
23
24#include "gnunet_util_lib.h"
25#include "gnunet_rest_lib.h"
26#include "gnunet_jsonapi_lib.h"
27
28
29/**
30 * Check rest request for validity
31 *
32 * @param req handle to the request
33 * @return GNUNET_OK if valid
34 */
35int
36GNUNET_JSONAPI_check_request_acceptable (struct GNUNET_REST_RequestHandle *req);
37
38/**
39 * Check rest request for validity
40 *
41 * @param req handle to the request
42 * @return GNUNET_OK if valid
43 */
44int
45GNUNET_JSONAPI_check_request_supported (struct GNUNET_REST_RequestHandle *req);
46
47
48/**
49 * Handle jsonapi rest request. Checks request headers for jsonapi compliance
50 *
51 * @param req rest request handle
52 * @param handler rest request handlers
53 * @param cls closure
54 * @return GNUNET_OK if successful
55 */
56int
57GNUNET_JSONAPI_handle_request (struct GNUNET_REST_RequestHandle *req,
58 const struct GNUNET_REST_RequestHandler *handlers,
59 struct GNUNET_REST_RequestHandlerError *err,
60 void *cls);
61
62#endif