const-ing of config-handles
authorChristian Grothoff <christian@grothoff.org>
Sun, 26 Jul 2009 21:20:11 +0000 (21:20 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 26 Jul 2009 21:20:11 +0000 (21:20 +0000)
75 files changed:
src/Makefile.am
src/arm/arm_api.c
src/arm/gnunet-arm.c
src/arm/gnunet-service-arm.c
src/arm/test_arm_api.c
src/core/core_api.c
src/core/gnunet-service-core.c
src/core/test_core_api.c
src/core/test_core_api_start_only.c
src/datacache/datacache_api.c
src/datacache/perf_datacache_api.c
src/datacache/plugin_datacache.h
src/datacache/test_datacache_api.c
src/datacache/test_datacache_api_quota.c
src/datastore/datastore_api.c
src/datastore/gnunet-service-datastore.c
src/datastore/perf_datastore_api.c
src/datastore/perf_plugin_datastore.c
src/datastore/plugin_datastore.h
src/datastore/plugin_datastore_sqlite.c
src/datastore/test_datastore_api.c
src/datastore/test_datastore_api_management.c
src/hostlist/gnunet-daemon-hostlist.c
src/hostlist/hostlist-client.c
src/hostlist/hostlist-client.h
src/hostlist/hostlist-server.c
src/hostlist/hostlist-server.h
src/include/gnunet_arm_service.h
src/include/gnunet_client_lib.h
src/include/gnunet_configuration_lib.h
src/include/gnunet_core_service.h
src/include/gnunet_datacache_lib.h
src/include/gnunet_datastore_service.h
src/include/gnunet_disk_lib.h
src/include/gnunet_fs_service.h
src/include/gnunet_getopt_lib.h
src/include/gnunet_os_lib.h
src/include/gnunet_peerinfo_service.h
src/include/gnunet_program_lib.h
src/include/gnunet_pseudonym_lib.h
src/include/gnunet_resolver_service.h
src/include/gnunet_service_lib.h
src/include/gnunet_statistics_service.h
src/include/gnunet_testing_lib.h
src/include/gnunet_transport_service.h
src/peerinfo/gnunet-peerinfo.c
src/peerinfo/gnunet-service-peerinfo.c
src/peerinfo/peerinfo_api.c
src/peerinfo/test_peerinfo_api.c
src/resolver/gnunet-service-resolver.c
src/resolver/resolver_api.c
src/resolver/test_resolver_api.c
src/statistics/gnunet-service-statistics.c
src/statistics/gnunet-statistics.c
src/statistics/statistics_api.c
src/statistics/test_statistics_api.c
src/template/gnunet-service-template.c
src/template/gnunet-template.c
src/topology/gnunet-daemon-topology.c
src/transport/gnunet-service-transport.c
src/transport/plugin_transport.h
src/transport/test_plugin_transport.c
src/transport/test_transport_api.c
src/transport/transport_api.c
src/util/client.c
src/util/configuration.c
src/util/disk.c
src/util/getopt.c
src/util/os_load.c
src/util/program.c
src/util/pseudonym.c
src/util/service.c
src/util/test_getopt.c
src/util/test_program.c
src/util/test_service.c

index 42a668c756642a9848cf65443507d05af660bd12..d533b758c7724a1c155fe8d5b614f64562f8d32e 100644 (file)
@@ -11,13 +11,13 @@ SUBDIRS = \
   include $(INTLEMU_SUBDIRS) \
   util \
   arm \
-  datacache \
-  datastore \
   fragmentation \
   hello \
   peerinfo \
   resolver \
   statistics \
+  datacache \
+  datastore \
   template \
   transport \
   core \
index 7f120e6a6a7b90dacc173f77da5879eb72095994..7ae3e9513da473feadbff7ad5b770d6fd8c6bfb8 100644 (file)
@@ -39,7 +39,7 @@ struct ArmContext
   void *cls;
   char *service_name;
   struct GNUNET_CLIENT_Connection *client;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_TIME_Absolute timeout;
   uint16_t type;
 };
@@ -195,7 +195,7 @@ send_service_msg (void *cls, size_t size, void *buf)
  */
 static void
 change_service (const char *service_name,
-                struct GNUNET_CONFIGURATION_Handle *cfg,
+                const struct GNUNET_CONFIGURATION_Handle *cfg,
                 struct GNUNET_SCHEDULER_Handle *sched,
                 struct GNUNET_TIME_Relative timeout,
                 GNUNET_ARM_Callback cb, void *cb_cls, uint16_t type)
@@ -266,7 +266,7 @@ change_service (const char *service_name,
  */
 void
 GNUNET_ARM_start_service (const char *service_name,
-                          struct GNUNET_CONFIGURATION_Handle *cfg,
+                          const struct GNUNET_CONFIGURATION_Handle *cfg,
                           struct GNUNET_SCHEDULER_Handle *sched,
                           struct GNUNET_TIME_Relative timeout,
                           GNUNET_ARM_Callback cb, void *cb_cls)
@@ -308,7 +308,7 @@ GNUNET_ARM_start_service (const char *service_name,
  */
 void
 GNUNET_ARM_stop_service (const char *service_name,
-                         struct GNUNET_CONFIGURATION_Handle *cfg,
+                         const struct GNUNET_CONFIGURATION_Handle *cfg,
                          struct GNUNET_SCHEDULER_Handle *sched,
                          struct GNUNET_TIME_Relative timeout,
                          GNUNET_ARM_Callback cb, void *cb_cls)
index f8f5bc20f1603620888038e15cf8608fe8208533..740fd25338465163b0ea7f280f5c3e234b174ff0 100644 (file)
@@ -111,7 +111,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile, 
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   if (term != NULL)
     {
index a844452711d1aa4b37605a08c2d49f7ba0bcd23e..32674117c736146dfb121464be088c8d5b4287a5 100644 (file)
@@ -124,7 +124,7 @@ static struct ServiceList *running;
 /**
  * Our configuration
  */
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Our scheduler.
@@ -562,7 +562,7 @@ maint (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
                                 GNUNET_YES,
                                 GNUNET_SCHEDULER_PRIORITY_IDLE,
                                 GNUNET_SCHEDULER_NO_TASK,
-                                MAINT_FREQUENCY, &maint, cfg);
+                                MAINT_FREQUENCY, &maint, NULL);
 
   /* check for services that died (WAITPID) */
   prev = NULL;
@@ -675,7 +675,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *c)
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *defaultservices;
   char *pos;
index 89f63d3ec590f0a8dd6f90b55529231db62d2d91..fbd90583eedaa4c9c78efcb3892aa940f8d6454d 100644 (file)
@@ -38,7 +38,7 @@
 
 static struct GNUNET_SCHEDULER_Handle *sched;
 
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 static int ok = 1;
 
@@ -84,7 +84,8 @@ static void
 task (void *cls,
       struct GNUNET_SCHEDULER_Handle *s,
       char *const *args,
-      const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *c)
+      const char *cfgfile,
+      const struct GNUNET_CONFIGURATION_Handle *c)
 {
   cfg = c;
   sched = s;
index 67b21ca266b0de93e4f9f572944668e3d478fdb5..f3e30eb9a7d0e339918dae13d1c66058927fa1bc 100644 (file)
@@ -43,7 +43,7 @@ struct GNUNET_CORE_Handle
   /**
    * Configuration we're using.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Closure for the various callbacks.
@@ -777,7 +777,7 @@ transmit_start (void *cls, size_t size, void *buf)
  */
 void
 GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched,
-                     struct GNUNET_CONFIGURATION_Handle *cfg,
+                     const struct GNUNET_CONFIGURATION_Handle *cfg,
                      struct GNUNET_TIME_Relative timeout,
                      void *cls,
                      GNUNET_CORE_StartupCallback init,
index 0a96d8288059d12fa20f89731ebeb80186061557..6f6129f77c372d2e0a60b4caaff6b1744a41306a 100644 (file)
@@ -617,7 +617,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
 /**
  * Our configuration.
  */
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Our server.
@@ -3121,7 +3121,8 @@ cleaning_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
-     struct GNUNET_SERVER_Handle *serv, struct GNUNET_CONFIGURATION_Handle *c)
+     struct GNUNET_SERVER_Handle *serv,
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
 #if 0
   unsigned long long qin;
