gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r11802 - in gnunet/src: arm core datastore fs hostlist peer


From: gnunet
Subject: [GNUnet-SVN] r11802 - in gnunet/src: arm core datastore fs hostlist peerinfo peerinfo-tool statistics template topology transport util
Date: Fri, 18 Jun 2010 16:09:55 +0200

Author: grothoff
Date: 2010-06-18 16:09:55 +0200 (Fri, 18 Jun 2010)
New Revision: 11802

Modified:
   gnunet/src/arm/gnunet-arm.c
   gnunet/src/arm/gnunet-service-arm.c
   gnunet/src/arm/mockup-service.c
   gnunet/src/core/gnunet-service-core.c
   gnunet/src/datastore/gnunet-service-datastore.c
   gnunet/src/fs/gnunet-directory.c
   gnunet/src/fs/gnunet-download.c
   gnunet/src/fs/gnunet-pseudonym.c
   gnunet/src/fs/gnunet-publish.c
   gnunet/src/fs/gnunet-search.c
   gnunet/src/fs/gnunet-unindex.c
   gnunet/src/hostlist/gnunet-daemon-hostlist.c
   gnunet/src/hostlist/hostlist-client.c
   gnunet/src/peerinfo-tool/gnunet-peerinfo.c
   gnunet/src/peerinfo/gnunet-service-peerinfo.c
   gnunet/src/statistics/gnunet-service-statistics.c
   gnunet/src/statistics/gnunet-statistics.c
   gnunet/src/template/gnunet-service-template.c
   gnunet/src/template/gnunet-template.c
   gnunet/src/topology/gnunet-daemon-topology.c
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/util/crypto_hash.c
   gnunet/src/util/crypto_ksk.c
   gnunet/src/util/getopt.c
   gnunet/src/util/gnunet-service-resolver.c
Log:
localization
of scopes

Modified: gnunet/src/arm/gnunet-arm.c
===================================================================
--- gnunet/src/arm/gnunet-arm.c 2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/arm/gnunet-arm.c 2010-06-18 14:09:55 UTC (rev 11802)
@@ -357,31 +357,6 @@
 
 
 /**
- * gnunet-arm command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'e', "end", NULL, gettext_noop ("stop all GNUnet services"),
-   GNUNET_NO, &GNUNET_GETOPT_set_one, &end},
-  {'i', "init", "SERVICE", gettext_noop ("start a particular service"),
-   GNUNET_YES, &GNUNET_GETOPT_set_string, &init},
-  {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"),
-   GNUNET_YES, &GNUNET_GETOPT_set_string, &term},
-  {'s', "start", NULL, gettext_noop ("start all GNUnet default services"),
-   GNUNET_NO, &GNUNET_GETOPT_set_one, &start},
-  {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default 
services"),
-    GNUNET_NO, &GNUNET_GETOPT_set_one, &restart},
-  {'t', "test", "SERVICE",
-   gettext_noop ("test if a particular service is running"),
-   GNUNET_YES, &GNUNET_GETOPT_set_string, &test},
-  {'d', "delete", NULL, gettext_noop ("delete config file and directory on 
exit"),
-   GNUNET_NO, &GNUNET_GETOPT_set_one, &delete},
-  {'q', "quiet", NULL, gettext_noop ("don't print status messages"),
-   GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet},
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to obtain arm from gnunetd.
  *
  * @param argc number of arguments from the command line
@@ -391,6 +366,26 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'e', "end", NULL, gettext_noop ("stop all GNUnet services"),
+     GNUNET_NO, &GNUNET_GETOPT_set_one, &end},
+    {'i', "init", "SERVICE", gettext_noop ("start a particular service"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &init},
+    {'k', "kill", "SERVICE", gettext_noop ("stop a particular service"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &term},
+    {'s', "start", NULL, gettext_noop ("start all GNUnet default services"),
+     GNUNET_NO, &GNUNET_GETOPT_set_one, &start},
+    {'r', "restart", NULL, gettext_noop ("stop and start all GNUnet default 
services"),
+     GNUNET_NO, &GNUNET_GETOPT_set_one, &restart},
+    {'t', "test", "SERVICE",
+     gettext_noop ("test if a particular service is running"),
+     GNUNET_YES, &GNUNET_GETOPT_set_string, &test},
+    {'d', "delete", NULL, gettext_noop ("delete config file and directory on 
exit"),
+     GNUNET_NO, &GNUNET_GETOPT_set_one, &delete},
+    {'q', "quiet", NULL, gettext_noop ("don't print status messages"),
+     GNUNET_NO, &GNUNET_GETOPT_set_one, &quiet},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/arm/gnunet-service-arm.c 2010-06-18 14:09:55 UTC (rev 11802)
@@ -986,17 +986,6 @@
 
 
 /**
- * List of handlers for the messages understood by this service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0},
-  {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0},
-  {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
-   sizeof (struct GNUNET_MessageHeader)},
-  {NULL, NULL, 0, 0}
-};
-
-/**
  * Signal handler called for SIGCHLD.  Triggers the
  * respective handler by writing to the trigger pipe.
  */
@@ -1025,6 +1014,13 @@
      struct GNUNET_SERVER_Handle *serv,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_start, NULL, GNUNET_MESSAGE_TYPE_ARM_START, 0},
+    {&handle_stop, NULL, GNUNET_MESSAGE_TYPE_ARM_STOP, 0},
+    {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
+     sizeof (struct GNUNET_MessageHeader)},
+    {NULL, NULL, 0, 0}
+  };
   char *defaultservices;
   char *pos;
 

Modified: gnunet/src/arm/mockup-service.c
===================================================================
--- gnunet/src/arm/mockup-service.c     2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/arm/mockup-service.c     2010-06-18 14:09:55 UTC (rev 11802)
@@ -81,25 +81,17 @@
 }
 
 
-/**
- * Default handlers for all services.  Will be copied and the
- * "callback_cls" fields will be replaced with the specific service
- * struct.
- */
-static const struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
-   sizeof (struct GNUNET_MessageHeader)},
-  {NULL, NULL, 0, 0}
-};
-
-
-
 static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_shutdown, NULL, GNUNET_MESSAGE_TYPE_ARM_SHUTDOWN,
