diff options
Diffstat (limited to 'src/include/gnunet_rest_plugin.h')
-rw-r--r-- | src/include/gnunet_rest_plugin.h | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/src/include/gnunet_rest_plugin.h b/src/include/gnunet_rest_plugin.h index d690343ba..a7318e628 100644 --- a/src/include/gnunet_rest_plugin.h +++ b/src/include/gnunet_rest_plugin.h | |||
@@ -1,22 +1,22 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2012-2015 Christian Grothoff (and other contributing authors) | 3 | Copyright (C) 2012-2015 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
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 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @author Martin Schanzenbach | 21 | * @author Martin Schanzenbach |
22 | * @file include/gnunet_rest_plugin.h | 22 | * @file include/gnunet_rest_plugin.h |
@@ -45,9 +45,19 @@ extern "C" | |||
45 | * @param status status code (HTTP) | 45 | * @param status status code (HTTP) |
46 | */ | 46 | */ |
47 | typedef void (*GNUNET_REST_ResultProcessor) (void *cls, | 47 | typedef void (*GNUNET_REST_ResultProcessor) (void *cls, |
48 | const char *data, | 48 | const char *data, |
49 | size_t data_len, | 49 | size_t data_len, |
50 | int status); | 50 | int status); |
51 | |||
52 | struct RestConnectionDataHandle | ||
53 | { | ||
54 | struct GNUNET_CONTAINER_MultiHashMap *url_param_map; | ||
55 | const char *method; | ||
56 | const char *url; | ||
57 | const char *data; | ||
58 | size_t data_size; | ||
59 | |||
60 | }; | ||
51 | 61 | ||
52 | /** | 62 | /** |
53 | * @brief struct returned by the initialization function of the plugin | 63 | * @brief struct returned by the initialization function of the plugin |
@@ -61,7 +71,7 @@ struct GNUNET_REST_Plugin | |||
61 | * | 71 | * |
62 | */ | 72 | */ |
63 | void *cls; | 73 | void *cls; |
64 | 74 | ||
65 | /** | 75 | /** |
66 | * Plugin name. Used as the namespace for the API. | 76 | * Plugin name. Used as the namespace for the API. |
67 | * e.g. http://hostname:port/<name> | 77 | * e.g. http://hostname:port/<name> |
@@ -78,12 +88,9 @@ struct GNUNET_REST_Plugin | |||
78 | * @param proc the callback for result | 88 | * @param proc the callback for result |
79 | * @param proc_cls closure for callback | 89 | * @param proc_cls closure for callback |
80 | */ | 90 | */ |
81 | void (*process_request) (const char *method, | 91 | void (*process_request) (struct RestConnectionDataHandle *handle, |
82 | const char *url, | 92 | GNUNET_REST_ResultProcessor proc, |
83 | const char *data, | 93 | void *proc_cls); |
84 | size_t data_size, | ||
85 | GNUNET_REST_ResultProcessor proc, | ||
86 | void *proc_cls); | ||
87 | 94 | ||
88 | }; | 95 | }; |
89 | 96 | ||