@@ -3206,7 +3207,8 @@ run (void *cls,
  * Function called during shutdown.  Clean up our state.
  */
 static void
-cleanup (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+cleanup (void *cls, 
+        const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   if (my_private_key != NULL)
     GNUNET_CRYPTO_rsa_key_free (my_private_key);
index f2095025ffffb0d91300eb1ca344148c5ddc7b2e..89aa9b13eb9e651d491777212c76164d898fe65b 100644 (file)
@@ -48,7 +48,7 @@
 
 struct PeerContext
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_CORE_Handle *ch;
   struct GNUNET_PeerIdentity id;   
   struct GNUNET_TRANSPORT_Handle *th;
@@ -313,7 +313,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_assert (ok == 1);
   OKPP;
index c3ea8559321c124a3ddcb1bb64a0566ec915db2b..f1993325c24783210ee494e04aaf6a60e7d91b90 100644 (file)
@@ -45,7 +45,7 @@
 
 struct PeerContext
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_CORE_Handle *ch;
   struct GNUNET_PeerIdentity id;
 #if START_ARM
@@ -176,7 +176,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile, 
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_assert (ok == 1);
   OKPP;
index 0958c1d2c57c27b764dbd1419714235a7300df95..421acac0ff1bc9093f6c903cc259658d40403ea3 100644 (file)
@@ -47,7 +47,7 @@ struct GNUNET_DATACACHE_Handle
   /**
    * Our configuration.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Configuration section to use.
@@ -118,7 +118,7 @@ env_delete_notify (void *cls,
  */
 struct GNUNET_DATACACHE_Handle *
 GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
-                        struct GNUNET_CONFIGURATION_Handle *cfg,
+                        const struct GNUNET_CONFIGURATION_Handle *cfg,
                         const char *section)
 {
   int fd;
index b1c8d4ba64e222f4267a51832d8ca2d42c73e251..aa008a33229de32c7917010dde6d9cdab04ce449 100644 (file)
@@ -54,7 +54,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_DATACACHE_Handle *h;
   GNUNET_HashCode k;
index e099cd31d4d2bfaef98c31648d3bea48f49cdf51..39119339ddc1487afbde707bf0afd08736f59fc5 100644 (file)
@@ -66,7 +66,7 @@ struct GNUNET_DATACACHE_PluginEnvironment
   /**
    * Configuration to use.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Configuration section to use.
index 0b36e0ef22bd696eea719817e461357b17950de6..5207fa2a5dd0df4c4b05d6c3ab8a86aea5b4c862 100644 (file)
@@ -58,7 +58,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_DATACACHE_Handle *h;
   GNUNET_HashCode k;
index fda5d425b38db7be87010d1cf3a6c26085b5d379..c912c49276874b4c5c93e687b8a33bf108f12f58 100644 (file)
@@ -42,7 +42,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile, 
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_DATACACHE_Handle *h;
   GNUNET_HashCode k;
index 361f76e4a0f3f2a256803a93fd235a036a222288..73783cfb8bdc744e7ee4b2fbb68eb39a1a2cf187 100644 (file)
@@ -37,7 +37,7 @@ struct GNUNET_DATASTORE_Handle
   /**
    * Our configuration.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Our scheduler.
@@ -82,7 +82,7 @@ struct GNUNET_DATASTORE_Handle
  * @param sched scheduler to use
  * @return handle to use to access the service
  */
-struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct
+struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct
                                                           GNUNET_CONFIGURATION_Handle
                                                           *cfg,
                                                           struct
index b0719b69bc1ce7d018498af2ab3125683d5152aa..26e894bf4b6800c310c07fd5fe813b40349dd66b 100644 (file)
@@ -156,7 +156,7 @@ static GNUNET_SCHEDULER_TaskIdentifier expired_kill_task;
 /**
  * Our configuration.
  */
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Our scheduler.
@@ -1248,7 +1248,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *c)
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *fn;
   unsigned int bf_size;
index 5a966358db4131a642bac242cf5c9ff79a62d73c..5fdf74f229407c43d6eb3b0502a909ec1aa573ea 100644 (file)
@@ -93,7 +93,7 @@ enum RunPhase
 struct CpsRunContext
 {
   struct GNUNET_SCHEDULER_Handle *sched;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   enum RunPhase phase;
   int j;
   unsigned long long size;
@@ -318,7 +318,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct CpsRunContext *crc;
 
index dae8e743205d15a2451b8f9a2a77fa03f597bba2..26299830a6f7520dadc5677e1b54f24f726e01e8 100644 (file)
@@ -71,7 +71,7 @@ struct CpsRunContext
   struct GNUNET_TIME_Absolute start;
   struct GNUNET_TIME_Absolute end;
   struct GNUNET_SCHEDULER_Handle *sched;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_DATASTORE_PluginFunctions * api;
   const char *msg;
   enum RunPhase phase;
@@ -195,7 +195,7 @@ iterateDummy (void *cls,
  */
 static void
 unload_plugin (struct GNUNET_DATASTORE_PluginFunctions * api,
-              struct GNUNET_CONFIGURATION_Handle *cfg)
+              const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   char *name;
   char *libname;
@@ -315,7 +315,7 @@ test (void *cls,
  * Load the datastore plugin.
  */
 static struct GNUNET_DATASTORE_PluginFunctions *
-load_plugin (struct GNUNET_CONFIGURATION_Handle *cfg,
+load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg,
             struct GNUNET_SCHEDULER_Handle *sched)
 {
   static struct GNUNET_DATASTORE_PluginEnvironment env;
@@ -350,7 +350,7 @@ run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
      const char *cfgfile,
-     struct GNUNET_CONFIGURATION_Handle *c)
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
   struct GNUNET_DATASTORE_PluginFunctions *api;
   struct CpsRunContext *crc;
index 849188ce1fac7874ed70f5aa8a663dcc2504b16d..2fefa2eca084fcaa9e296062327df568ce11dc7d 100644 (file)
@@ -52,7 +52,7 @@ struct GNUNET_DATASTORE_PluginEnvironment
   /**
    * Configuration to use.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Scheduler to use.
index af4dcc32292d8c39ec4dfb9d68c1b9f044a6a74f..e76b21cb2f4824df1d3d6cdb1b5dc20f295badda 100644 (file)
@@ -208,7 +208,7 @@ create_indices (sqlite3 * dbh)
  * @return GNUNET_OK on success
  */
 static int
-database_setup (struct GNUNET_CONFIGURATION_Handle *cfg,
+database_setup (const struct GNUNET_CONFIGURATION_Handle *cfg,
                struct Plugin *plugin)
 {
   sqlite3_stmt *stmt;
index 005c11a586ecc94ba68f6268e3a2b8e42b47b043..3a9f8a235fc49d69a5b41549f4fbd6c8ffdcb729 100644 (file)
@@ -120,7 +120,7 @@ struct CpsRunContext
   int rid;
   int *iptr;
   struct GNUNET_SCHEDULER_Handle *sched;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   void *data;
   size_t size;
   enum RunPhase phase;
@@ -527,7 +527,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct CpsRunContext *crc;
 
index f5dfa8a07ff881a17fee4db694428dd4ec5149c0..cbefe9d0967be1164c5837e3655a971a343a3fa7 100644 (file)
@@ -109,7 +109,7 @@ struct CpsRunContext
   int i;
   int found;
   struct GNUNET_SCHEDULER_Handle *sched;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   void *data;
   size_t size;
   enum RunPhase phase;
@@ -298,7 +298,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct CpsRunContext *crc;
 
index 281459b7593de782d36cc64392cce9fc4013a5f4..7d075cf808df69ffd43b961fbbb171d76b916ae0 100644 (file)
@@ -135,7 +135,7 @@ run (void *cls,
      struct GNUNET_SCHEDULER_Handle * sched,
      char *const *args,
      const char *cfgfile,
-     struct GNUNET_CONFIGURATION_Handle * cfg)
+     const struct GNUNET_CONFIGURATION_Handle * cfg)
 {
   GNUNET_CORE_ClientEventHandler ch = NULL;
   GNUNET_CORE_ClientEventHandler dh = NULL;
index 785e189ab53e45a7b62a75ee2fec3484e3829717..bc98a2bcfedea91842c6050aaca21c435615a74e 100644 (file)
@@ -40,7 +40,7 @@
 /**
  * Our configuration.
  */
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Our scheduler.
@@ -611,7 +611,7 @@ process_stat (void *cls,
  * Start downloading hostlists from hostlist servers as necessary.
  */
 int
-GNUNET_HOSTLIST_client_start (struct GNUNET_CONFIGURATION_Handle *c,
+GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
                              struct GNUNET_SCHEDULER_Handle *s,
                              struct GNUNET_STATISTICS_Handle *st,
                              GNUNET_CORE_ClientEventHandler *ch,
index a17e1383f17139c492691d26520ff173c71fd051..8adf67af97c2d6154d423ee4781e517a906ec30d 100644 (file)
@@ -40,7 +40,7 @@
  * @return GNUNET_OK on success
  */
 int
-GNUNET_HOSTLIST_client_start (struct GNUNET_CONFIGURATION_Handle *c,
+GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c,
                              struct GNUNET_SCHEDULER_Handle *s,
                              struct GNUNET_STATISTICS_Handle *st,
                              GNUNET_CORE_ClientEventHandler *ch,
index 6139283ed7279cee6243fc462d38f7ac3880d8f8..34e9310e441bfb783c8b3e200fc561cd6b63c1b8 100644 (file)
@@ -43,7 +43,7 @@ static struct MHD_Daemon *daemon_handle;
 /**
  * Our configuration.
  */
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Our scheduler.
@@ -259,7 +259,7 @@ prepare_daemon ()
  * @return GNUNET_OK on success
  */
 int
-GNUNET_HOSTLIST_server_start (struct GNUNET_CONFIGURATION_Handle *c,
+GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
                              struct GNUNET_SCHEDULER_Handle *s,
                              struct GNUNET_STATISTICS_Handle *st)
 {
index 16f6848a50f457e1e6624fcbfdc3bf0f4c341497..c6c6337e7dbc613b73fff3ca7be4908d2ce4ab0f 100644 (file)
@@ -38,7 +38,7 @@
  * @return GNUNET_OK on success
  */
 int
-GNUNET_HOSTLIST_server_start (struct GNUNET_CONFIGURATION_Handle *c,
+GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c,
                              struct GNUNET_SCHEDULER_Handle *s,
                              struct GNUNET_STATISTICS_Handle *st);
 
index 5a929a37e3459a512dde93a7d18cfd4e2b627827..bbb8cb0f6aacec8f203fee4226a1a04ce74f908a 100644 (file)
@@ -71,7 +71,7 @@ typedef void (*GNUNET_ARM_Callback) (void *cls, int success);
  */
 void
 GNUNET_ARM_start_service (const char *service_name,
-                          struct GNUNET_CONFIGURATION_Handle *cfg,
+                          const struct GNUNET_CONFIGURATION_Handle *cfg,
                           struct GNUNET_SCHEDULER_Handle *sched,
                           struct GNUNET_TIME_Relative timeout,
                           GNUNET_ARM_Callback cb, void *cb_cls);
@@ -91,7 +91,7 @@ GNUNET_ARM_start_service (const char *service_name,
  */
 void
 GNUNET_ARM_stop_service (const char *service_name,
-                         struct GNUNET_CONFIGURATION_Handle *cfg,
+                         const struct GNUNET_CONFIGURATION_Handle *cfg,
                          struct GNUNET_SCHEDULER_Handle *sched,
                          struct GNUNET_TIME_Relative timeout,
                          GNUNET_ARM_Callback cb, void *cb_cls);
index 6a77aa391c4e23f7557b02b456accc98e183777b..eb8e1d127ea277f87367d79da86c54b3a7e50c90 100644 (file)
@@ -59,7 +59,7 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (struct
                                                         *sched,
                                                         const char
                                                         *service_name,
-                                                        struct
+                                                        const struct
                                                         GNUNET_CONFIGURATION_Handle
                                                         *cfg);
 
@@ -143,7 +143,7 @@ void GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock);
  */
 void GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched,
                                  const char *service,
-                                 struct GNUNET_CONFIGURATION_Handle *cfg,
+                                 const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  struct GNUNET_TIME_Relative timeout,
                                  GNUNET_SCHEDULER_Task task, void *task_cls);
 
index 3f7d099ce3d0a652523514089c4a66ca66735f52..abbfe2eec05c47f8688349e979259ae048e75fa8 100644 (file)
@@ -88,13 +88,13 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
  * changed since the last save.
  * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed)
  */
-int GNUNET_CONFIGURATION_is_dirty (struct GNUNET_CONFIGURATION_Handle *cfg);
+int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 /**
  * Get a configuration value that should be a number.
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
+int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
                                            *cfg, const char *section,
                                            const char *option,
                                            unsigned long long *number);
@@ -105,7 +105,7 @@ int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
  * @param time set to the time value stored in the configuration
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
+int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
                                         *cfg, const char *section,
                                         const char *option,
                                         struct GNUNET_TIME_Relative *time);
@@ -114,7 +114,7 @@ int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
  * Test if we have a value for a particular option
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */
-int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
+int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                      const char *section, const char *option);
 
 /**
@@ -123,7 +123,7 @@ int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
  *        value, or NULL if option is not specified
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
+int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
                                            *cfg, const char *section,
                                            const char *option, char **value);
 
@@ -135,7 +135,7 @@ int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
  *        value, or NULL if option is not specified
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_CONFIGURATION_get_value_filename (struct
+int GNUNET_CONFIGURATION_get_value_filename (const struct
                                              GNUNET_CONFIGURATION_Handle *cfg,
                                              const char *section,
                                              const char *option,
@@ -146,7 +146,7 @@ int GNUNET_CONFIGURATION_get_value_filename (struct
  *
  * @return number of filenames iterated over, -1 on error
  */
-int GNUNET_CONFIGURATION_iterate_value_filenames (struct
+int GNUNET_CONFIGURATION_iterate_value_filenames (const struct
                                                   GNUNET_CONFIGURATION_Handle
                                                   *cfg,
                                                   const char *section,
@@ -163,7 +163,7 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (struct
  *        or NULL if option is not specified and no default given
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
-int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
+int GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
                                            *cfg, const char *section,
                                            const char *option,
                                            const char **choices,
@@ -175,7 +175,7 @@ int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
  *
  * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR
  */
-int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle
+int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
                                           *cfg, const char *section,
                                           const char *option);
 
@@ -187,7 +187,7 @@ int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle
  * @param old string to $-expand (will be freed!)
  * @return $-expanded string
  */
-char *GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle
+char *GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
                                           *cfg, char *old);
 
 /**
index a096569ef09d15e6745965c3fa1c65bc3c3fa589..a772813365f113ab50852d9f013ac830e761c98e 100644 (file)
@@ -171,7 +171,7 @@ typedef void
  */
 void
 GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched,
-                     struct GNUNET_CONFIGURATION_Handle *cfg,
+                     const struct GNUNET_CONFIGURATION_Handle *cfg,
                      struct GNUNET_TIME_Relative timeout,
                      void *cls,
                      GNUNET_CORE_StartupCallback init,
index c913a646283b15184654a861ebb322a420556b69..8eb724bfa2cfe9417dedfe4d228def70b94d7579 100644 (file)
@@ -58,7 +58,7 @@ struct GNUNET_DATACACHE_Handle;
  */
 struct GNUNET_DATACACHE_Handle *
 GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
-                        struct GNUNET_CONFIGURATION_Handle *cfg,
+                        const struct GNUNET_CONFIGURATION_Handle *cfg,
                         const char *section);
 
 
index ccbe4e0765404f7cf2c6c62077642d18361483cf..28419126fd12ddc35101439b387fcf4f92b7ccda 100644 (file)
@@ -55,7 +55,7 @@ struct GNUNET_DATASTORE_Handle;
  * @param sched scheduler to use
  * @return handle to use to access the service
  */
-struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct
+struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct
                                                           GNUNET_CONFIGURATION_Handle
                                                           *cfg,
                                                           struct
index a8a51ab787049a09eafe3d7cde415dd3d6090df4..7f463b83e9e83e9d0a92c158d91e2fb75bb9d540 100644 (file)
@@ -359,7 +359,7 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user);
  *                private directory name.
  * @return the constructed filename
  */
-char *GNUNET_DISK_get_home_filename (struct GNUNET_CONFIGURATION_Handle *cfg,
+char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                      const char *serviceName, ...);
 
 
index 0f61bc764ca37e11b653483d72f6caf2a6d64e8e..e45a46ef4523ea3c295b8593131def316954328d 100644 (file)
@@ -1368,7 +1368,7 @@ struct GNUNET_FS_Handle;
  */
 struct GNUNET_FS_Handle *
 GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched,
-                struct GNUNET_CONFIGURATION_Handle *cfg,
+                const struct GNUNET_CONFIGURATION_Handle *cfg,
                 const char *client_name,
                 GNUNET_FS_ProgressCallback upcb,
                 void *upcb_cls);
index 7221555688cf6068593be5f460e82f4dd83f08f3..e7063d3d0aaf1a181fa9f0a303f29b1e160a7cbd 100644 (file)
@@ -59,11 +59,6 @@ struct GNUNET_GETOPT_CommandLineProcessorContext
    */
   const struct GNUNET_GETOPT_CommandLineOption *allOptions;
 
-  /**
-   * For configuration
-   */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
-
   /**
    * Original command line
    */
@@ -192,7 +187,6 @@ struct GNUNET_GETOPT_CommandLineOption
  * Parse the command line.
  *
  * @param binaryName name of the binary / application with options
- * @param cfg for storing/accessing configuration data
  * @param allOptions defined options and handlers
  * @param argc number of arguments
  * @param argv actual arguments
@@ -200,7 +194,6 @@ struct GNUNET_GETOPT_CommandLineOption
  *   argument, or GNUNET_SYSERR on error
  */
 int GNUNET_GETOPT_run (const char *binaryName,
-                       struct GNUNET_CONFIGURATION_Handle *cfg,
                        const struct GNUNET_GETOPT_CommandLineOption
                        *allOptions, unsigned int argc, char *const *argv);
 
index 1d4d474417f4802883efe7b56154cf02d8ffb72f..cce805ba0906aa186d455e9b5a67e625c5a2a54b 100644 (file)
@@ -115,7 +115,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor
  * @return -1 on error, otherwise load value (between 0 and 100,
  *        (100 is equivalent to full load for one CPU)
  */
-int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg);
+int GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg);
+
 
 /**
  * Get the current IO load.
@@ -125,7 +126,7 @@ int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg);
  *       100 means that we spend all of our cycles waiting for
  *       the disk)
  */
-int GNUNET_OS_load_disk_get (struct GNUNET_CONFIGURATION_Handle *cfg);
+int GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
index 45c52c447a033b4059387b4a0c8f4c72b6c06140..54fc6803366b5e8bd7f7d8fec9116c48d47b0370 100644 (file)
@@ -51,7 +51,7 @@ extern "C"
  * @param hello the verified (!) HELLO message
  */
 void
-GNUNET_PEERINFO_add_peer (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
                           struct GNUNET_SCHEDULER_Handle *sched,
                           const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_HELLO_Message *hello);
@@ -90,7 +90,7 @@ typedef void
  * @param callback_cls closure for callback
  */
 void
-GNUNET_PEERINFO_for_all (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
                          struct GNUNET_SCHEDULER_Handle *sched,
                          const struct GNUNET_PeerIdentity *peer,
                          int trust_delta,
index fcd00b8ef621cd315d2ab0ce4e9cb5a6c6bfc33c..a44f4f11e74d6487427646e6972004d05561a865 100644 (file)
@@ -52,7 +52,7 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls,
                                      struct GNUNET_SCHEDULER_Handle * sched,
                                      char *const *args,
                                      const char *cfgfile,
-                                     struct GNUNET_CONFIGURATION_Handle *
+                                     const struct GNUNET_CONFIGURATION_Handle *
                                      cfg);
 
 
index 0ee9ce7ac8d9ff5bece9e3c4664eac5a464768f9..ced9bf387ddfe7f982f959bf50196da713f8e86f 100644 (file)
@@ -59,7 +59,7 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls,
  * @param delta by how much should the rating be changed?
  * @return new rating of the namespace
  */
-int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg,
+int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
                            const GNUNET_HashCode * pseudonym, int delta);
 
 /**
@@ -67,7 +67,7 @@ int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg,
  *
  * @param pseudonym the pseudonym's identifier
  */
-void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg,
+void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
                            const GNUNET_HashCode * pseudo,
                            const struct GNUNET_CONTAINER_MetaData *meta);
 
@@ -75,7 +75,7 @@ void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg,
 /**
  * List all known pseudonyms.
  */
-int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
+int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                GNUNET_PSEUDONYM_Iterator iterator,
                                void *closure);
 
@@ -83,7 +83,7 @@ int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
  * Register callback to be invoked whenever we discover
  * a new pseudonym.
  */
-int GNUNET_PSEUDONYM_discovery_callback_register (struct
+int GNUNET_PSEUDONYM_discovery_callback_register (const struct
                                                   GNUNET_CONFIGURATION_Handle
                                                   *cfg,
                                                   GNUNET_PSEUDONYM_Iterator
@@ -101,7 +101,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
  *
  * @return NULL on failure (should never happen)
  */
-char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
+char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                    const GNUNET_HashCode * pseudo);
 
 /**
@@ -109,7 +109,7 @@ char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
  *
  * @return GNUNET_OK on success
  */
-int GNUNET_PSEUDONYM_name_to_id (struct GNUNET_CONFIGURATION_Handle *cfg,
+int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  const char *hname, GNUNET_HashCode * psid);
 
 
index ac7aebcc7e1d6e25062a304d8106fc0de40a07ad..6d96cc56f81ad7995e299d79086e20a2f8d640a3 100644 (file)
@@ -65,7 +65,7 @@ typedef void (*GNUNET_RESOLVER_AddressCallback) (void *cls,
  */
 void
 GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
-                        struct GNUNET_CONFIGURATION_Handle *cfg,
+                        const struct GNUNET_CONFIGURATION_Handle *cfg,
                         const char *hostname,
                         int domain,
                         struct GNUNET_TIME_Relative timeout,
@@ -84,7 +84,7 @@ GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
  */
 void
 GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched,
-                                  struct GNUNET_CONFIGURATION_Handle *cfg,
+                                  const struct GNUNET_CONFIGURATION_Handle *cfg,
                                   int domain,
                                   struct GNUNET_TIME_Relative timeout,
                                   GNUNET_RESOLVER_AddressCallback callback,
@@ -115,7 +115,7 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls,
  * @param cls closure for callback
  */
 void GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
-                                   struct GNUNET_CONFIGURATION_Handle *cfg,
+                                   const struct GNUNET_CONFIGURATION_Handle *cfg,
                                    const struct sockaddr *sa,
                                    socklen_t salen,
                                    int do_resolve,
index dbfb2588bd629d51e4af8e87bb1bcab56c57cbe5..4d0eefb9898c7f10f07dd96fa710944e9f6dab97 100644 (file)
@@ -50,7 +50,7 @@ extern "C"
 typedef void (*GNUNET_SERVICE_Main) (void *cls,
                                      struct GNUNET_SCHEDULER_Handle * sched,
                                      struct GNUNET_SERVER_Handle * server,
-                                     struct GNUNET_CONFIGURATION_Handle *
+                                     const struct GNUNET_CONFIGURATION_Handle *
                                      cfg);
 
 
@@ -62,7 +62,7 @@ typedef void (*GNUNET_SERVICE_Main) (void *cls,
  * @param cfg configuration to use
  */
 typedef void (*GNUNET_SERVICE_Term) (void *cls,
-                                     struct GNUNET_CONFIGURATION_Handle *
+                                     const struct GNUNET_CONFIGURATION_Handle *
                                      cfg);
 
 
@@ -103,7 +103,7 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName,
                                                      struct
                                                      GNUNET_SCHEDULER_Handle
                                                      *sched,
-                                                     struct
+                                                     const struct
                                                      GNUNET_CONFIGURATION_Handle
                                                      *cfg);
 
index 8dd11094c88ddcc3c2c94801e6e11935420fcde3..2496f4091f2eef7516dca04e974fe8c0e9c2fd6b 100644 (file)
@@ -78,7 +78,7 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls,
 struct GNUNET_STATISTICS_Handle
   *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched,
                              const char *subsystem,
-                             struct GNUNET_CONFIGURATION_Handle *cfg);
+                             const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
index 41dc21f75cf2d98f4b5755fd844d5adbd96d9c54..3a18a17c3b04b20d7ac46fc41bb81fdcce783b6d 100644 (file)
@@ -58,16 +58,21 @@ struct GNUNET_TESTING_Daemon;
  *
  * @param cls closure
  * @param id identifier for the daemon, NULL on error
- * @param d handle to the daemon, NULL if starting the daemon failed
+ * @param d handle for the daemon
+ * @param emsg error message (NULL on success)
  */
 typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls,
                                                   const struct GNUNET_PeerIdentity *id,
-                                                  struct GNUNET_TESTING_Daemon *d);
+                                                  const struct GNUNET_CONFIGURATION_Handle *cfg,
+                                                  struct GNUNET_TESTING_Daemon *d,
+                                                  const char *emsg);
 
 
 /**
  * Starts a GNUnet daemon.
  *
+ * @param sched scheduler to use 
+ * @param cfg configuration to use
  * @param service_home directory to use as the service home directory
  * @param transports transport services that should be loaded
  * @param applications application services and daemons that should be started
@@ -76,8 +81,9 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls,
  *        (use NULL for localhost).
  * @param cb function to call with the result
  * @param cb_cls closure for cb
+ * @return handle to the daemon (actual start will be completed asynchronously)
  */
-void
+struct GNUNET_TESTING_Daemon *
 GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched,
                             struct GNUNET_CONFIGURATION_Handle *cfg,
                             const char *service_home,
@@ -94,10 +100,10 @@ GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched,
  * particular operation was completed the testing library.
  *
  * @param cls closure
- * @param success GNUNET_YES on success
+ * @param emsg NULL on success
  */
 typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls,
-                                               int success);
+                                               const char *emsg);
 
 
 /**
@@ -112,17 +118,34 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d,
                                 void * cb_cls);
 
 
+/**
+ * Changes the configuration of a GNUnet daemon.
+ *
+ * @param d the daemon that should be modified
+ * @param cfg the new configuration for the daemon
+ * @param cb function called once the configuration was changed
+ * @param cb_cls closure for cb
+ */
+void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d,
+                                       struct GNUNET_CONFIGURATION_Handle *cfg,
+                                       GNUNET_TESTING_NotifyCompletion cb,
+                                       void * cb_cls);
+
+
 
 /**
  * Establish a connection between two GNUnet daemons.
  *
  * @param d1 handle for the first daemon
  * @param d2 handle for the second daemon
+ * @param timeout how long is the connection attempt
+ *        allowed to take?
  * @param cb function to call at the end
  * @param cb_cls closure for cb
  */
 void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
                                     struct GNUNET_TESTING_Daemon *d2,