+     sizeof (struct GNUNET_MessageHeader)},
+    {NULL, NULL, 0, 0}
+  };
   sched = s;
   /* process client requests */
   GNUNET_SERVER_ignore_shutdown (server, GNUNET_YES);

Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c       2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/core/gnunet-service-core.c       2010-06-18 14:09:55 UTC (rev 
11802)
@@ -2351,25 +2351,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_client_init, NULL,
-   GNUNET_MESSAGE_TYPE_CORE_INIT, 0},
-  {&handle_client_request_info, NULL,
-   GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO,
-   sizeof (struct RequestInfoMessage)},
-  {&handle_client_send, NULL,
-   GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
-  {&handle_client_request_connect, NULL,
-   GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
-   sizeof (struct ConnectMessage)},
-  {NULL, NULL, 0, 0}
-};
-
-
-/**
  * PEERINFO is giving us a HELLO for a peer.  Add the public key to
  * the neighbour's struct and retry send_key.  Or, if we did not get a
  * HELLO, just do nothing.
@@ -3834,6 +3815,19 @@
      struct GNUNET_SERVER_Handle *serv,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_client_init, NULL,
+     GNUNET_MESSAGE_TYPE_CORE_INIT, 0},
+    {&handle_client_request_info, NULL,
+     GNUNET_MESSAGE_TYPE_CORE_REQUEST_INFO,
+     sizeof (struct RequestInfoMessage)},
+    {&handle_client_send, NULL,
+     GNUNET_MESSAGE_TYPE_CORE_SEND, 0},
+    {&handle_client_request_connect, NULL,
+     GNUNET_MESSAGE_TYPE_CORE_REQUEST_CONNECT,
+     sizeof (struct ConnectMessage)},
+    {NULL, NULL, 0, 0}
+  };
   char *keyfile;
 
   sched = s;

Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c     2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/datastore/gnunet-service-datastore.c     2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -1239,29 +1239,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE, 
-   sizeof(struct ReserveMessage) }, 
-  {&handle_release_reserve, NULL, 
GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE, 
-   sizeof(struct ReleaseReserveMessage) }, 
-  {&handle_put, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_PUT, 0 }, 
-  {&handle_update, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE, 
-   sizeof (struct UpdateMessage) }, 
-  {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 }, 
-  {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM, 
-   sizeof(struct GNUNET_MessageHeader) }, 
-  {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 }, 
-  {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP, 
-   sizeof(struct GNUNET_MessageHeader) }, 
-  {NULL, NULL, 0, 0}
-};
-
-
-
-/**
  * Load the datastore plugin.
  */
 static struct DatastorePlugin *
@@ -1443,6 +1420,22 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_reserve, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_RESERVE, 
+     sizeof(struct ReserveMessage) }, 
+    {&handle_release_reserve, NULL, 
GNUNET_MESSAGE_TYPE_DATASTORE_RELEASE_RESERVE, 
+     sizeof(struct ReleaseReserveMessage) }, 
+    {&handle_put, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_PUT, 0 }, 
+    {&handle_update, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_UPDATE, 
+     sizeof (struct UpdateMessage) }, 
+    {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 }, 
+    {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM, 
+     sizeof(struct GNUNET_MessageHeader) }, 
+    {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 }, 
+    {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP, 
+     sizeof(struct GNUNET_MessageHeader) }, 
+    {NULL, NULL, 0, 0}
+  };
   char *fn;
   unsigned int bf_size;
 

