diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/datacache/plugin_datacache_template.c | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/datacache/plugin_datacache_template.c')
-rw-r--r-- | src/datacache/plugin_datacache_template.c | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/src/datacache/plugin_datacache_template.c b/src/datacache/plugin_datacache_template.c index 4c322d3ab..edb3b6757 100644 --- a/src/datacache/plugin_datacache_template.c +++ b/src/datacache/plugin_datacache_template.c | |||
@@ -31,7 +31,8 @@ | |||
31 | /** | 31 | /** |
32 | * Context for all functions in this plugin. | 32 | * Context for all functions in this plugin. |
33 | */ | 33 | */ |
34 | struct Plugin { | 34 | struct Plugin |
35 | { | ||
35 | /** | 36 | /** |
36 | * Our execution environment. | 37 | * Our execution environment. |
37 | */ | 38 | */ |
@@ -54,17 +55,17 @@ struct Plugin { | |||
54 | * @return 0 if duplicate, -1 on error, number of bytes used otherwise | 55 | * @return 0 if duplicate, -1 on error, number of bytes used otherwise |
55 | */ | 56 | */ |
56 | static ssize_t | 57 | static ssize_t |
57 | template_plugin_put(void *cls, | 58 | template_plugin_put (void *cls, |
58 | const struct GNUNET_HashCode *key, | 59 | const struct GNUNET_HashCode *key, |
59 | uint32_t xor_distance, | 60 | uint32_t xor_distance, |
60 | size_t size, | 61 | size_t size, |
61 | const char *data, | 62 | const char *data, |
62 | enum GNUNET_BLOCK_Type type, | 63 | enum GNUNET_BLOCK_Type type, |
63 | struct GNUNET_TIME_Absolute discard_time, | 64 | struct GNUNET_TIME_Absolute discard_time, |
64 | unsigned int path_info_len, | 65 | unsigned int path_info_len, |
65 | const struct GNUNET_PeerIdentity *path_info) | 66 | const struct GNUNET_PeerIdentity *path_info) |
66 | { | 67 | { |
67 | GNUNET_break(0); | 68 | GNUNET_break (0); |
68 | return -1; | 69 | return -1; |
69 | } | 70 | } |
70 | 71 | ||
@@ -81,13 +82,13 @@ template_plugin_put(void *cls, | |||
81 | * @return the number of results found | 82 | * @return the number of results found |
82 | */ | 83 | */ |
83 | static unsigned int | 84 | static unsigned int |
84 | template_plugin_get(void *cls, | 85 | template_plugin_get (void *cls, |
85 | const struct GNUNET_HashCode *key, | 86 | const struct GNUNET_HashCode *key, |
86 | enum GNUNET_BLOCK_Type type, | 87 | enum GNUNET_BLOCK_Type type, |
87 | GNUNET_DATACACHE_Iterator iter, | 88 | GNUNET_DATACACHE_Iterator iter, |
88 | void *iter_cls) | 89 | void *iter_cls) |
89 | { | 90 | { |
90 | GNUNET_break(0); | 91 | GNUNET_break (0); |
91 | return 0; | 92 | return 0; |
92 | } | 93 | } |
93 | 94 | ||
@@ -100,9 +101,9 @@ template_plugin_get(void *cls, | |||
100 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 101 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
101 | */ | 102 | */ |
102 | static int | 103 | static int |
103 | template_plugin_del(void *cls) | 104 | template_plugin_del (void *cls) |
104 | { | 105 | { |
105 | GNUNET_break(0); | 106 | GNUNET_break (0); |
106 | return GNUNET_SYSERR; | 107 | return GNUNET_SYSERR; |
107 | } | 108 | } |
108 | 109 | ||
@@ -116,11 +117,11 @@ template_plugin_del(void *cls) | |||
116 | * @return the number of results found (zero or one) | 117 | * @return the number of results found (zero or one) |
117 | */ | 118 | */ |
118 | static unsigned int | 119 | static unsigned int |
119 | template_plugin_get_random(void *cls, | 120 | template_plugin_get_random (void *cls, |
120 | GNUNET_DATACACHE_Iterator iter, | 121 | GNUNET_DATACACHE_Iterator iter, |
121 | void *iter_cls) | 122 | void *iter_cls) |
122 | { | 123 | { |
123 | GNUNET_break(0); | 124 | GNUNET_break (0); |
124 | return 0; | 125 | return 0; |
125 | } | 126 | } |
126 | 127 | ||
@@ -140,13 +141,13 @@ template_plugin_get_random(void *cls, | |||
140 | * @return the number of results found | 141 | * @return the number of results found |
141 | */ | 142 | */ |
142 | static unsigned int | 143 | static unsigned int |
143 | template_plugin_get_closest(void *cls, | 144 | template_plugin_get_closest (void *cls, |
144 | const struct GNUNET_HashCode *key, | 145 | const struct GNUNET_HashCode *key, |
145 | unsigned int num_results, | 146 | unsigned int num_results, |
146 | GNUNET_DATACACHE_Iterator iter, | 147 | GNUNET_DATACACHE_Iterator iter, |
147 | void *iter_cls) | 148 | void *iter_cls) |
148 | { | 149 | { |
149 | GNUNET_break(0); | 150 | GNUNET_break (0); |
150 | return 0; | 151 | return 0; |
151 | } | 152 | } |
152 | 153 | ||
@@ -158,24 +159,24 @@ template_plugin_get_closest(void *cls, | |||
158 | * @return the plugin's closure (our `struct Plugin`) | 159 | * @return the plugin's closure (our `struct Plugin`) |
159 | */ | 160 | */ |
160 | void * | 161 | void * |
161 | libgnunet_plugin_datacache_template_init(void *cls) | 162 | libgnunet_plugin_datacache_template_init (void *cls) |
162 | { | 163 | { |
163 | struct GNUNET_DATACACHE_PluginEnvironment *env = cls; | 164 | struct GNUNET_DATACACHE_PluginEnvironment *env = cls; |
164 | struct GNUNET_DATACACHE_PluginFunctions *api; | 165 | struct GNUNET_DATACACHE_PluginFunctions *api; |
165 | struct Plugin *plugin; | 166 | struct Plugin *plugin; |
166 | 167 | ||
167 | plugin = GNUNET_new(struct Plugin); | 168 | plugin = GNUNET_new (struct Plugin); |
168 | plugin->env = env; | 169 | plugin->env = env; |
169 | api = GNUNET_new(struct GNUNET_DATACACHE_PluginFunctions); | 170 | api = GNUNET_new (struct GNUNET_DATACACHE_PluginFunctions); |
170 | api->cls = plugin; | 171 | api->cls = plugin; |
171 | api->get = &template_plugin_get; | 172 | api->get = &template_plugin_get; |
172 | api->put = &template_plugin_put; | 173 | api->put = &template_plugin_put; |
173 | api->del = &template_plugin_del; | 174 | api->del = &template_plugin_del; |
174 | api->get_random = &template_plugin_get_random; | 175 | api->get_random = &template_plugin_get_random; |
175 | api->get_closest = &template_plugin_get_closest; | 176 | api->get_closest = &template_plugin_get_closest; |
176 | GNUNET_log_from(GNUNET_ERROR_TYPE_INFO, | 177 | GNUNET_log_from (GNUNET_ERROR_TYPE_INFO, |
177 | "template", | 178 | "template", |
178 | "Template datacache running\n"); | 179 | "Template datacache running\n"); |
179 | return api; | 180 | return api; |
180 | } | 181 | } |
181 | 182 | ||
@@ -187,13 +188,13 @@ libgnunet_plugin_datacache_template_init(void *cls) | |||
187 | * @return NULL | 188 | * @return NULL |
188 | */ | 189 | */ |
189 | void * | 190 | void * |
190 | libgnunet_plugin_datacache_template_done(void *cls) | 191 | libgnunet_plugin_datacache_template_done (void *cls) |
191 | { | 192 | { |
192 | struct GNUNET_DATACACHE_PluginFunctions *api = cls; | 193 | struct GNUNET_DATACACHE_PluginFunctions *api = cls; |
193 | struct Plugin *plugin = api->cls; | 194 | struct Plugin *plugin = api->cls; |
194 | 195 | ||
195 | GNUNET_free(plugin); | 196 | GNUNET_free (plugin); |
196 | GNUNET_free(api); | 197 | GNUNET_free (api); |
197 | return NULL; | 198 | return NULL; |
198 | } | 199 | } |
199 | 200 | ||