+                                    struct GNUNET_TIME_Relative timeout,
                                     GNUNET_TESTING_NotifyCompletion cb,
                                     void *cb_cls);
 
@@ -134,11 +157,13 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
  * be computed by adding delta each time (zero
  * times for the first peer).
  *
+ * @param sched scheduler to use 
+ * @param cfg configuration to use
  * @param total number of daemons to start
- * @param service_home_prefix path to use as the prefix for the home of the services
+ * @param service_home_prefix path to use as the prefix for the home of the services;
+ *        a number will be added for the different peers
  * @param transports which transports should all peers use
  * @param applications which applications should be used?
- * @param timeout how long is this allowed to take?
  * @param cb function to call on each daemon that was started
  * @param cb_cls closure for cb
  * @param cbe function to call at the end
index 391a87e9de84cd17462dfe2439f543cf786fe5ae..037a247a2b44696465533764c9721d82e22be16c 100644 (file)
@@ -111,7 +111,7 @@ typedef void
 struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct
                                                           GNUNET_SCHEDULER_Handle
                                                           *sched,
-                                                          struct
+                                                          const struct
                                                           GNUNET_CONFIGURATION_Handle
                                                           *cfg, void *cls,
                                                           GNUNET_TRANSPORT_ReceiveCallback