Modified: gnunet/src/fs/gnunet-directory.c
===================================================================
--- gnunet/src/fs/gnunet-directory.c    2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-directory.c    2010-06-18 14:09:55 UTC (rev 11802)
@@ -167,14 +167,6 @@
 }
 
 /**
- * gnunet-directory command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to inspect GNUnet directories.
  *
  * @param argc number of arguments from the command line
@@ -184,6 +176,9 @@
 int
 main (int argc, char *const *argv)
 {
+  static struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/fs/gnunet-download.c
===================================================================
--- gnunet/src/fs/gnunet-download.c     2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-download.c     2010-06-18 14:09:55 UTC (rev 11802)
@@ -253,40 +253,6 @@
 
 
 /**
- * gnunet-download command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'a', "anonymity", "LEVEL",
-   gettext_noop ("set the desired LEVEL of receiver-anonymity"),
-   1, &GNUNET_GETOPT_set_uint, &anonymity},
-  {'D', "delete-incomplete", NULL,
-   gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
-   0, &GNUNET_GETOPT_set_one, &delete_incomplete},
-  {'n', "no-network", NULL,
-   gettext_noop ("only search the local peer (no P2P network search)"),
-   1, &GNUNET_GETOPT_set_uint, &local_only},
-  {'o', "output", "FILENAME",
-   gettext_noop ("write the file to FILENAME"),
-   1, &GNUNET_GETOPT_set_string, &filename},
-  {'p', "parallelism", "DOWNLOADS",
-   gettext_noop
-   ("set the maximum number of parallel downloads that is allowed"),
-   1, &GNUNET_GETOPT_set_uint, &parallelism},
-  {'r', "request-parallelism", "REQUESTS",
-   gettext_noop
-   ("set the maximum number of parallel requests for blocks that is allowed"),
-   1, &GNUNET_GETOPT_set_uint, &request_parallelism},
-  {'R', "recursive", NULL,
-   gettext_noop ("download a GNUnet directory recursively"),
-   0, &GNUNET_GETOPT_set_one, &do_recursive},
-  {'V', "verbose", NULL,
-   gettext_noop ("be verbose (print progress information)"),
-   0, &GNUNET_GETOPT_set_one, &verbose},
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to download GNUnet.
  *
  * @param argc number of arguments from the command line
@@ -296,6 +262,35 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'a', "anonymity", "LEVEL",
+     gettext_noop ("set the desired LEVEL of receiver-anonymity"),
+     1, &GNUNET_GETOPT_set_uint, &anonymity},
+    {'D', "delete-incomplete", NULL,
+     gettext_noop ("delete incomplete downloads (when aborted with CTRL-C)"),
+     0, &GNUNET_GETOPT_set_one, &delete_incomplete},
+    {'n', "no-network", NULL,
+     gettext_noop ("only search the local peer (no P2P network search)"),
+     1, &GNUNET_GETOPT_set_uint, &local_only},
+    {'o', "output", "FILENAME",
+     gettext_noop ("write the file to FILENAME"),
+     1, &GNUNET_GETOPT_set_string, &filename},
+    {'p', "parallelism", "DOWNLOADS",
+     gettext_noop
+     ("set the maximum number of parallel downloads that is allowed"),
+     1, &GNUNET_GETOPT_set_uint, &parallelism},
+    {'r', "request-parallelism", "REQUESTS",
+     gettext_noop
+     ("set the maximum number of parallel requests for blocks that is 
allowed"),
+     1, &GNUNET_GETOPT_set_uint, &request_parallelism},
+    {'R', "recursive", NULL,
+     gettext_noop ("download a GNUnet directory recursively"),
+     0, &GNUNET_GETOPT_set_one, &do_recursive},
+    {'V', "verbose", NULL,
+     gettext_noop ("be verbose (print progress information)"),
+     0, &GNUNET_GETOPT_set_one, &verbose},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/fs/gnunet-pseudonym.c
===================================================================
--- gnunet/src/fs/gnunet-pseudonym.c    2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-pseudonym.c    2010-06-18 14:09:55 UTC (rev 11802)
@@ -326,56 +326,7 @@
   post_advertising (NULL, NULL, NULL);
 }
 
-/**
- * gnunet-pseudonym command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'a', "anonymity", "LEVEL",
-   gettext_noop ("set the desired LEVEL of sender-anonymity"),
-   1, &GNUNET_GETOPT_set_uint, &anonymity},
-  {'A', "automate", NULL,
-   gettext_noop ("start a collection"),
-   0, &GNUNET_GETOPT_set_one, &start_automate},
-  {'C', "create", "NAME",
-   gettext_noop
-   ("create or advertise namespace NAME"),
-   1, &GNUNET_GETOPT_set_string, &create_ns},
-  {'D', "delete", "NAME",
-   gettext_noop
-   ("delete namespace NAME "),
-   1, &GNUNET_GETOPT_set_string, &delete_ns},
-  {'e', "end", NULL,
-   gettext_noop ("end current collection"),
-   0, &GNUNET_GETOPT_set_one, &stop_automate},
-  {'k', "keyword", "VALUE",
-  gettext_noop
-   ("add an additional keyword for the advertisment"
-    " (this option can be specified multiple times)"),
-   1, &GNUNET_FS_getopt_set_keywords, &ksk_uri},
-  {'m', "meta", "TYPE:VALUE",
-   gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
-   1, &GNUNET_FS_getopt_set_metadata, &adv_metadata},
-  {'o', "only-local", NULL,
-   gettext_noop ("print names of local namespaces"),
-   0, &GNUNET_GETOPT_set_one, &print_local_only},
-  {'p', "priority", "PRIORITY",
-   gettext_noop ("use the given PRIORITY for the advertisments"),
-   1, &GNUNET_GETOPT_set_uint, &priority},
-  {'q', "quiet", NULL,
-   gettext_noop ("do not print names of remote namespaces"),
-   0, &GNUNET_GETOPT_set_one, &no_remote_printing},
-  {'r', "root", "ID",
-   gettext_noop
-   ("specify ID of the root of the namespace"),
-   1, &GNUNET_GETOPT_set_string, &root_identifier},
-  {'s', "set-rating", "ID:VALUE",
-   gettext_noop
-   ("change rating of namespace ID by VALUE"),
-   1, &GNUNET_GETOPT_set_string, &rating_change},
-  GNUNET_GETOPT_OPTION_END
-};
 
-
 /**
  * The main function to inspect GNUnet directories.
  *
@@ -386,6 +337,51 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'a', "anonymity", "LEVEL",
+     gettext_noop ("set the desired LEVEL of sender-anonymity"),
+     1, &GNUNET_GETOPT_set_uint, &anonymity},
+    {'A', "automate", NULL,
+     gettext_noop ("start a collection"),
+     0, &GNUNET_GETOPT_set_one, &start_automate},
+    {'C', "create", "NAME",
+     gettext_noop
+     ("create or advertise namespace NAME"),
+     1, &GNUNET_GETOPT_set_string, &create_ns},
+    {'D', "delete", "NAME",
+     gettext_noop
+     ("delete namespace NAME "),
+     1, &GNUNET_GETOPT_set_string, &delete_ns},
+    {'e', "end", NULL,
+     gettext_noop ("end current collection"),
+     0, &GNUNET_GETOPT_set_one, &stop_automate},
+    {'k', "keyword", "VALUE",
+     gettext_noop
+     ("add an additional keyword for the advertisment"
+      " (this option can be specified multiple times)"),
+     1, &GNUNET_FS_getopt_set_keywords, &ksk_uri},
+    {'m', "meta", "TYPE:VALUE",
+     gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
+     1, &GNUNET_FS_getopt_set_metadata, &adv_metadata},
+    {'o', "only-local", NULL,
+     gettext_noop ("print names of local namespaces"),
+     0, &GNUNET_GETOPT_set_one, &print_local_only},
+    {'p', "priority", "PRIORITY",
+     gettext_noop ("use the given PRIORITY for the advertisments"),
+     1, &GNUNET_GETOPT_set_uint, &priority},
+    {'q', "quiet", NULL,
+     gettext_noop ("do not print names of remote namespaces"),
+     0, &GNUNET_GETOPT_set_one, &no_remote_printing},
+    {'r', "root", "ID",
+     gettext_noop
+     ("specify ID of the root of the namespace"),
+     1, &GNUNET_GETOPT_set_string, &root_identifier},
+    {'s', "set-rating", "ID:VALUE",
+     gettext_noop
+     ("change rating of namespace ID by VALUE"),
+     1, &GNUNET_GETOPT_set_string, &rating_change},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/fs/gnunet-publish.c
===================================================================
--- gnunet/src/fs/gnunet-publish.c      2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-publish.c      2010-06-18 14:09:55 UTC (rev 11802)
@@ -524,7 +524,7 @@
                                                 &ex))
        {
          if (strlen (ex) > 0)
-           l = EXTRACTOR_plugin_add_config (l, ex, 
EXTRACTOR_OPTION_DEFAULT_POLICY);
+           plugins = EXTRACTOR_plugin_add_config (plugins, ex, 
EXTRACTOR_OPTION_DEFAULT_POLICY);
          GNUNET_free (ex);
        }
     }
@@ -555,7 +555,7 @@
        meta = GNUNET_CONTAINER_meta_data_create ();
       GNUNET_FS_meta_data_extract_from_file (meta,
                                             args[0],
-                                            l);
+                                            plugins);
       fi = GNUNET_FS_file_information_create_from_file (ctx,
                                                        NULL,
                                                        args[0],
@@ -615,66 +615,6 @@
 }
 
 
-/**
- * gnunet-publish command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'a', "anonymity", "LEVEL",
-   gettext_noop ("set the desired LEVEL of sender-anonymity"),
-   1, &GNUNET_GETOPT_set_uint, &anonymity},
-  {'d', "disable-creation-time", NULL,
-   gettext_noop
-   ("disable adding the creation time to the metadata of the uploaded file"),
-   0, &GNUNET_GETOPT_set_one, &do_disable_creation_time},
-  {'D', "disable-extractor", NULL,
-   gettext_noop
-   ("do not use libextractor to add keywords or metadata"),
-   0, &GNUNET_GETOPT_set_one, &disable_extractor},
-  {'e', "extract", NULL,
-   gettext_noop
-   ("print list of extracted keywords that would be used, but do not perform 
upload"),
-   0, &GNUNET_GETOPT_set_one, &extract_only},
-  {'k', "key", "KEYWORD",
-   gettext_noop
-   ("add an additional keyword for the top-level file or directory"
-    " (this option can be specified multiple times)"),
-   1, &GNUNET_FS_getopt_set_keywords, &topKeywords},
-  {'m', "meta", "TYPE:VALUE",
-   gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
-   1, &GNUNET_FS_getopt_set_metadata, &meta},
-  {'n', "noindex", NULL,
-   gettext_noop ("do not index, perform full insertion (stores entire "
-                 "file in encrypted form in GNUnet database)"),
-   0, &GNUNET_GETOPT_set_one, &do_insert},
-  {'N', "next", "ID",
-   gettext_noop
-   ("specify ID of an updated version to be published in the future"
-    " (for namespace insertions only)"),
-   1, &GNUNET_GETOPT_set_string, &next_id},
-  {'p', "priority", "PRIORITY",
-   gettext_noop ("specify the priority of the content"),
-   1, &GNUNET_GETOPT_set_uint, &priority},
-  {'P', "pseudonym", "NAME",
-   gettext_noop
-   ("publish the files under the pseudonym NAME (place file into namespace)"),
-   1, &GNUNET_GETOPT_set_string, &pseudonym},
-  {'s', "simulate-only", NULL,
-   gettext_noop ("only simulate the process but do not do any "
-                 "actual publishing (useful to compute URIs)"),
-   0, &GNUNET_GETOPT_set_one, &do_simulate},
-  {'t', "this", "ID",
-   gettext_noop ("set the ID of this version of the publication"
-                 " (for namespace insertions only)"),
-   1, &GNUNET_GETOPT_set_string, &this_id},
-  {'u', "uri", "URI",
-   gettext_noop ("URI to be published (can be used instead of passing a "
-                 "file to add keywords to the file with the respective URI)"),
-   1, &GNUNET_GETOPT_set_string, &uri_string}, 
-  {'V', "verbose", NULL,
-   gettext_noop ("be verbose (print progress information)"),
-   0, &GNUNET_GETOPT_set_one, &verbose},
-  GNUNET_GETOPT_OPTION_END
-};
 
 
 /**
@@ -687,6 +627,63 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'a', "anonymity", "LEVEL",
+     gettext_noop ("set the desired LEVEL of sender-anonymity"),
+     1, &GNUNET_GETOPT_set_uint, &anonymity},
+    {'d', "disable-creation-time", NULL,
+     gettext_noop
+     ("disable adding the creation time to the metadata of the uploaded file"),
+     0, &GNUNET_GETOPT_set_one, &do_disable_creation_time},
+    {'D', "disable-extractor", NULL,
+     gettext_noop
+     ("do not use libextractor to add keywords or metadata"),
+     0, &GNUNET_GETOPT_set_one, &disable_extractor},
+    {'e', "extract", NULL,
+     gettext_noop
+     ("print list of extracted keywords that would be used, but do not perform 
upload"),
+     0, &GNUNET_GETOPT_set_one, &extract_only},
+    {'k', "key", "KEYWORD",
+     gettext_noop
+     ("add an additional keyword for the top-level file or directory"
+      " (this option can be specified multiple times)"),
+     1, &GNUNET_FS_getopt_set_keywords, &topKeywords},
+    {'m', "meta", "TYPE:VALUE",
+     gettext_noop ("set the meta-data for the given TYPE to the given VALUE"),
+     1, &GNUNET_FS_getopt_set_metadata, &meta},
+    {'n', "noindex", NULL,
+     gettext_noop ("do not index, perform full insertion (stores entire "
+                  "file in encrypted form in GNUnet database)"),
+     0, &GNUNET_GETOPT_set_one, &do_insert},
+    {'N', "next", "ID",
+     gettext_noop
+     ("specify ID of an updated version to be published in the future"
+      " (for namespace insertions only)"),
+     1, &GNUNET_GETOPT_set_string, &next_id},
+    {'p', "priority", "PRIORITY",
+     gettext_noop ("specify the priority of the content"),
+     1, &GNUNET_GETOPT_set_uint, &priority},
+    {'P', "pseudonym", "NAME",
+     gettext_noop
+     ("publish the files under the pseudonym NAME (place file into 
namespace)"),
+     1, &GNUNET_GETOPT_set_string, &pseudonym},
+    {'s', "simulate-only", NULL,
+     gettext_noop ("only simulate the process but do not do any "
+                  "actual publishing (useful to compute URIs)"),
+     0, &GNUNET_GETOPT_set_one, &do_simulate},
+    {'t', "this", "ID",
+     gettext_noop ("set the ID of this version of the publication"
+                  " (for namespace insertions only)"),
+     1, &GNUNET_GETOPT_set_string, &this_id},
+    {'u', "uri", "URI",
+     gettext_noop ("URI to be published (can be used instead of passing a "
+                  "file to add keywords to the file with the respective URI)"),
+     1, &GNUNET_GETOPT_set_string, &uri_string}, 
+    {'V', "verbose", NULL,
+     gettext_noop ("be verbose (print progress information)"),
+     0, &GNUNET_GETOPT_set_one, &verbose},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/fs/gnunet-search.c
===================================================================
--- gnunet/src/fs/gnunet-search.c       2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-search.c       2010-06-18 14:09:55 UTC (rev 11802)
@@ -293,27 +293,6 @@
 
 
 /**
- * gnunet-search command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'a', "anonymity", "LEVEL",
-   gettext_noop ("set the desired LEVEL of receiver-anonymity"),
-   1, &GNUNET_GETOPT_set_uint, &anonymity},
-  {'n', "no-network", NULL,
-   gettext_noop ("only search the local peer (no P2P network search)"),
-   1, &GNUNET_GETOPT_set_uint, &local_only},
-  {'o', "output", "PREFIX",
-   gettext_noop
-   ("write search results to file starting with PREFIX"),
-   1, &GNUNET_GETOPT_set_string, &output_filename}, 
-  {'V', "verbose", NULL,
-   gettext_noop ("be verbose (print progress information)"),
-   0, &GNUNET_GETOPT_set_one, &verbose},
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to search GNUnet.
  *
  * @param argc number of arguments from the command line
@@ -323,6 +302,22 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'a', "anonymity", "LEVEL",
+     gettext_noop ("set the desired LEVEL of receiver-anonymity"),
+     1, &GNUNET_GETOPT_set_uint, &anonymity},
+    {'n', "no-network", NULL,
+     gettext_noop ("only search the local peer (no P2P network search)"),
+     1, &GNUNET_GETOPT_set_uint, &local_only},
+    {'o', "output", "PREFIX",
+     gettext_noop
+     ("write search results to file starting with PREFIX"),
+     1, &GNUNET_GETOPT_set_string, &output_filename}, 
+    {'V', "verbose", NULL,
+     gettext_noop ("be verbose (print progress information)"),
+     0, &GNUNET_GETOPT_set_one, &verbose},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/fs/gnunet-unindex.c
===================================================================
--- gnunet/src/fs/gnunet-unindex.c      2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/fs/gnunet-unindex.c      2010-06-18 14:09:55 UTC (rev 11802)
@@ -185,17 +185,6 @@
 
 
 /**
- * gnunet-unindex command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'V', "verbose", NULL,
-   gettext_noop ("be verbose (print progress information)"),
-   0, &GNUNET_GETOPT_set_one, &verbose},
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to unindex content.
  *
  * @param argc number of arguments from the command line
@@ -205,6 +194,12 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'V', "verbose", NULL,
+     gettext_noop ("be verbose (print progress information)"),
+     0, &GNUNET_GETOPT_set_one, &verbose},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c        2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c        2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -87,42 +87,19 @@
 /**
  * Handle to the hostlist client's advertisement handler
  */
