glitch in the license text detected by hyazinthe, thank you!
[oweals/gnunet.git] / src / include / gnunet_jsonapi_util.h
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
6   under the terms of the GNU Affero General Public License as published
7   by the Free Software Foundation, either version 3 of the License,
8   or (at your option) any later version.
9
10   GNUnet is distributed in the hope that it will be useful, but
11   WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Affero General Public License for more details.
14 */
15 /**
16  * @file gnunet_jsonapi_util.h
17  * @brief utility functions for jsonapi
18  * @author Martin Schanzenbach
19  */
20 #ifndef GNUNET_JSONAPI_UTIL_H
21 #define GNUNET_JSONAPI_UTIL_H
22
23 #include "gnunet_util_lib.h"
24 #include "gnunet_rest_lib.h"
25 #include "gnunet_jsonapi_lib.h"
26
27
28 /**
29  * Check rest request for validity
30  *
31  * @param req handle to the request
32  * @return GNUNET_OK if valid
33  */
34 int
35 GNUNET_JSONAPI_check_request_acceptable (struct GNUNET_REST_RequestHandle *req);
36
37 /**
38  * Check rest request for validity
39  *
40  * @param req handle to the request
41  * @return GNUNET_OK if valid
42  */
43 int
44 GNUNET_JSONAPI_check_request_supported (struct GNUNET_REST_RequestHandle *req);
45
46
47 /**
48  * Handle jsonapi rest request. Checks request headers for jsonapi compliance
49  *
50  * @param req rest request handle
51  * @param handler rest request handlers
52  * @param cls closure
53  * @return GNUNET_OK if successful
54  */
55 int
56 GNUNET_JSONAPI_handle_request (struct GNUNET_REST_RequestHandle *req,
57                                const struct GNUNET_REST_RequestHandler *handlers,
58                                struct GNUNET_REST_RequestHandlerError *err,
59                                void *cls);
60
61 #endif