fix #3869: outdated FSF address
[oweals/gnunet.git] / src / gnsrecord / gnsrecord.c
index d5b6c693bc6e04f08df6c82c2109865fc200cd7e..5e8c00f3c64be5072b5802dafc12df7ac48c4e12 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2009-2013 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 
 /**
@@ -56,7 +56,7 @@ struct Plugin
 /**
  * Array of our plugins.
  */
-static struct Plugin **plugins;
+static struct Plugin **gns_plugins;
 
 /**
  * Size of the 'plugins' array.
@@ -90,7 +90,7 @@ add_plugin (void *cls,
   plugin = GNUNET_new (struct Plugin);
   plugin->api = api;
   plugin->library_name = GNUNET_strdup (library_name);
-  GNUNET_array_append (plugins, num_plugins, plugin);
+  GNUNET_array_append (gns_plugins, num_plugins, plugin);
 }
 
 
@@ -119,15 +119,15 @@ GNSRECORD_fini ()
 
   for (i = 0; i < num_plugins; i++)
   {
-    plugin = plugins[i];
+    plugin = gns_plugins[i];
     GNUNET_break (NULL ==
                   GNUNET_PLUGIN_unload (plugin->library_name,
                                         plugin->api));
     GNUNET_free (plugin->library_name);
     GNUNET_free (plugin);
   }
-  GNUNET_free_non_null (plugins);
-  plugins = NULL;
+  GNUNET_free_non_null (gns_plugins);
+  gns_plugins = NULL;
   once = 0;
   num_plugins = 0;
 }
@@ -153,7 +153,7 @@ GNUNET_GNSRECORD_value_to_string (uint32_t type,
   init ();
   for (i = 0; i < num_plugins; i++)
   {
-    plugin = plugins[i];
+    plugin = gns_plugins[i];
     if (NULL != (ret = plugin->api->value_to_string (plugin->api->cls,
                                                      type,
                                                      data,
@@ -186,7 +186,7 @@ GNUNET_GNSRECORD_string_to_value (uint32_t type,
   init ();
   for (i = 0; i < num_plugins; i++)
   {
-    plugin = plugins[i];
+    plugin = gns_plugins[i];
     if (GNUNET_OK == plugin->api->string_to_value (plugin->api->cls,
                                                    type,
                                                    s,
@@ -211,10 +211,13 @@ GNUNET_GNSRECORD_typename_to_number (const char *dns_typename)
   struct Plugin *plugin;
   uint32_t ret;
 
+  if (0 == strcasecmp (dns_typename,
+                       "ANY"))
+    return GNUNET_GNSRECORD_TYPE_ANY;
   init ();
   for (i = 0; i < num_plugins; i++)
   {
-    plugin = plugins[i];
+    plugin = gns_plugins[i];
     if (UINT32_MAX != (ret = plugin->api->typename_to_number (plugin->api->cls,
                                                               dns_typename)))
       return ret;
@@ -236,10 +239,12 @@ GNUNET_GNSRECORD_number_to_typename (uint32_t type)
   struct Plugin *plugin;
   const char * ret;
 
+  if (GNUNET_GNSRECORD_TYPE_ANY == type)
+    return "ANY";
   init ();
   for (i = 0; i < num_plugins; i++)
   {
-    plugin = plugins[i];
+    plugin = gns_plugins[i];
     if (NULL != (ret = plugin->api->number_to_typename (plugin->api->cls,
                                                         type)))
       return ret;