-static GNUNET_CORE_MessageCallback client_adv_handler = NULL;
+static GNUNET_CORE_MessageCallback client_adv_handler;
 
 /**
  * Handle to hostlist client's connect handler
  */
-static GNUNET_CORE_ConnectEventHandler client_ch = NULL;
+static GNUNET_CORE_ConnectEventHandler client_ch;
 
 /**
  * Handle to hostlist client's disconnect handler
  */
-static GNUNET_CORE_DisconnectEventHandler client_dh = NULL;
+static GNUNET_CORE_DisconnectEventHandler client_dh;
 
 /**
- * gnunet-daemon-hostlist command line options.
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-#if HAVE_MHD
-  { 'a', "advertise", NULL, 
-    gettext_noop ("advertise our hostlist to other peers"),
-    GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising },
-#endif
-  { 'b', "bootstrap", NULL, 
-    gettext_noop ("bootstrap using hostlists (it is highly recommended that 
you always use this option)"),
-    GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping },
-  { 'e', "enable-learning", NULL,
-    gettext_noop ("enable learning about hostlist servers from other peers"),
-    GNUNET_NO, &GNUNET_GETOPT_set_one, &learning},
-#if HAVE_MHD
-  { 'p', "provide-hostlist", NULL, 
-    gettext_noop ("provide a hostlist server"),
-    GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist},
-#endif
-  GNUNET_GETOPT_OPTION_END
-};
-
-/**
  * A HOSTLIST_ADV message is used to exchange information about
  * hostlist advertisements.  This struct is always
  * followed by the actual url under which the hostlist can be obtained:
@@ -253,24 +230,8 @@
     }
 }
 
-/**
- * List of handlers if we are learning.
- */
-static struct GNUNET_CORE_MessageHandler learn_handlers[] = {
-  { &advertisement_handler, GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, 0},
-  { NULL, 0, 0 }
-};
 