index 6c737c88a022dc57a57a93ec90757287470ccb8a..3ade1468f4ddd6a43168cb9904724f9454ac08d9 100644 (file)
@@ -70,7 +70,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile, 
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_CRYPTO_RsaPrivateKey *priv;
   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pub;
index 6b709e84aaf6fc376f656ab52fac5dfbc02ada1b..3a6030fdac710f487df656632d4b3a3eb01301ab 100644 (file)
@@ -652,7 +652,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *cfg)
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_assert (GNUNET_OK ==
                  GNUNET_CONFIGURATION_get_value_filename (cfg,
index ba5ade199b58d89756068024db18ff112933a430..28865edc6d52a1b5f1e6b429eb65090865e88ce3 100644 (file)
@@ -79,7 +79,7 @@ copy_and_free (void *cls, size_t size, void *buf)
  * @param expiration when the HELLO will expire
  */
 void
-GNUNET_PEERINFO_add_peer (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg,
                           struct GNUNET_SCHEDULER_Handle *sched,
                           const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_HELLO_Message *hello)
@@ -251,7 +251,7 @@ copy_then_receive (void *cls, size_t size, void *buf)
  * @param callback_cls closure for callback
  */
 void
-GNUNET_PEERINFO_for_all (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
                          struct GNUNET_SCHEDULER_Handle *sched,
                          const struct GNUNET_PeerIdentity *peer,
                          int trust_delta,
index c0b6847b6b18eef38275a9a74d2b8f45f0311b48..b91241979318f57fac841bde4f87f261b65e93a5 100644 (file)
@@ -103,7 +103,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile, 
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_HELLO_Message *hello;
   struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey;
index ad62424a5146a5cbbfcc29fdd95fe1ab6c63994a..ed7cbbe8fa5798bb1f5587e153a05ecf7ddba96c 100644 (file)
@@ -450,7 +450,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *cfg)
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_SERVER_add_handlers (server, handlers);
 }
index 27358996aca89e41a29a1614979c8271b70bf8ca..16debff6aa8e3d965812c0c7d9f5caa4efe0e04f 100644 (file)
@@ -187,7 +187,7 @@ transmit_get_ip (void *cls, size_t size, void *buf)
  */
 void
 GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched,
-                        struct GNUNET_CONFIGURATION_Handle *cfg,
+                        const struct GNUNET_CONFIGURATION_Handle *cfg,
                         const char *hostname,
                         int domain,
                         struct GNUNET_TIME_Relative timeout,
@@ -349,7 +349,7 @@ transmit_get_hostname (void *cls, size_t size, void *buf)
  */
 void
 GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
-                              struct GNUNET_CONFIGURATION_Handle *cfg,
+                              const struct GNUNET_CONFIGURATION_Handle *cfg,
                               const struct sockaddr *sa,
                               socklen_t salen,
                               int do_resolve,
@@ -439,7 +439,7 @@ GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched,
  */
 void
 GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched,
-                                  struct GNUNET_CONFIGURATION_Handle *cfg,
+                                  const struct GNUNET_CONFIGURATION_Handle *cfg,
                                   int domain,
                                   struct GNUNET_TIME_Relative timeout,
                                   GNUNET_RESOLVER_AddressCallback callback,
index b28dd0ca48785a5628d0aafc95b45fd276f5cbea..295217c30f13a05a3ed9fcdf86f99b94f5e36799 100644 (file)
@@ -126,7 +126,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct sockaddr_in sa;
   struct GNUNET_TIME_Relative timeout =
index 1c0981b80520dd3a2408a3f92c4f5065f38b0bbb..e4c3fe040d798a64c4f0cbf4e27e76f875a90f3e 100644 (file)
@@ -96,7 +96,7 @@ static uint32_t uidgen;
  */
 static void
 load (struct GNUNET_SERVER_Handle *server,
-      struct GNUNET_CONFIGURATION_Handle *cfg)
+      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   char *fn;
   struct GNUNET_DISK_FileHandle *fh;
@@ -157,7 +157,8 @@ load (struct GNUNET_SERVER_Handle *server,
  * @param cfg configuration to use
  */
 static void
-save (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+save (void *cls, 
+      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct StatsEntry *pos;
   char *fn;
@@ -441,7 +442,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *cfg)
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_SERVER_add_handlers (server, handlers);
   load (server, cfg);
index bafb77c66b1aa640359f8715f9f900c078f266a4..fe75f93aa1394522576fc556035eaf38792a6858 100644 (file)
@@ -106,7 +106,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_STATISTICS_Handle *h;
   unsigned long long val;
index 5cbbfc9b614df9bba38de11b2599ba8550b50b38..26e2425e60298d9332d08498c5d3b65a47d5921b 100644 (file)
@@ -131,7 +131,7 @@ struct GNUNET_STATISTICS_Handle
   /**
    * Configuration to use.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Socket (if available).
@@ -208,7 +208,7 @@ free_action_item (struct ActionItem *ai)
 struct GNUNET_STATISTICS_Handle *
 GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched,
                           const char *subsystem,
-                          struct GNUNET_CONFIGURATION_Handle *cfg)
+                          const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_STATISTICS_Handle *ret;
 
index b9f81d652f76603a3164c05c5165fb3e7a428e82..97e2f59c74dab76b05b42d646a9432ffc87d87b0 100644 (file)
@@ -91,7 +91,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
 
   h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg);
@@ -107,7 +108,8 @@ static void
 run_more (void *cls,
           struct GNUNET_SCHEDULER_Handle *sched,
           char *const *args,
-          const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+          const char *cfgfile,
+         const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   h = GNUNET_STATISTICS_create (sched, "test-statistics-api", cfg);
   GNUNET_STATISTICS_get (h, NULL, "test-3",
index c43d681d790b624f8ecf4d3edf12a78024718277..3ab7d3dcc636200e338129fcffb101d21460b9fc 100644 (file)
@@ -34,7 +34,8 @@
  * @param cfg configuration to use
  */
 static void
-finish (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+finish (void *cls, 
+       const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   /* FIXME */
 }
@@ -61,7 +62,7 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      struct GNUNET_SERVER_Handle *server,
-     struct GNUNET_CONFIGURATION_Handle *cfg)
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   /* FIXME: do setup here */
   GNUNET_SERVER_add_handlers (server, handlers);
index ea47c7f45b3b59fa163db8f5b1ff52bcfb2c75ac..ad0da8159b90cce61137cb4e46e67f10eb99a7c7 100644 (file)
@@ -46,7 +46,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *sched,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   /* main code here */
 }
index 04d9d88010e477c6735cc503dfe85a1c5e478e3c..a67023542b8f32f16eadd5ddbcc70646afe77e31 100644 (file)
@@ -151,7 +151,7 @@ static struct GNUNET_SCHEDULER_Handle * sched;
 /**
  * Our configuration.
  */
-static struct GNUNET_CONFIGURATION_Handle * cfg;
+static const struct GNUNET_CONFIGURATION_Handle * cfg;
 
 /**
  * Handle to the core API.
@@ -725,7 +725,7 @@ static struct GNUNET_GETOPT_CommandLineOption options[] = {
  * Read the friends file.
  */
 static void
-read_friends_file (struct GNUNET_CONFIGURATION_Handle *cfg)
+read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   char *fn;
   char *data;
@@ -998,7 +998,7 @@ run (void *cls,
      struct GNUNET_SCHEDULER_Handle * s,
      char *const *args,
      const char *cfgfile,
-     struct GNUNET_CONFIGURATION_Handle * c)
+     const struct GNUNET_CONFIGURATION_Handle * c)
 {
   struct GNUNET_CORE_MessageHandler handlers[] =
     {
index 96d2001aa14bc0382b1d0ac6d8e48848b5ebb0bf..d97cb15eb39ed70632868a11eca96c76cf921881 100644 (file)
@@ -547,7 +547,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
 /**
  * Our configuration.
  */
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Linked list of all clients to this service.
@@ -2553,7 +2553,8 @@ client_disconnect_notification (void *cls,
 static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
-     struct GNUNET_SERVER_Handle *serv, struct GNUNET_CONFIGURATION_Handle *c)
+     struct GNUNET_SERVER_Handle *serv, 
+     const struct GNUNET_CONFIGURATION_Handle *c)
 {
   char *plugs;
   char *pos;
@@ -2634,7 +2635,8 @@ run (void *cls,
  * @param cfg configuration to use
  */
 static void
-unload_plugins (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+unload_plugins (void *cls, 
+               const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct TransportPlugin *plug;
   struct AddressList *al;
index 2a2e90d2a72765f9d97ef8766c13a7a51ad67b43..1c545480d091b8f0db2004dad6d4334d5dd05e19 100644 (file)
@@ -177,7 +177,7 @@ struct GNUNET_TRANSPORT_PluginEnvironment
   /**
    * Configuration to use.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Scheduler to use.
index ef6c8a76a97511334404108230d30745a2beaf9b..981ce142a5bfd9657ebdb9303909ae3aa17483c1 100644 (file)
@@ -67,7 +67,7 @@ struct GNUNET_SCHEDULER_Handle *sched;
 /**
  * Our configuration.
  */
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 /**
  * Number of neighbours we'd like to have.
@@ -135,7 +135,8 @@ void lookup (void *cls,
  * @param cfg configuration to use
  */
 static void
-unload_plugins (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+unload_plugins (void *cls, 
+               const struct GNUNET_CONFIGURATION_Handle *cfg)
 {  
   GNUNET_assert (NULL == GNUNET_PLUGIN_unload ("libgnunet_plugin_transport_tcp",api));
   if (my_private_key != NULL)
@@ -256,7 +257,7 @@ run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
      const char *cfgfile,
-     struct GNUNET_CONFIGURATION_Handle *c)
+     const struct GNUNET_CONFIGURATION_Handle *c)
 { 
   unsigned long long tneigh;
   char *keyfile;
index fb8cfe302d636af2a20a219b9bb3fc2c94125bc5..f96710c38c4644245548729934039620c07a2268 100644 (file)
@@ -44,7 +44,7 @@
 
 struct PeerContext
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_TRANSPORT_Handle *th;
   struct GNUNET_PeerIdentity id;
 #if START_ARM
@@ -232,7 +232,8 @@ static void
 run (void *cls,
      struct GNUNET_SCHEDULER_Handle *s,
      char *const *args,
-     const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+     const char *cfgfile,
+     const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_assert (ok == 1);
   OKPP;
index eef0ede5eb60aa2e02132af16a2f714560eebe48..3a5c8e0f5b3c3bf524ed8226759fa1385991e558 100644 (file)
@@ -313,7 +313,7 @@ struct GNUNET_TRANSPORT_Handle
   /**
    * My configuration.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Linked list of the current neighbours of this peer.
@@ -1430,7 +1430,7 @@ add_neighbour (struct GNUNET_TRANSPORT_Handle *h,
  */
 struct GNUNET_TRANSPORT_Handle *
 GNUNET_TRANSPORT_connect (struct GNUNET_SCHEDULER_Handle *sched,
-                          struct GNUNET_CONFIGURATION_Handle *cfg,
+                          const struct GNUNET_CONFIGURATION_Handle *cfg,
                           void *cls,
                           GNUNET_TRANSPORT_ReceiveCallback rec,
                           GNUNET_TRANSPORT_NotifyConnect nc,
index 7d380fa5c2c0c74ce92494c8098fee5ca67da570..ab50d9d4d900601fda7aa5c2c369ade3ecc632bc 100644 (file)
@@ -124,7 +124,7 @@ struct GNUNET_CLIENT_Connection
 struct GNUNET_CLIENT_Connection *
 GNUNET_CLIENT_connect (struct GNUNET_SCHEDULER_Handle *sched,
                        const char *service_name,
-                       struct GNUNET_CONFIGURATION_Handle *cfg)
+                       const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   struct GNUNET_CLIENT_Connection *ret;
   struct GNUNET_NETWORK_SocketHandle *sock;
@@ -455,7 +455,7 @@ write_test (void *cls, size_t size, void *buf)
 void
 GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched,
                             const char *service,
-                            struct GNUNET_CONFIGURATION_Handle *cfg,
+                            const struct GNUNET_CONFIGURATION_Handle *cfg,
                             struct GNUNET_TIME_Relative timeout,
                             GNUNET_SCHEDULER_Task task, void *task_cls)
 {
index eacbdbf05eaa15ae08f2a9169e78020c55dd9014..769d2aadc37b4f4ba807fbe8ebb5baa45bd54226 100644 (file)
@@ -235,7 +235,7 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg,
 }
 
 int
-GNUNET_CONFIGURATION_test_dirty (struct GNUNET_CONFIGURATION_Handle *cfg)
+GNUNET_CONFIGURATION_test_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   return cfg->dirty;
 }
@@ -316,7 +316,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *data,
 
 
 static struct ConfigSection *
-findSection (struct GNUNET_CONFIGURATION_Handle *data, const char *section)
+findSection (const struct GNUNET_CONFIGURATION_Handle *data, const char *section)
 {
   struct ConfigSection *pos;
 
@@ -328,7 +328,7 @@ findSection (struct GNUNET_CONFIGURATION_Handle *data, const char *section)
 
 
 static struct ConfigEntry *
-findEntry (struct GNUNET_CONFIGURATION_Handle *data,
+findEntry (const struct GNUNET_CONFIGURATION_Handle *data,
            const char *section, const char *key)
 {
   struct ConfigSection *sec;
@@ -386,7 +386,7 @@ GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle
 }
 
 int
-GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
+GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
                                        const char *option,
                                        unsigned long long *number)
@@ -402,7 +402,7 @@ GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle
 }
 
 int
-GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
+GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
                                     *cfg, const char *section,
                                     const char *option,
                                     struct GNUNET_TIME_Relative *time)
@@ -420,7 +420,7 @@ GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle
 }
 
 int
-GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
+GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
                                        const char *option, char **value)
 {
@@ -437,7 +437,7 @@ GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle
 }
 
 int
-GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
+GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
                                        *cfg, const char *section,
                                        const char *option,
                                        const char **choices,
@@ -473,7 +473,7 @@ GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle
  * @return GNUNET_YES if so, GNUNET_NO if not.
  */
 int
-GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                  const char *section, const char *option)
 {
   struct ConfigEntry *e;
@@ -491,7 +491,7 @@ GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return $-expanded string
  */
 char *
-GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                     char *orig)
 {
   int i;
@@ -543,7 +543,7 @@ GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return GNUNET_OK on success, GNUNET_SYSERR on error
  */
 int
-GNUNET_CONFIGURATION_get_value_filename (struct GNUNET_CONFIGURATION_Handle
+GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle
                                          *data, const char *section,
                                          const char *option, char **value)
 {
@@ -574,7 +574,7 @@ GNUNET_CONFIGURATION_get_value_filename (struct GNUNET_CONFIGURATION_Handle
  * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR
  */
 int
-GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                       const char *section, const char *option)
 {
   static const char *yesno[] = { "YES", "NO", NULL };
@@ -597,7 +597,7 @@ GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return number of filenames iterated over, -1 on error
  */
 int
-GNUNET_CONFIGURATION_iterate_value_filenames (struct
+GNUNET_CONFIGURATION_iterate_value_filenames (const struct
                                               GNUNET_CONFIGURATION_Handle
                                               *cfg, const char *section,
                                               const char *option,
index b0f92c7f289879b477a5c5864e80ac7ad6d0f319..ff4aff1f70df0a68b75d893cd24a8f6c8db88a8e 100644 (file)
@@ -1132,6 +1132,7 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
  * a directory, end the last argument in '/' (or pass
  * DIR_SEPARATOR_STR as the last argument before NULL).
  *
+ * @param cfg configuration to use (determines HOME)
  * @param serviceName name of the service
  * @param varargs is NULL-terminated list of
  *                path components to append to the
@@ -1139,7 +1140,7 @@ GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h)
  * @return the constructed filename
  */
 char *
-GNUNET_DISK_get_home_filename (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
                                const char *serviceName, ...)
 {
   const char *c;
index e069e76f7fe8f0a600256dd545d7d67b763fd1f5..799146e77de09177b55f4fa9651472585a80b355 100644 (file)
@@ -997,7 +997,6 @@ GNgetopt_long (int argc,
  */
 int
 GNUNET_GETOPT_run (const char *binaryOptions,
-                   struct GNUNET_CONFIGURATION_Handle *cfg,
                    const struct GNUNET_GETOPT_CommandLineOption *allOptions,
                    unsigned int argc, char *const *argv)
 {
@@ -1017,7 +1016,6 @@ GNUNET_GETOPT_run (const char *binaryOptions,
   clpc.allOptions = allOptions;
   clpc.argv = argv;
   clpc.argc = argc;
-  clpc.cfg = cfg;
   count = 0;
   while (allOptions[count].name != NULL)
     count++;
index d1115e33f97c12d737a36c7ceedca29f307b7911..21e74eb49d0c7aca097823de07806f01dc5101ca 100644 (file)
@@ -517,7 +517,7 @@ updateUsage ()
  * that lock has already been obtained.
  */
 static void
-updateAgedLoad (struct GNUNET_CONFIGURATION_Handle *cfg)
+updateAgedLoad (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   static struct GNUNET_TIME_Absolute lastCall;
 
@@ -573,7 +573,7 @@ updateAgedLoad (struct GNUNET_CONFIGURATION_Handle *cfg)
  *        (100 is equivalent to full load)
  */
 int
-GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg)
+GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   unsigned long long maxCPULoad;
   int ret;
@@ -596,7 +596,7 @@ GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg)
  *        (100 is equivalent to full load)
  */
 int
-GNUNET_OS_load_disk_get (struct GNUNET_CONFIGURATION_Handle *cfg)
+GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   unsigned long long maxIOLoad;
   int ret;
index c8ebfc4eb7c25ad596826bc0cff4581b1f2174ea..0cff324f80c7c4d1fba2709ec737d934cb981a15 100644 (file)
@@ -63,7 +63,7 @@ struct CommandContext
   /**
    * Configuration to use.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
 };
 
@@ -127,6 +127,7 @@ GNUNET_PROGRAM_run (int argc,
   char *loglev;
   int ret;
   unsigned int cnt;
+  struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_GETOPT_CommandLineOption defoptions[] = {
     GNUNET_GETOPT_OPTION_CFG_FILE (&cc.cfgfile),
     GNUNET_GETOPT_OPTION_HELP (binaryHelp),
@@ -139,7 +140,7 @@ GNUNET_PROGRAM_run (int argc,
   loglev = NULL;
   cc.task = task;
   cc.task_cls = task_cls;
-  cc.cfg = GNUNET_CONFIGURATION_create ();
+  cc.cfg = cfg = GNUNET_CONFIGURATION_create ();
 
   /* prepare */
 #if ENABLE_NLS
@@ -169,15 +170,14 @@ GNUNET_PROGRAM_run (int argc,
   qsort (allopts, cnt, sizeof (struct GNUNET_GETOPT_CommandLineOption),
          &cmd_sorter);
   loglev = GNUNET_strdup ("WARNING");
-  if ((-1 == (ret = GNUNET_GETOPT_run (binaryName,
-                                       cc.cfg,
+  if ((-1 == (ret = GNUNET_GETOPT_run (binaryName,                                      
                                        allopts,
                                        (unsigned int) argc, argv))) ||
       ((GNUNET_OK !=
         GNUNET_log_setup (binaryName,
                           loglev,
                           NULL)) ||
-       (GNUNET_OK != GNUNET_CONFIGURATION_load (cc.cfg, cc.cfgfile))))
+       (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, cc.cfgfile))))
 
     {
       GNUNET_free_non_null (cc.cfgfile);
@@ -192,7 +192,7 @@ GNUNET_PROGRAM_run (int argc,
   GNUNET_SCHEDULER_run (&program_main, &cc);
 
   /* clean up */
-  GNUNET_CONFIGURATION_destroy (cc.cfg);
+  GNUNET_CONFIGURATION_destroy (cfg);
   GNUNET_free_non_null (cc.cfgfile);
   GNUNET_free (loglev);
   return GNUNET_OK;
index 52351c2c864807b5e3809f035f72e8654563e6d6..5bf336060f1371be9a6bdf5e321327910a3f055f 100644 (file)
@@ -64,7 +64,7 @@ internal_notify (const GNUNET_HashCode * id,
  * a new pseudonym.
  */
 int
-GNUNET_PSEUDONYM_discovery_callback_register (struct
+GNUNET_PSEUDONYM_discovery_callback_register (const struct
                                               GNUNET_CONFIGURATION_Handle
                                               *cfg,
                                               GNUNET_PSEUDONYM_Iterator
@@ -115,7 +115,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator
  * pseudonym identifier and directory prefix.
  */
 static char *
-get_data_filename (struct GNUNET_CONFIGURATION_Handle
+get_data_filename (const struct GNUNET_CONFIGURATION_Handle
                    *cfg, const char *prefix, const GNUNET_HashCode * psid)
 {
   struct GNUNET_CRYPTO_HashAsciiEncoded enc;
@@ -131,7 +131,7 @@ get_data_filename (struct GNUNET_CONFIGURATION_Handle
 }
 
 static void
-write_pseudonym_info (struct GNUNET_CONFIGURATION_Handle *cfg,
+write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
                       const GNUNET_HashCode * nsid,
                       const struct GNUNET_CONTAINER_MetaData *meta,
                       int32_t ranking, const char *ns_name)
@@ -179,7 +179,7 @@ write_pseudonym_info (struct GNUNET_CONFIGURATION_Handle *cfg,
 }
 
 static int
-read_info (struct GNUNET_CONFIGURATION_Handle *cfg,
+read_info (const struct GNUNET_CONFIGURATION_Handle *cfg,
            const GNUNET_HashCode * nsid,
            struct GNUNET_CONTAINER_MetaData **meta,
            int32_t * ranking, char **ns_name)
@@ -273,7 +273,7 @@ read_info (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return NULL on failure (should never happen)
  */
 char *
-GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg,
                              const GNUNET_HashCode * nsid)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
@@ -356,7 +356,7 @@ GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return GNUNET_OK on success
  */
 int
-GNUNET_PSEUDONYM_name_to_id (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg,
                              const char *ns_uname, GNUNET_HashCode * nsid)
 {
   size_t slen;
@@ -408,7 +408,7 @@ struct ListPseudonymClosure
 {
   GNUNET_PSEUDONYM_Iterator iterator;
   void *closure;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 };
 
 static int
@@ -443,7 +443,7 @@ list_pseudonym_helper (void *cls, const char *fullname)
  * List all available pseudonyms.
  */
 int
-GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg,
                            GNUNET_PSEUDONYM_Iterator iterator, void *closure)
 {
   struct ListPseudonymClosure cls;
@@ -470,7 +470,7 @@ GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg,
  * @return new rating of the pseudonym
  */
 int
-GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg,
                        const GNUNET_HashCode * nsid, int delta)
 {
   struct GNUNET_CONTAINER_MetaData *meta;
@@ -513,7 +513,7 @@ merge_meta_helper (EXTRACTOR_KeywordType type, const char *data, void *cls)
  * @param id the pseudonym identifier
  */
 void
-GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg,
                       const GNUNET_HashCode * id,
                       const struct GNUNET_CONTAINER_MetaData *meta)
 {
index 0569a0fde698c079a56da25a1d75feb7071dcdce..a976fab781ff623cb27fc3d3135e444d0031cee6 100644 (file)
@@ -420,7 +420,7 @@ struct GNUNET_SERVICE_Context
   /**
    * Our configuration.
    */
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  const struct GNUNET_CONFIGURATION_Handle *cfg;
 
   /**
    * Handle for the server.
@@ -1264,6 +1264,7 @@ GNUNET_SERVICE_run (int argc,
   char *logfile;
   int do_daemonize;
   struct GNUNET_SERVICE_Context sctx;
+  struct GNUNET_CONFIGURATION_Handle *cfg;
   struct GNUNET_GETOPT_CommandLineOption service_options[] = {
     GNUNET_GETOPT_OPTION_CFG_FILE (&cfg_fn),
     {'d', "daemonize", NULL,
@@ -1286,18 +1287,17 @@ GNUNET_SERVICE_run (int argc,
   sctx.maxbuf = GNUNET_SERVER_MAX_MESSAGE_SIZE;
   sctx.task = task;
   sctx.serviceName = serviceName;
-  sctx.cfg = GNUNET_CONFIGURATION_create ();
+  sctx.cfg = cfg = GNUNET_CONFIGURATION_create ();
   /* setup subsystems */
   if ((GNUNET_SYSERR ==
-       GNUNET_GETOPT_run (serviceName,
-                          sctx.cfg,
+       GNUNET_GETOPT_run (serviceName,                         
                           service_options,
                           argc,
                           argv)) ||
       (GNUNET_OK !=
        GNUNET_log_setup (serviceName, loglev, logfile)) ||
       (GNUNET_OK !=
-       GNUNET_CONFIGURATION_load (sctx.cfg, cfg_fn)) ||
+       GNUNET_CONFIGURATION_load (cfg, cfg_fn)) ||
       (GNUNET_OK !=
        setup_service (&sctx)) ||
       ((do_daemonize == 1) &&
@@ -1310,7 +1310,7 @@ GNUNET_SERVICE_run (int argc,
             GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "write");
           GNUNET_break (0 == CLOSE (sctx.ready_confirm_fd));
         }
-      GNUNET_CONFIGURATION_destroy (sctx.cfg);
+      GNUNET_CONFIGURATION_destroy (cfg);
       GNUNET_free_non_null (sctx.addr);
       GNUNET_free_non_null (logfile);
       GNUNET_free (loglev);
@@ -1339,7 +1339,7 @@ GNUNET_SERVICE_run (int argc,
   if (sctx.server != NULL)
     GNUNET_SERVER_destroy (sctx.server);
   GNUNET_free_non_null (sctx.my_handlers);
-  GNUNET_CONFIGURATION_destroy (sctx.cfg);
+  GNUNET_CONFIGURATION_destroy (cfg);
   GNUNET_free_non_null (sctx.addr);
   GNUNET_free_non_null (logfile);
   GNUNET_free (loglev);
@@ -1364,7 +1364,7 @@ GNUNET_SERVICE_run (int argc,
 struct GNUNET_SERVICE_Context *
 GNUNET_SERVICE_start (const char *serviceName,
                       struct GNUNET_SCHEDULER_Handle *sched,
-                      struct GNUNET_CONFIGURATION_Handle *cfg)
+                      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int i;
   struct GNUNET_SERVICE_Context *sctx;
index 89e7be863fe97f0985a15ece2fb9448e1418e4a3..7168dd8c13f95a52029fc00a3d9981425b6c2970 100644 (file)
@@ -31,7 +31,6 @@
 static int
 testMinimal ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const emptyargv[] = {
     "test",
     NULL
@@ -40,13 +39,8 @@ testMinimal ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (1 != GNUNET_GETOPT_run ("test", cfg, emptyoptionlist, 1, emptyargv))
-    {
-      GNUNET_CONFIGURATION_destroy (cfg);
-      return 1;
-    }
-  GNUNET_CONFIGURATION_destroy (cfg);
+  if (1 != GNUNET_GETOPT_run ("test", emptyoptionlist, 1, emptyargv))
+    return 1;
 
   return 0;
 }
@@ -54,7 +48,6 @@ testMinimal ()
 static int
 testVerbose ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const myargv[] = {
     "test",
     "-V",
@@ -68,14 +61,11 @@ testVerbose ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (3 != GNUNET_GETOPT_run ("test", cfg, verboseoptionlist, 4, myargv))
+  if (3 != GNUNET_GETOPT_run ("test", verboseoptionlist, 4, myargv))
     {
       GNUNET_break (0);
-      GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
-  GNUNET_CONFIGURATION_destroy (cfg);
   if (vflags != 2)
     {
       GNUNET_break (0);
@@ -87,7 +77,6 @@ testVerbose ()
 static int
 testVersion ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const myargv[] = {
     "test_getopt",
     "-v",
@@ -98,22 +87,18 @@ testVersion ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
   if (-1 != GNUNET_GETOPT_run ("test_getopt",
-                               cfg, versionoptionlist, 2, myargv))
+                              versionoptionlist, 2, myargv))
     {
       GNUNET_break (0);
-      GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
-  GNUNET_CONFIGURATION_destroy (cfg);
   return 0;
 }
 
 static int
 testAbout ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const myargv[] = {
     "test_getopt",
     "-h",
@@ -124,22 +109,18 @@ testAbout ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
   if (-1 != GNUNET_GETOPT_run ("test_getopt",
-                               cfg, aboutoptionlist, 2, myargv))
+                               aboutoptionlist, 2, myargv))
     {
       GNUNET_break (0);
-      GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
-  GNUNET_CONFIGURATION_destroy (cfg);
   return 0;
 }
 
 static int
 testLogOpts ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const myargv[] = {
     "test_getopt",
     "-l", "filename",
@@ -154,15 +135,12 @@ testLogOpts ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (5 != GNUNET_GETOPT_run ("test_getopt", cfg, logoptionlist, 5, myargv))
+  if (5 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 5, myargv))
     {
       GNUNET_break (0);
-      GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
   GNUNET_assert (fn != NULL);
-  GNUNET_CONFIGURATION_destroy (cfg);
   if ((0 != strcmp (level, "WARNING")) || (0 != strcmp (fn, "filename")))
     {
       GNUNET_break (0);
@@ -178,7 +156,6 @@ testLogOpts ()
 static int
 testFlagNum ()
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg;
   char *const myargv[] = {
     "test_getopt",
     "-f",
@@ -199,14 +176,11 @@ testFlagNum ()
     GNUNET_GETOPT_OPTION_END
   };
 
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (6 != GNUNET_GETOPT_run ("test_getopt", cfg, logoptionlist, 6, myargv))
+  if (6 != GNUNET_GETOPT_run ("test_getopt", logoptionlist, 6, myargv))
     {
       GNUNET_break (0);
-      GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
-  GNUNET_CONFIGURATION_destroy (cfg);
   if ((1 != flag) || (42 != num) || (42 != lnum))
     {
       GNUNET_break (0);
index dee602e2a5f15823bc277f4b468cfed361e6017c..5c58123b573f2ee957d175d8d555e83703f6b0bd 100644 (file)
@@ -41,7 +41,8 @@ static void
 runner (void *cls,
         struct GNUNET_SCHEDULER_Handle *sched,
         char *const *args,
-        const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+        const char *cfgfile, 
+       const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int *ok = cls;
   GNUNET_assert (setme == 1);
index 233c23ccf3b5afa479dcd67926104026a02a09d9..e8e3f8741d64901b427f561243a5c9061a4c7219 100644 (file)
@@ -74,7 +74,7 @@ build_msg (void *cls, size_t size, void *buf)
 static void
 ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+  const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
   struct GNUNET_CLIENT_Connection *client;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service confirmed running\n");
@@ -108,17 +108,18 @@ static void
 runner (void *cls,
         struct GNUNET_SCHEDULER_Handle *sched,
         struct GNUNET_SERVER_Handle *server,
-        struct GNUNET_CONFIGURATION_Handle *cfg)
+        const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Service initializing\n");
   GNUNET_SERVER_add_handlers (server, myhandlers);
   GNUNET_CLIENT_service_test (sched,
                               "test_service",
-                              cfg, GNUNET_TIME_UNIT_SECONDS, &ready, cfg);
+                              cfg, GNUNET_TIME_UNIT_SECONDS, &ready, (void*) cfg);
 }
 
 static void
-term (void *cls, struct GNUNET_CONFIGURATION_Handle *cfg)
+term (void *cls, 
+      const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int *ok = cls;
   *ok = 0;
@@ -157,7 +158,7 @@ check ()
 static void
 ready6 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
-  struct GNUNET_CONFIGURATION_Handle *cfg = cls;
+  const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
   struct GNUNET_CLIENT_Connection *client;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "V6 ready\n");
@@ -176,13 +177,13 @@ static void
 runner6 (void *cls,
          struct GNUNET_SCHEDULER_Handle *sched,
          struct GNUNET_SERVER_Handle *server,
-         struct GNUNET_CONFIGURATION_Handle *cfg)
+         const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Initializing v6 service\n");
   GNUNET_SERVER_add_handlers (server, myhandlers);
   GNUNET_CLIENT_service_test (sched,
                               "test_service6",
-                              cfg, GNUNET_TIME_UNIT_SECONDS, &ready6, cfg);
+                              cfg, GNUNET_TIME_UNIT_SECONDS, &ready6, (void*) cfg);
 }
 
 /**
@@ -252,7 +253,8 @@ static void
 start_stop_main (void *cls,
                  struct GNUNET_SCHEDULER_Handle *sched,
                  char *const *args,
-                 const char *cfgfile, struct GNUNET_CONFIGURATION_Handle *cfg)
+                 const char *cfgfile, 
+                const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
   int *ret = cls;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,