diff options
author | Florian Dold <florian.dold@gmail.com> | 2014-03-10 10:39:30 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2014-03-10 10:39:30 +0000 |
commit | 2688a53703e3e1b4353aee8fc425fd1f6a793125 (patch) | |
tree | 2141dc0ba2811f5858cd48a056367905452e0cc9 /src | |
parent | 22eef4ab2f96eb3c36d0b87152a469b3a4e47754 (diff) | |
download | gnunet-2688a53703e3e1b4353aee8fc425fd1f6a793125.tar.gz gnunet-2688a53703e3e1b4353aee8fc425fd1f6a793125.zip |
Rename name_map and plugins from gns so that they are unique in a total c-file
Diffstat (limited to 'src')
-rw-r--r-- | src/gns/plugin_gnsrecord_gns.c | 14 | ||||
-rw-r--r-- | src/gnsrecord/gnsrecord.c | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/src/gns/plugin_gnsrecord_gns.c b/src/gns/plugin_gnsrecord_gns.c index 14b015c0c..d1de73e49 100644 --- a/src/gns/plugin_gnsrecord_gns.c +++ b/src/gns/plugin_gnsrecord_gns.c | |||
@@ -244,7 +244,7 @@ gns_string_to_value (void *cls, | |||
244 | static struct { | 244 | static struct { |
245 | const char *name; | 245 | const char *name; |
246 | uint32_t number; | 246 | uint32_t number; |
247 | } name_map[] = { | 247 | } gns_name_map[] = { |
248 | { "PKEY", GNUNET_GNSRECORD_TYPE_PKEY }, | 248 | { "PKEY", GNUNET_GNSRECORD_TYPE_PKEY }, |
249 | { "NICK", GNUNET_GNSRECORD_TYPE_NICK }, | 249 | { "NICK", GNUNET_GNSRECORD_TYPE_NICK }, |
250 | { "LEHO", GNUNET_GNSRECORD_TYPE_LEHO }, | 250 | { "LEHO", GNUNET_GNSRECORD_TYPE_LEHO }, |
@@ -268,10 +268,10 @@ gns_typename_to_number (void *cls, | |||
268 | unsigned int i; | 268 | unsigned int i; |
269 | 269 | ||
270 | i=0; | 270 | i=0; |
271 | while ( (name_map[i].name != NULL) && | 271 | while ( (gns_name_map[i].name != NULL) && |
272 | (0 != strcasecmp (gns_typename, name_map[i].name)) ) | 272 | (0 != strcasecmp (gns_typename, gns_name_map[i].name)) ) |
273 | i++; | 273 | i++; |
274 | return name_map[i].number; | 274 | return gns_name_map[i].number; |
275 | } | 275 | } |
276 | 276 | ||
277 | 277 | ||
@@ -289,10 +289,10 @@ gns_number_to_typename (void *cls, | |||
289 | unsigned int i; | 289 | unsigned int i; |
290 | 290 | ||
291 | i=0; | 291 | i=0; |
292 | while ( (name_map[i].name != NULL) && | 292 | while ( (gns_name_map[i].name != NULL) && |
293 | (type != name_map[i].number) ) | 293 | (type != gns_name_map[i].number) ) |
294 | i++; | 294 | i++; |
295 | return name_map[i].name; | 295 | return gns_name_map[i].name; |
296 | } | 296 | } |
297 | 297 | ||
298 | 298 | ||
diff --git a/src/gnsrecord/gnsrecord.c b/src/gnsrecord/gnsrecord.c index d5b6c693b..0993e7aba 100644 --- a/src/gnsrecord/gnsrecord.c +++ b/src/gnsrecord/gnsrecord.c | |||
@@ -56,7 +56,7 @@ struct Plugin | |||
56 | /** | 56 | /** |
57 | * Array of our plugins. | 57 | * Array of our plugins. |
58 | */ | 58 | */ |
59 | static struct Plugin **plugins; | 59 | static struct Plugin **gns_plugins; |
60 | 60 | ||
61 | /** | 61 | /** |
62 | * Size of the 'plugins' array. | 62 | * Size of the 'plugins' array. |
@@ -90,7 +90,7 @@ add_plugin (void *cls, | |||
90 | plugin = GNUNET_new (struct Plugin); | 90 | plugin = GNUNET_new (struct Plugin); |
91 | plugin->api = api; | 91 | plugin->api = api; |
92 | plugin->library_name = GNUNET_strdup (library_name); | 92 | plugin->library_name = GNUNET_strdup (library_name); |
93 | GNUNET_array_append (plugins, num_plugins, plugin); | 93 | GNUNET_array_append (gns_plugins, num_plugins, plugin); |
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
@@ -119,15 +119,15 @@ GNSRECORD_fini () | |||
119 | 119 | ||
120 | for (i = 0; i < num_plugins; i++) | 120 | for (i = 0; i < num_plugins; i++) |
121 | { | 121 | { |
122 | plugin = plugins[i]; | 122 | plugin = gns_plugins[i]; |
123 | GNUNET_break (NULL == | 123 | GNUNET_break (NULL == |
124 | GNUNET_PLUGIN_unload (plugin->library_name, | 124 | GNUNET_PLUGIN_unload (plugin->library_name, |
125 | plugin->api)); | 125 | plugin->api)); |
126 | GNUNET_free (plugin->library_name); | 126 | GNUNET_free (plugin->library_name); |
127 | GNUNET_free (plugin); | 127 | GNUNET_free (plugin); |
128 | } | 128 | } |
129 | GNUNET_free_non_null (plugins); | 129 | GNUNET_free_non_null (gns_plugins); |
130 | plugins = NULL; | 130 | gns_plugins = NULL; |
131 | once = 0; | 131 | once = 0; |
132 | num_plugins = 0; | 132 | num_plugins = 0; |
133 | } | 133 | } |
@@ -153,7 +153,7 @@ GNUNET_GNSRECORD_value_to_string (uint32_t type, | |||
153 | init (); | 153 | init (); |
154 | for (i = 0; i < num_plugins; i++) | 154 | for (i = 0; i < num_plugins; i++) |
155 | { | 155 | { |
156 | plugin = plugins[i]; | 156 | plugin = gns_plugins[i]; |
157 | if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls, | 157 | if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls, |
158 | type, | 158 | type, |
159 | data, | 159 | data, |
@@ -186,7 +186,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type, | |||
186 | init (); | 186 | init (); |
187 | for (i = 0; i < num_plugins; i++) | 187 | for (i = 0; i < num_plugins; i++) |
188 | { | 188 | { |
189 | plugin = plugins[i]; | 189 | plugin = gns_plugins[i]; |
190 | if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls, | 190 | if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls, |
191 | type, | 191 | type, |
192 | s, | 192 | s, |
@@ -214,7 +214,7 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename) | |||
214 | init (); | 214 | init (); |
215 | for (i = 0; i < num_plugins; i++) | 215 | for (i = 0; i < num_plugins; i++) |
216 | { | 216 | { |
217 | plugin = plugins[i]; | 217 | plugin = gns_plugins[i]; |
218 | if (UINT32_MAX != (ret = plugin->api->typename_to_number (plugin->api->cls, | 218 | if (UINT32_MAX != (ret = plugin->api->typename_to_number (plugin->api->cls, |
219 | dns_typename))) | 219 | dns_typename))) |
220 | return ret; | 220 | return ret; |
@@ -239,7 +239,7 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type) | |||
239 | init (); | 239 | init (); |
240 | for (i = 0; i < num_plugins; i++) | 240 | for (i = 0; i < num_plugins; i++) |
241 | { | 241 | { |
242 | plugin = plugins[i]; | 242 | plugin = gns_plugins[i]; |
243 | if (NULL != (ret = plugin->api->number_to_typename (plugin->api->cls, | 243 | if (NULL != (ret = plugin->api->number_to_typename (plugin->api->cls, |
244 | type))) | 244 | type))) |
245 | return ret; | 245 | return ret; |