-
 /**
- * List of handlers if we are not learning.
- */
-static struct GNUNET_CORE_MessageHandler no_learn_handlers[] = {
-    { NULL, 0, 0 }
-};
-
-
-/**
  * Main function that will be run.
  *
  * @param cls closure
@@ -286,6 +247,13 @@
      const char *cfgfile,
      const struct GNUNET_CONFIGURATION_Handle * cfg)
 {
+  static const struct GNUNET_CORE_MessageHandler learn_handlers[] = {
+    { &advertisement_handler, GNUNET_MESSAGE_TYPE_HOSTLIST_ADVERTISEMENT, 0},
+    { NULL, 0, 0 }
+  };
+  static const struct GNUNET_CORE_MessageHandler no_learn_handlers[] = {
+    { NULL, 0, 0 }
+  };
   if ( (! bootstrapping) &&
        (! learning) 
 #if HAVE_MHD
@@ -348,9 +316,28 @@
 int
 main (int argc, char *const *argv)
 {
-  int ret;
-  GNUNET_log_setup ("hostlist","DEBUG",NULL);
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+#if HAVE_MHD
+    { 'a', "advertise", NULL, 
+      gettext_noop ("advertise our hostlist to other peers"),
+      GNUNET_NO, &GNUNET_GETOPT_set_one, &advertising },
+#endif
+    { 'b', "bootstrap", NULL, 
+      gettext_noop ("bootstrap using hostlists (it is highly recommended that 
you always use this option)"),
+      GNUNET_NO, &GNUNET_GETOPT_set_one, &bootstrapping },
+    { 'e', "enable-learning", NULL,
+      gettext_noop ("enable learning about hostlist servers from other peers"),
+      GNUNET_NO, &GNUNET_GETOPT_set_one, &learning},
+#if HAVE_MHD
+    { 'p', "provide-hostlist", NULL, 
+      gettext_noop ("provide a hostlist server"),
+      GNUNET_NO, &GNUNET_GETOPT_set_one, &provide_hostlist},
+#endif
+    GNUNET_GETOPT_OPTION_END
+  };
 
+  int ret;
+  GNUNET_log_setup ("hostlist", "WARNING", NULL);
   ret = (GNUNET_OK ==
          GNUNET_PROGRAM_run (argc,
                              argv,

Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c       2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/hostlist/hostlist-client.c       2010-06-18 14:09:55 UTC (rev 
11802)
@@ -116,12 +116,12 @@
 /**
  * Statistics handle.
  */
-struct GNUNET_STATISTICS_Handle *stats; 
+static struct GNUNET_STATISTICS_Handle *stats; 
 
 /**
  * Transport handle.
  */
-struct GNUNET_TRANSPORT_Handle *transport;
+static struct GNUNET_TRANSPORT_Handle *transport;
                        
 /**
  * Proxy that we are using (can be NULL).

Modified: gnunet/src/peerinfo/gnunet-service-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-service-peerinfo.c       2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/peerinfo/gnunet-service-peerinfo.c       2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -776,22 +776,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0},
-  {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET,
-   sizeof (struct ListPeerMessage)},
-  {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL,
-   sizeof (struct ListAllPeersMessage)},
-  {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY,
-   sizeof (struct GNUNET_MessageHeader)},
-  {NULL, NULL, 0, 0}
-};
-
-
-/**
  * Clean up our state.  Called during shutdown.
  *
  * @param cls unused
@@ -825,6 +809,16 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_hello, NULL, GNUNET_MESSAGE_TYPE_HELLO, 0},
+    {&handle_get, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET,
+     sizeof (struct ListPeerMessage)},
+    {&handle_get_all, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_GET_ALL,
+     sizeof (struct ListAllPeersMessage)},
+    {&handle_notify, NULL, GNUNET_MESSAGE_TYPE_PEERINFO_NOTIFY,
+     sizeof (struct GNUNET_MessageHeader)},
+    {NULL, NULL, 0, 0}
+  };
   stats = GNUNET_STATISTICS_create (sched, "peerinfo", cfg);
   notify_list = GNUNET_SERVER_notification_context_create (server, 0);
   GNUNET_assert (GNUNET_OK ==

Modified: gnunet/src/peerinfo-tool/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/peerinfo-tool/gnunet-peerinfo.c  2010-06-18 14:09:55 UTC (rev 
11802)
@@ -305,22 +305,6 @@
 
 
 /**
- * gnunet-peerinfo command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'n', "numeric", NULL,
-   gettext_noop ("don't resolve host names"),
-   0, &GNUNET_GETOPT_set_one, &no_resolve},
-  {'q', "quiet", NULL,
-   gettext_noop ("output only the identity strings"),
-   0, &GNUNET_GETOPT_set_one, &be_quiet},
-  {'s', "self", NULL,
-   gettext_noop ("output our own identity only"),
-   0, &GNUNET_GETOPT_set_one, &get_self},
-  GNUNET_GETOPT_OPTION_END
-};
-
-/**
  * The main function to obtain peer information.
  *
  * @param argc number of arguments from the command line
@@ -330,6 +314,18 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'n', "numeric", NULL,
+     gettext_noop ("don't resolve host names"),
+     0, &GNUNET_GETOPT_set_one, &no_resolve},
+    {'q', "quiet", NULL,
+     gettext_noop ("output only the identity strings"),
+     0, &GNUNET_GETOPT_set_one, &be_quiet},
+    {'s', "self", NULL,
+     gettext_noop ("output our own identity only"),
+     0, &GNUNET_GETOPT_set_one, &get_self},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/statistics/gnunet-service-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-service-statistics.c   2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/statistics/gnunet-service-statistics.c   2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -420,17 +420,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0},
-  {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0},
-  {NULL, NULL, 0, 0}
-};
-
-
-/**
  * Task run during shutdown.
  *
  * @param cls unused
@@ -458,6 +447,11 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_set, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_SET, 0},
+    {&handle_get, NULL, GNUNET_MESSAGE_TYPE_STATISTICS_GET, 0},
+    {NULL, NULL, 0, 0}
+  };
   cfg = c;
   GNUNET_SERVER_add_handlers (server, handlers);
   load (server);

Modified: gnunet/src/statistics/gnunet-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-statistics.c   2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/statistics/gnunet-statistics.c   2010-06-18 14:09:55 UTC (rev 
11802)
@@ -150,23 +150,6 @@
 }
 
 /**
- * gnunet-statistics command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  {'n', "name", "NAME",
-   gettext_noop ("limit output to statistcs for the given NAME"), 1,
-   &GNUNET_GETOPT_set_string, &name},
-  {'p', "persistent", NULL,
-   gettext_noop ("make the value being set persistent"), 0,
-   &GNUNET_GETOPT_set_one, &persistent},
-  {'s', "subsystem", "SUBSYSTEM",
-   gettext_noop ("limit output to the given SUBSYSTEM"), 1,
-   &GNUNET_GETOPT_set_string, &subsystem},
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function to obtain statistics in GNUnet.
  *
  * @param argc number of arguments from the command line
@@ -176,6 +159,18 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    {'n', "name", "NAME",
+     gettext_noop ("limit output to statistcs for the given NAME"), 1,
+     &GNUNET_GETOPT_set_string, &name},
+    {'p', "persistent", NULL,
+     gettext_noop ("make the value being set persistent"), 0,
+     &GNUNET_GETOPT_set_one, &persistent},
+    {'s', "subsystem", "SUBSYSTEM",
+     gettext_noop ("limit output to the given SUBSYSTEM"), 1,
+     &GNUNET_GETOPT_set_string, &subsystem},
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/template/gnunet-service-template.c
===================================================================
--- gnunet/src/template/gnunet-service-template.c       2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/template/gnunet-service-template.c       2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -29,16 +29,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  /* FIXME: add handlers here! */
-  {NULL, NULL, 0, 0}
-};
-
-
-/**
  * Task run during shutdown.
  *
  * @param cls unused
@@ -66,6 +56,10 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    /* FIXME: add handlers here! */
+    {NULL, NULL, 0, 0}
+  };
   /* FIXME: do setup here */
   GNUNET_SERVER_add_handlers (server, handlers);
   GNUNET_SCHEDULER_add_delayed (sched,

Modified: gnunet/src/template/gnunet-template.c
===================================================================
--- gnunet/src/template/gnunet-template.c       2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/template/gnunet-template.c       2010-06-18 14:09:55 UTC (rev 
11802)
@@ -52,15 +52,7 @@
   /* main code here */
 }
 
-/**
- * gnunet-template command line options
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  /* FIMXE: add options here */
-  GNUNET_GETOPT_OPTION_END
-};
 
-
 /**
  * The main function to obtain template from gnunetd.
  *
@@ -71,6 +63,10 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    /* FIMXE: add options here */
+    GNUNET_GETOPT_OPTION_END
+  };
   return (GNUNET_OK ==
           GNUNET_PROGRAM_run (argc,
                               argv,

Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c        2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/topology/gnunet-daemon-topology.c        2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -1431,14 +1431,6 @@
 
 
 /**
- * gnunet-daemon-topology command line options.
- */
-static struct GNUNET_GETOPT_CommandLineOption options[] = {
-  GNUNET_GETOPT_OPTION_END
-};
-
-
-/**
  * The main function for the topology daemon.
  *
  * @param argc number of arguments from the command line
@@ -1448,6 +1440,9 @@
 int
 main (int argc, char *const *argv)
 {
+  static const struct GNUNET_GETOPT_CommandLineOption options[] = {
+    GNUNET_GETOPT_OPTION_END
+  };
   int ret;
 
   ret = (GNUNET_OK ==

Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2010-06-18 13:55:31 UTC 
(rev 11801)
+++ gnunet/src/transport/gnunet-service-transport.c     2010-06-18 14:09:55 UTC 
(rev 11802)
@@ -4656,30 +4656,7 @@
                                          &transmit_address_to_client, tc);
 }
 
-/**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_start, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_START, 0},
-  {&handle_hello, NULL,
-   GNUNET_MESSAGE_TYPE_HELLO, 0},
-  {&handle_send, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 0},
-  {&handle_set_quota, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, sizeof (struct QuotaSetMessage)},
-  {&handle_address_lookup, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP,
-   0},
-  {&handle_blacklist_init, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT, sizeof (struct 
GNUNET_MessageHeader)},
-  {&handle_blacklist_reply, NULL,
-   GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY, sizeof (struct 
BlacklistMessage)},
-  {NULL, NULL, 0, 0}
-};
 
-
 /**
  * Setup the environment for this plugin.
  */
@@ -4917,6 +4894,24 @@
      struct GNUNET_SERVER_Handle *serv,
      const struct GNUNET_CONFIGURATION_Handle *c)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_start, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_START, 0},
+    {&handle_hello, NULL,
+     GNUNET_MESSAGE_TYPE_HELLO, 0},
+    {&handle_send, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_SEND, 0},
+    {&handle_set_quota, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_SET_QUOTA, sizeof (struct QuotaSetMessage)},
+    {&handle_address_lookup, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_LOOKUP,
+     0},
+    {&handle_blacklist_init, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_INIT, sizeof (struct 
GNUNET_MessageHeader)},
+    {&handle_blacklist_reply, NULL,
+     GNUNET_MESSAGE_TYPE_TRANSPORT_BLACKLIST_REPLY, sizeof (struct 
BlacklistMessage)},
+    {NULL, NULL, 0, 0}
+  };
   char *plugs;
   char *pos;
   int no_transports;

Modified: gnunet/src/util/crypto_hash.c
===================================================================
--- gnunet/src/util/crypto_hash.c       2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/util/crypto_hash.c       2010-06-18 14:09:55 UTC (rev 11802)
@@ -63,36 +63,6 @@
   return (x >> y) | (x << (64 - y));
 }
 
-const unsigned long long sha512_K[80] = {
-  0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
-  0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
-  0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL,
-  0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
-  0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL,
-  0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
-  0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL,
-  0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
-  0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL,
-  0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
-  0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL,
-  0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
-  0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL,
-  0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
-  0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL,
-  0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
-  0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL,
-  0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
-  0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL,
-  0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
-  0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL,
-  0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
-  0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL,
-  0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
-  0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL,
-  0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
-  0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
-};
-
 #define e0(x)       (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
 #define e1(x)       (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
 #define s0(x)       (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
@@ -143,6 +113,36 @@
 static void
 sha512_transform (unsigned long long *state, const unsigned char *input)
 {
+  static const unsigned long long sha512_K[80] = {
+    0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
+    0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
+    0x923f82a4af194f9bULL, 0xab1c5ed5da6d8118ULL, 0xd807aa98a3030242ULL,
+    0x12835b0145706fbeULL, 0x243185be4ee4b28cULL, 0x550c7dc3d5ffb4e2ULL,
+    0x72be5d74f27b896fULL, 0x80deb1fe3b1696b1ULL, 0x9bdc06a725c71235ULL,
+    0xc19bf174cf692694ULL, 0xe49b69c19ef14ad2ULL, 0xefbe4786384f25e3ULL,
+    0x0fc19dc68b8cd5b5ULL, 0x240ca1cc77ac9c65ULL, 0x2de92c6f592b0275ULL,
+    0x4a7484aa6ea6e483ULL, 0x5cb0a9dcbd41fbd4ULL, 0x76f988da831153b5ULL,
+    0x983e5152ee66dfabULL, 0xa831c66d2db43210ULL, 0xb00327c898fb213fULL,
+    0xbf597fc7beef0ee4ULL, 0xc6e00bf33da88fc2ULL, 0xd5a79147930aa725ULL,
+    0x06ca6351e003826fULL, 0x142929670a0e6e70ULL, 0x27b70a8546d22ffcULL,
+    0x2e1b21385c26c926ULL, 0x4d2c6dfc5ac42aedULL, 0x53380d139d95b3dfULL,
+    0x650a73548baf63deULL, 0x766a0abb3c77b2a8ULL, 0x81c2c92e47edaee6ULL,
+    0x92722c851482353bULL, 0xa2bfe8a14cf10364ULL, 0xa81a664bbc423001ULL,
+    0xc24b8b70d0f89791ULL, 0xc76c51a30654be30ULL, 0xd192e819d6ef5218ULL,
+    0xd69906245565a910ULL, 0xf40e35855771202aULL, 0x106aa07032bbd1b8ULL,
+    0x19a4c116b8d2d0c8ULL, 0x1e376c085141ab53ULL, 0x2748774cdf8eeb99ULL,
+    0x34b0bcb5e19b48a8ULL, 0x391c0cb3c5c95a63ULL, 0x4ed8aa4ae3418acbULL,
+    0x5b9cca4f7763e373ULL, 0x682e6ff3d6b2b8a3ULL, 0x748f82ee5defb2fcULL,
+    0x78a5636f43172f60ULL, 0x84c87814a1f0ab72ULL, 0x8cc702081a6439ecULL,
+    0x90befffa23631e28ULL, 0xa4506cebde82bde9ULL, 0xbef9a3f7b2c67915ULL,
+    0xc67178f2e372532bULL, 0xca273eceea26619cULL, 0xd186b8c721c0c207ULL,
+    0xeada7dd6cde0eb1eULL, 0xf57d4f7fee6ed178ULL, 0x06f067aa72176fbaULL,
+    0x0a637dc5a2c898a6ULL, 0x113f9804bef90daeULL, 0x1b710b35131c471bULL,
+    0x28db77f523047d84ULL, 0x32caab7b40c72493ULL, 0x3c9ebe0a15c9bebcULL,
+    0x431d67c49c100d4cULL, 0x4cc5d4becb3e42b6ULL, 0x597f299cfc657e2aULL,
+    0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
+  };
+  
   unsigned long long a, b, c, d, e, f, g, h, t1, t2;
   unsigned long long W[80];
   unsigned long long t0;
@@ -561,11 +561,6 @@
 
 /* ***************** binary-ASCII encoding *************** */
 
-/**
- * 32 characters for encoding (GNUNET_CRYPTO_hash => 32 characters)
- */
-static char *encTable__ = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
-
 static unsigned int
 getValue__ (unsigned char a)
 {
@@ -591,6 +586,10 @@
 GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block,
                            struct GNUNET_CRYPTO_HashAsciiEncoded *result)
 {
+  /**
+   * 32 characters for encoding (GNUNET_CRYPTO_hash => 32 characters)
+   */
+  static char *encTable__ = "0123456789ABCDEFGHIJKLMNOPQRSTUV";
   unsigned int wpos;
   unsigned int rpos;
   unsigned int bits;

Modified: gnunet/src/util/crypto_ksk.c
===================================================================
--- gnunet/src/util/crypto_ksk.c        2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/util/crypto_ksk.c        2010-06-18 14:09:55 UTC (rev 11802)
@@ -67,95 +67,6 @@
 };
 
 
-/* Note: 2 is not included because it can be tested more easily by
-   looking at bit 0. The last entry in this list is marked by a zero */
-static uint16_t small_prime_numbers[] = {
-  3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
-  47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,
-  103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
-  157, 163, 167, 173, 179, 181, 191, 193, 197, 199,
-  211, 223, 227, 229, 233, 239, 241, 251, 257, 263,
-  269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
-  331, 337, 347, 349, 353, 359, 367, 373, 379, 383,
-  389, 397, 401, 409, 419, 421, 431, 433, 439, 443,
-  449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
-  509, 521, 523, 541, 547, 557, 563, 569, 571, 577,
-  587, 593, 599, 601, 607, 613, 617, 619, 631, 641,
-  643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
-  709, 719, 727, 733, 739, 743, 751, 757, 761, 769,
-  773, 787, 797, 809, 811, 821, 823, 827, 829, 839,
-  853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
-  919, 929, 937, 941, 947, 953, 967, 971, 977, 983,
-  991, 997, 1009, 1013, 1019, 1021, 1031, 1033,
-  1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091,
-  1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
-  1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213,
-  1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277,
-  1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307,
-  1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,
-  1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
-  1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493,
-  1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559,
-  1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609,
-  1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667,
-  1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
-  1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,
-  1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871,
-  1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931,
-  1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997,
-  1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,
-  2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111,
-  2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161,
-  2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243,
-  2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,
-  2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,
-  2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411,
-  2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473,
-  2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551,
-  2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633,
-  2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,
-  2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729,
-  2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791,
-  2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851,
-  2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917,
-  2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,
-  3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061,
-  3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137,
-  3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209,
-  3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271,
-  3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,
-  3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391,
-  3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467,
-  3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533,
-  3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583,
-  3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,
-  3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709,
-  3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779,
-  3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851,
-  3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917,
-  3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,
-  4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049,
-  4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111,
-  4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177,
-  4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243,
-  4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,
-  4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391,
-  4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457,
-  4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519,
-  4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597,
-  4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,
-  4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729,
-  4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799,
-  4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889,
-  4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951,
-  4957, 4967, 4969, 4973, 4987, 4993, 4999,
-  0
-};
-
-#define DIM(v) (sizeof(v)/sizeof((v)[0]))
-static int no_of_small_prime_numbers = DIM (small_prime_numbers) - 1;
-
-
 static unsigned int
 get_nbits (mpz_t a)
 {
@@ -258,6 +169,93 @@
 static void
 gen_prime (mpz_t ptest, unsigned int nbits, GNUNET_HashCode * hc)
 {
+  /* Note: 2 is not included because it can be tested more easily by
+     looking at bit 0. The last entry in this list is marked by a zero */
+  static const uint16_t small_prime_numbers[] = {
+    3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43,
+    47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101,
+    103, 107, 109, 113, 127, 131, 137, 139, 149, 151,
+    157, 163, 167, 173, 179, 181, 191, 193, 197, 199,
+    211, 223, 227, 229, 233, 239, 241, 251, 257, 263,
+    269, 271, 277, 281, 283, 293, 307, 311, 313, 317,
+    331, 337, 347, 349, 353, 359, 367, 373, 379, 383,
+    389, 397, 401, 409, 419, 421, 431, 433, 439, 443,
+    449, 457, 461, 463, 467, 479, 487, 491, 499, 503,
+    509, 521, 523, 541, 547, 557, 563, 569, 571, 577,
+    587, 593, 599, 601, 607, 613, 617, 619, 631, 641,
+    643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
+    709, 719, 727, 733, 739, 743, 751, 757, 761, 769,
+    773, 787, 797, 809, 811, 821, 823, 827, 829, 839,
+    853, 857, 859, 863, 877, 881, 883, 887, 907, 911,
+    919, 929, 937, 941, 947, 953, 967, 971, 977, 983,
+    991, 997, 1009, 1013, 1019, 1021, 1031, 1033,
+    1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091,
+    1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
+    1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213,
+    1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277,
+    1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307,
+    1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399,
+    1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
+    1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493,
+    1499, 1511, 1523, 1531, 1543, 1549, 1553, 1559,
+    1567, 1571, 1579, 1583, 1597, 1601, 1607, 1609,
+    1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667,
+    1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
+    1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789,
+    1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871,
+    1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931,
+    1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997,
+    1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053,
+    2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111,
+    2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161,
+    2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243,
+    2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297,
+    2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357,
+    2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411,
+    2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473,
+    2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551,
+    2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633,
+    2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687,
+    2689, 2693, 2699, 2707, 2711, 2713, 2719, 2729,
+    2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791,
+    2797, 2801, 2803, 2819, 2833, 2837, 2843, 2851,
+    2857, 2861, 2879, 2887, 2897, 2903, 2909, 2917,
+    2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999,
+    3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061,
+    3067, 3079, 3083, 3089, 3109, 3119, 3121, 3137,
+    3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209,
+    3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271,
+    3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331,
+    3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391,
+    3407, 3413, 3433, 3449, 3457, 3461, 3463, 3467,
+    3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533,
+    3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583,
+    3593, 3607, 3613, 3617, 3623, 3631, 3637, 3643,
+    3659, 3671, 3673, 3677, 3691, 3697, 3701, 3709,
+    3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779,
+    3793, 3797, 3803, 3821, 3823, 3833, 3847, 3851,
+    3853, 3863, 3877, 3881, 3889, 3907, 3911, 3917,
+    3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989,
+    4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049,
+    4051, 4057, 4073, 4079, 4091, 4093, 4099, 4111,
+    4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177,
+    4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243,
+    4253, 4259, 4261, 4271, 4273, 4283, 4289, 4297,
+    4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391,
+    4397, 4409, 4421, 4423, 4441, 4447, 4451, 4457,
+    4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519,
+    4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597,
+    4603, 4621, 4637, 4639, 4643, 4649, 4651, 4657,
+    4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729,
+    4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799,
+    4801, 4813, 4817, 4831, 4861, 4871, 4877, 4889,
+    4903, 4909, 4919, 4931, 4933, 4937, 4943, 4951,
+    4957, 4967, 4969, 4973, 4987, 4993, 4999,
+    0
+  };
+#define DIM(v) (sizeof(v)/sizeof((v)[0]))
+  static int no_of_small_prime_numbers = DIM (small_prime_numbers) - 1;
+
   mpz_t prime, pminus1, val_2, val_3, result;
   int i;
   unsigned x, step;

Modified: gnunet/src/util/getopt.c
===================================================================
--- gnunet/src/util/getopt.c    2010-06-18 13:55:31 UTC (rev 11801)
+++ gnunet/src/util/getopt.c    2010-06-18 14:09:55 UTC (rev 11802)
@@ -135,12 +135,6 @@
 /* 1003.2 says this must be 1 before any call.  */
 static int GNoptind = 1;
 
-/* Formerly, initialization of getopt depended on GNoptind==0, which
-   causes problems with re-calling getopt as programs generally don't
-   know that. */
-
-static int __getopt_initialized = 0;
-
 /* The next char to be scanned in the option-element
    in which the last option character we returned was found.
    This allows us to pick up the scan where we left off.
@@ -150,17 +144,7 @@
 
 static char *nextchar;
 
-/* Callers store zero here to inhibit the error message
-   for unrecognized options.  */
 
-static int GNopterr = 1;
-
-/* Set to an option character which was unrecognized.
-   This must be initialized on some systems to avoid linking in the
-   system's own getopt implementation.  */
-
-static int GNoptopt = '?';
-
 /* Describe how to deal with options that follow non-option ARGV-elements.
 
    If the caller did not specify anything,
@@ -513,14 +497,17 @@
    long-named options.  */
 
 static int
-GN_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
-     int argc;
-     char *const *argv;
-     const char *optstring;
-     const struct GNoption *longopts;
-     int *longind;
-     int long_only;
+GN_getopt_internal (int argc,
+                   char *const *argv,
+                   const char *optstring,
+                   const struct GNoption *longopts,
+                   int *longind,
+                   int long_only)
 {
+  static int __getopt_initialized = 0;
+  static int GNopterr = 1;
+  static int GNoptopt = '?';
+
   GNoptarg = NULL;
 
   if (GNoptind == 0 || !__getopt_initialized)

Modified: gnunet/src/util/gnunet-service-resolver.c
===================================================================
--- gnunet/src/util/gnunet-service-resolver.c   2010-06-18 13:55:31 UTC (rev 
11801)
+++ gnunet/src/util/gnunet-service-resolver.c   2010-06-18 14:09:55 UTC (rev 
11802)
@@ -473,16 +473,6 @@
 
 
 /**
- * List of handlers for the messages understood by this
- * service.
- */
-static struct GNUNET_SERVER_MessageHandler handlers[] = {
-  {&handle_get, NULL, GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, 0},
-  {NULL, NULL, 0, 0}
-};
-
-
-/**
  * Process resolver requests.
  *
  * @param cls closure
@@ -496,6 +486,10 @@
      struct GNUNET_SERVER_Handle *server,
      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
+  static const struct GNUNET_SERVER_MessageHandler handlers[] = {
+    {&handle_get, NULL, GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST, 0},
+    {NULL, NULL, 0, 0}
+  };
   GNUNET_SERVER_add_handlers (server, handlers);
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]