[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r8791 - in gnunet/src: . arm core datacache datastore hostl
From: |
gnunet |
Subject: |
[GNUnet-SVN] r8791 - in gnunet/src: . arm core datacache datastore hostlist include peerinfo resolver statistics template topology transport util |
Date: |
Sun, 26 Jul 2009 15:20:11 -0600 |
Author: grothoff
Date: 2009-07-26 15:20:11 -0600 (Sun, 26 Jul 2009)
New Revision: 8791
Modified:
gnunet/src/Makefile.am
gnunet/src/arm/arm_api.c
gnunet/src/arm/gnunet-arm.c
gnunet/src/arm/gnunet-service-arm.c
gnunet/src/arm/test_arm_api.c
gnunet/src/core/core_api.c
gnunet/src/core/gnunet-service-core.c
gnunet/src/core/test_core_api.c
gnunet/src/core/test_core_api_start_only.c
gnunet/src/datacache/datacache_api.c
gnunet/src/datacache/perf_datacache_api.c
gnunet/src/datacache/plugin_datacache.h
gnunet/src/datacache/test_datacache_api.c
gnunet/src/datacache/test_datacache_api_quota.c
gnunet/src/datastore/datastore_api.c
gnunet/src/datastore/gnunet-service-datastore.c
gnunet/src/datastore/perf_datastore_api.c
gnunet/src/datastore/perf_plugin_datastore.c
gnunet/src/datastore/plugin_datastore.h
gnunet/src/datastore/plugin_datastore_sqlite.c
gnunet/src/datastore/test_datastore_api.c
gnunet/src/datastore/test_datastore_api_management.c
gnunet/src/hostlist/gnunet-daemon-hostlist.c
gnunet/src/hostlist/hostlist-client.c
gnunet/src/hostlist/hostlist-client.h
gnunet/src/hostlist/hostlist-server.c
gnunet/src/hostlist/hostlist-server.h
gnunet/src/include/gnunet_arm_service.h
gnunet/src/include/gnunet_client_lib.h
gnunet/src/include/gnunet_configuration_lib.h
gnunet/src/include/gnunet_core_service.h
gnunet/src/include/gnunet_datacache_lib.h
gnunet/src/include/gnunet_datastore_service.h
gnunet/src/include/gnunet_disk_lib.h
gnunet/src/include/gnunet_fs_service.h
gnunet/src/include/gnunet_getopt_lib.h
gnunet/src/include/gnunet_os_lib.h
gnunet/src/include/gnunet_peerinfo_service.h
gnunet/src/include/gnunet_program_lib.h
gnunet/src/include/gnunet_pseudonym_lib.h
gnunet/src/include/gnunet_resolver_service.h
gnunet/src/include/gnunet_service_lib.h
gnunet/src/include/gnunet_statistics_service.h
gnunet/src/include/gnunet_testing_lib.h
gnunet/src/include/gnunet_transport_service.h
gnunet/src/peerinfo/gnunet-peerinfo.c
gnunet/src/peerinfo/gnunet-service-peerinfo.c
gnunet/src/peerinfo/peerinfo_api.c
gnunet/src/peerinfo/test_peerinfo_api.c
gnunet/src/resolver/gnunet-service-resolver.c
gnunet/src/resolver/resolver_api.c
gnunet/src/resolver/test_resolver_api.c
gnunet/src/statistics/gnunet-service-statistics.c
gnunet/src/statistics/gnunet-statistics.c
gnunet/src/statistics/statistics_api.c
gnunet/src/statistics/test_statistics_api.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/transport/plugin_transport.h
gnunet/src/transport/test_plugin_transport.c
gnunet/src/transport/test_transport_api.c
gnunet/src/transport/transport_api.c
gnunet/src/util/client.c
gnunet/src/util/configuration.c
gnunet/src/util/disk.c
gnunet/src/util/getopt.c
gnunet/src/util/os_load.c
gnunet/src/util/program.c
gnunet/src/util/pseudonym.c
gnunet/src/util/service.c
gnunet/src/util/test_getopt.c
gnunet/src/util/test_program.c
gnunet/src/util/test_service.c
Log:
const-ing of config-handles
Modified: gnunet/src/Makefile.am
===================================================================
--- gnunet/src/Makefile.am 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/Makefile.am 2009-07-26 21:20:11 UTC (rev 8791)
@@ -11,13 +11,13 @@
include $(INTLEMU_SUBDIRS) \
util \
arm \
- datacache \
- datastore \
fragmentation \
hello \
peerinfo \
resolver \
statistics \
+ datacache \
+ datastore \
template \
transport \
core \
Modified: gnunet/src/arm/arm_api.c
===================================================================
--- gnunet/src/arm/arm_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/arm/arm_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -39,7 +39,7 @@
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 @@
*/
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 @@
*/
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 @@
*/
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)
Modified: gnunet/src/arm/gnunet-arm.c
===================================================================
--- gnunet/src/arm/gnunet-arm.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/arm/gnunet-arm.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -111,7 +111,8 @@
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)
{
Modified: gnunet/src/arm/gnunet-service-arm.c
===================================================================
--- gnunet/src/arm/gnunet-service-arm.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/arm/gnunet-service-arm.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -124,7 +124,7 @@
/**
* Our configuration
*/
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our scheduler.
@@ -562,7 +562,7 @@
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 @@
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;
Modified: gnunet/src/arm/test_arm_api.c
===================================================================
--- gnunet/src/arm/test_arm_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/arm/test_arm_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -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 @@
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;
Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/core/core_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -43,7 +43,7 @@
/**
* Configuration we're using.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Closure for the various callbacks.
@@ -777,7 +777,7 @@
*/
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,
Modified: gnunet/src/core/gnunet-service-core.c
===================================================================
--- gnunet/src/core/gnunet-service-core.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/core/gnunet-service-core.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -617,7 +617,7 @@
/**
* Our configuration.
*/
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our server.
@@ -3121,7 +3121,8 @@
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 @@
* 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);
Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/core/test_core_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -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 @@
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;
Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/core/test_core_api_start_only.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -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 @@
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;
Modified: gnunet/src/datacache/datacache_api.c
===================================================================
--- gnunet/src/datacache/datacache_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datacache/datacache_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -47,7 +47,7 @@
/**
* Our configuration.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Configuration section to use.
@@ -118,7 +118,7 @@
*/
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;
Modified: gnunet/src/datacache/perf_datacache_api.c
===================================================================
--- gnunet/src/datacache/perf_datacache_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datacache/perf_datacache_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -54,7 +54,8 @@
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;
Modified: gnunet/src/datacache/plugin_datacache.h
===================================================================
--- gnunet/src/datacache/plugin_datacache.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datacache/plugin_datacache.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -66,7 +66,7 @@
/**
* Configuration to use.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Configuration section to use.
Modified: gnunet/src/datacache/test_datacache_api.c
===================================================================
--- gnunet/src/datacache/test_datacache_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datacache/test_datacache_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -58,7 +58,8 @@
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;
Modified: gnunet/src/datacache/test_datacache_api_quota.c
===================================================================
--- gnunet/src/datacache/test_datacache_api_quota.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/datacache/test_datacache_api_quota.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -42,7 +42,8 @@
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;
Modified: gnunet/src/datastore/datastore_api.c
===================================================================
--- gnunet/src/datastore/datastore_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datastore/datastore_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -37,7 +37,7 @@
/**
* Our configuration.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our scheduler.
@@ -82,7 +82,7 @@
* @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
Modified: gnunet/src/datastore/gnunet-service-datastore.c
===================================================================
--- gnunet/src/datastore/gnunet-service-datastore.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/datastore/gnunet-service-datastore.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -156,7 +156,7 @@
/**
* Our configuration.
*/
-struct GNUNET_CONFIGURATION_Handle *cfg;
+const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our scheduler.
@@ -1248,7 +1248,7 @@
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;
Modified: gnunet/src/datastore/perf_datastore_api.c
===================================================================
--- gnunet/src/datastore/perf_datastore_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datastore/perf_datastore_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -93,7 +93,7 @@
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 @@
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;
Modified: gnunet/src/datastore/perf_plugin_datastore.c
===================================================================
--- gnunet/src/datastore/perf_plugin_datastore.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/datastore/perf_plugin_datastore.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -71,7 +71,7 @@
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 @@
*/
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 @@
* 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 @@
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;
Modified: gnunet/src/datastore/plugin_datastore.h
===================================================================
--- gnunet/src/datastore/plugin_datastore.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datastore/plugin_datastore.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -52,7 +52,7 @@
/**
* Configuration to use.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Scheduler to use.
Modified: gnunet/src/datastore/plugin_datastore_sqlite.c
===================================================================
--- gnunet/src/datastore/plugin_datastore_sqlite.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/datastore/plugin_datastore_sqlite.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -208,7 +208,7 @@
* @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;
Modified: gnunet/src/datastore/test_datastore_api.c
===================================================================
--- gnunet/src/datastore/test_datastore_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/datastore/test_datastore_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -120,7 +120,7 @@
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 @@
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;
Modified: gnunet/src/datastore/test_datastore_api_management.c
===================================================================
--- gnunet/src/datastore/test_datastore_api_management.c 2009-07-26
20:25:44 UTC (rev 8790)
+++ gnunet/src/datastore/test_datastore_api_management.c 2009-07-26
21:20:11 UTC (rev 8791)
@@ -109,7 +109,7 @@
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 @@
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;
Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -135,7 +135,7 @@
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;
Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/hostlist/hostlist-client.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -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 @@
* 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,
Modified: gnunet/src/hostlist/hostlist-client.h
===================================================================
--- gnunet/src/hostlist/hostlist-client.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/hostlist/hostlist-client.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -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,
Modified: gnunet/src/hostlist/hostlist-server.c
===================================================================
--- gnunet/src/hostlist/hostlist-server.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/hostlist/hostlist-server.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -43,7 +43,7 @@
/**
* Our configuration.
*/
-static struct GNUNET_CONFIGURATION_Handle *cfg;
+static const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Our scheduler.
@@ -259,7 +259,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)
{
Modified: gnunet/src/hostlist/hostlist-server.h
===================================================================
--- gnunet/src/hostlist/hostlist-server.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/hostlist/hostlist-server.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -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);
Modified: gnunet/src/include/gnunet_arm_service.h
===================================================================
--- gnunet/src/include/gnunet_arm_service.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_arm_service.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -71,7 +71,7 @@
*/
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 @@
*/
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);
Modified: gnunet/src/include/gnunet_client_lib.h
===================================================================
--- gnunet/src/include/gnunet_client_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_client_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -59,7 +59,7 @@
*sched,
const char
*service_name,
- struct
+ const struct
GNUNET_CONFIGURATION_Handle
*cfg);
@@ -143,7 +143,7 @@
*/
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);
Modified: gnunet/src/include/gnunet_configuration_lib.h
===================================================================
--- gnunet/src/include/gnunet_configuration_lib.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_configuration_lib.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -88,13 +88,13 @@
* 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 @@
* @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 @@
* 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 @@
* 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 @@
* 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 @@
*
* @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 @@
* 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 @@
*
* @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 @@
* @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);
/**
Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_core_service.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -171,7 +171,7 @@
*/
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,
Modified: gnunet/src/include/gnunet_datacache_lib.h
===================================================================
--- gnunet/src/include/gnunet_datacache_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_datacache_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -58,7 +58,7 @@
*/
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);
Modified: gnunet/src/include/gnunet_datastore_service.h
===================================================================
--- gnunet/src/include/gnunet_datastore_service.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_datastore_service.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -55,7 +55,7 @@
* @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
Modified: gnunet/src/include/gnunet_disk_lib.h
===================================================================
--- gnunet/src/include/gnunet_disk_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_disk_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -359,7 +359,7 @@
* 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, ...);
Modified: gnunet/src/include/gnunet_fs_service.h
===================================================================
--- gnunet/src/include/gnunet_fs_service.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_fs_service.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -1368,7 +1368,7 @@
*/
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);
Modified: gnunet/src/include/gnunet_getopt_lib.h
===================================================================
--- gnunet/src/include/gnunet_getopt_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_getopt_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -60,11 +60,6 @@
const struct GNUNET_GETOPT_CommandLineOption *allOptions;
/**
- * For configuration
- */
- struct GNUNET_CONFIGURATION_Handle *cfg;
-
- /**
* Original command line
*/
char *const *argv;
@@ -192,7 +187,6 @@
* 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 @@
* 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);
Modified: gnunet/src/include/gnunet_os_lib.h
===================================================================
--- gnunet/src/include/gnunet_os_lib.h 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/include/gnunet_os_lib.h 2009-07-26 21:20:11 UTC (rev 8791)
@@ -115,8 +115,9 @@
* @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 @@
* 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);
/**
Modified: gnunet/src/include/gnunet_peerinfo_service.h
===================================================================
--- gnunet/src/include/gnunet_peerinfo_service.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_peerinfo_service.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -51,7 +51,7 @@
* @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 @@
* @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,
Modified: gnunet/src/include/gnunet_program_lib.h
===================================================================
--- gnunet/src/include/gnunet_program_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_program_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -52,7 +52,7 @@
struct GNUNET_SCHEDULER_Handle * sched,
char *const *args,
const char *cfgfile,
- struct GNUNET_CONFIGURATION_Handle *
+ const struct GNUNET_CONFIGURATION_Handle *
cfg);
Modified: gnunet/src/include/gnunet_pseudonym_lib.h
===================================================================
--- gnunet/src/include/gnunet_pseudonym_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_pseudonym_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -59,7 +59,7 @@
* @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 @@
*
* @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 @@
/**
* 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 @@
* 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 @@
*
* @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 @@
*
* @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);
Modified: gnunet/src/include/gnunet_resolver_service.h
===================================================================
--- gnunet/src/include/gnunet_resolver_service.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_resolver_service.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -65,7 +65,7 @@
*/
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 @@
*/
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 @@
* @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,
Modified: gnunet/src/include/gnunet_service_lib.h
===================================================================
--- gnunet/src/include/gnunet_service_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_service_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -50,7 +50,7 @@
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 @@
* @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_SCHEDULER_Handle
*sched,
- struct
+ const struct
GNUNET_CONFIGURATION_Handle
*cfg);
Modified: gnunet/src/include/gnunet_statistics_service.h
===================================================================
--- gnunet/src/include/gnunet_statistics_service.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_statistics_service.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -78,7 +78,7 @@
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);
/**
Modified: gnunet/src/include/gnunet_testing_lib.h
===================================================================
--- gnunet/src/include/gnunet_testing_lib.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/include/gnunet_testing_lib.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -58,16 +58,21 @@
*
* @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 @@
* (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 @@
* 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 * 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 @@
* 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
Modified: gnunet/src/include/gnunet_transport_service.h
===================================================================
--- gnunet/src/include/gnunet_transport_service.h 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/include/gnunet_transport_service.h 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -111,7 +111,7 @@
struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct
GNUNET_SCHEDULER_Handle
*sched,
- struct
+ const struct
GNUNET_CONFIGURATION_Handle
*cfg, void *cls,
GNUNET_TRANSPORT_ReceiveCallback
Modified: gnunet/src/peerinfo/gnunet-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-peerinfo.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/peerinfo/gnunet-peerinfo.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -70,7 +70,8 @@
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;
Modified: gnunet/src/peerinfo/gnunet-service-peerinfo.c
===================================================================
--- gnunet/src/peerinfo/gnunet-service-peerinfo.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/peerinfo/gnunet-service-peerinfo.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -652,7 +652,7 @@
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,
Modified: gnunet/src/peerinfo/peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/peerinfo_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/peerinfo/peerinfo_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -79,7 +79,7 @@
* @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 @@
* @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,
Modified: gnunet/src/peerinfo/test_peerinfo_api.c
===================================================================
--- gnunet/src/peerinfo/test_peerinfo_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/peerinfo/test_peerinfo_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -103,7 +103,8 @@
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;
Modified: gnunet/src/resolver/gnunet-service-resolver.c
===================================================================
--- gnunet/src/resolver/gnunet-service-resolver.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/resolver/gnunet-service-resolver.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -450,7 +450,7 @@
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);
}
Modified: gnunet/src/resolver/resolver_api.c
===================================================================
--- gnunet/src/resolver/resolver_api.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/resolver/resolver_api.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -187,7 +187,7 @@
*/
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 @@
*/
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 @@
*/
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,
Modified: gnunet/src/resolver/test_resolver_api.c
===================================================================
--- gnunet/src/resolver/test_resolver_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/resolver/test_resolver_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -126,7 +126,8 @@
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 =
Modified: gnunet/src/statistics/gnunet-service-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-service-statistics.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/statistics/gnunet-service-statistics.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -96,7 +96,7 @@
*/
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 @@
* @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 @@
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);
Modified: gnunet/src/statistics/gnunet-statistics.c
===================================================================
--- gnunet/src/statistics/gnunet-statistics.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/statistics/gnunet-statistics.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -106,7 +106,8 @@
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;
Modified: gnunet/src/statistics/statistics_api.c
===================================================================
--- gnunet/src/statistics/statistics_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/statistics/statistics_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -131,7 +131,7 @@
/**
* Configuration to use.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Socket (if available).
@@ -208,7 +208,7 @@
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;
Modified: gnunet/src/statistics/test_statistics_api.c
===================================================================
--- gnunet/src/statistics/test_statistics_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/statistics/test_statistics_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -91,7 +91,8 @@
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 @@
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",
Modified: gnunet/src/template/gnunet-service-template.c
===================================================================
--- gnunet/src/template/gnunet-service-template.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/template/gnunet-service-template.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -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 @@
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);
Modified: gnunet/src/template/gnunet-template.c
===================================================================
--- gnunet/src/template/gnunet-template.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/template/gnunet-template.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -46,7 +46,8 @@
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 */
}
Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/topology/gnunet-daemon-topology.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -151,7 +151,7 @@
/**
* Our configuration.
*/
-static struct GNUNET_CONFIGURATION_Handle * cfg;
+static const struct GNUNET_CONFIGURATION_Handle * cfg;
/**
* Handle to the core API.
@@ -725,7 +725,7 @@
* 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 @@
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[] =
{
Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/transport/gnunet-service-transport.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -547,7 +547,7 @@
/**
* 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 @@
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 @@
* @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;
Modified: gnunet/src/transport/plugin_transport.h
===================================================================
--- gnunet/src/transport/plugin_transport.h 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/transport/plugin_transport.h 2009-07-26 21:20:11 UTC (rev
8791)
@@ -177,7 +177,7 @@
/**
* Configuration to use.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Scheduler to use.
Modified: gnunet/src/transport/test_plugin_transport.c
===================================================================
--- gnunet/src/transport/test_plugin_transport.c 2009-07-26 20:25:44 UTC
(rev 8790)
+++ gnunet/src/transport/test_plugin_transport.c 2009-07-26 21:20:11 UTC
(rev 8791)
@@ -67,7 +67,7 @@
/**
* 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 @@
* @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 @@
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;
Modified: gnunet/src/transport/test_transport_api.c
===================================================================
--- gnunet/src/transport/test_transport_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/transport/test_transport_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -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 @@
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;
Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c 2009-07-26 20:25:44 UTC (rev
8790)
+++ gnunet/src/transport/transport_api.c 2009-07-26 21:20:11 UTC (rev
8791)
@@ -313,7 +313,7 @@
/**
* 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 @@
*/
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,
Modified: gnunet/src/util/client.c
===================================================================
--- gnunet/src/util/client.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/client.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -124,7 +124,7 @@
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 @@
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)
{
Modified: gnunet/src/util/configuration.c
===================================================================
--- gnunet/src/util/configuration.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/configuration.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -235,7 +235,7 @@
}
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 @@
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 @@
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 @@
}
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 @@
}
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 @@
}
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 @@
}
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 @@
* @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 @@
* @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 @@
* @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 @@
* @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 @@
* @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,
Modified: gnunet/src/util/disk.c
===================================================================
--- gnunet/src/util/disk.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/disk.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -1132,6 +1132,7 @@
* 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 @@
* @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;
Modified: gnunet/src/util/getopt.c
===================================================================
--- gnunet/src/util/getopt.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/getopt.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -997,7 +997,6 @@
*/
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 @@
clpc.allOptions = allOptions;
clpc.argv = argv;
clpc.argc = argc;
- clpc.cfg = cfg;
count = 0;
while (allOptions[count].name != NULL)
count++;
Modified: gnunet/src/util/os_load.c
===================================================================
--- gnunet/src/util/os_load.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/os_load.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -517,7 +517,7 @@
* 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 @@
* (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 @@
* (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;
Modified: gnunet/src/util/program.c
===================================================================
--- gnunet/src/util/program.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/program.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -63,7 +63,7 @@
/**
* Configuration to use.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
};
@@ -127,6 +127,7 @@
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 @@
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 @@
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_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;
Modified: gnunet/src/util/pseudonym.c
===================================================================
--- gnunet/src/util/pseudonym.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/pseudonym.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -64,7 +64,7 @@
* 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 @@
* 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 @@
}
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 @@
}
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 @@
* @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 @@
* @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 @@
{
GNUNET_PSEUDONYM_Iterator iterator;
void *closure;
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
};
static int
@@ -443,7 +443,7 @@
* 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 @@
* @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 @@
* @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)
{
Modified: gnunet/src/util/service.c
===================================================================
--- gnunet/src/util/service.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/service.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -420,7 +420,7 @@
/**
* Our configuration.
*/
- struct GNUNET_CONFIGURATION_Handle *cfg;
+ const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Handle for the server.
@@ -1264,6 +1264,7 @@
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 @@
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_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 @@
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 @@
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;
Modified: gnunet/src/util/test_getopt.c
===================================================================
--- gnunet/src/util/test_getopt.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/test_getopt.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -31,7 +31,6 @@
static int
testMinimal ()
{
- struct GNUNET_CONFIGURATION_Handle *cfg;
char *const emptyargv[] = {
"test",
NULL
@@ -40,13 +39,8 @@
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 @@
static int
testVerbose ()
{
- struct GNUNET_CONFIGURATION_Handle *cfg;
char *const myargv[] = {
"test",
"-V",
@@ -68,14 +61,11 @@
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 @@
static int
testVersion ()
{
- struct GNUNET_CONFIGURATION_Handle *cfg;
char *const myargv[] = {
"test_getopt",
"-v",
@@ -98,22 +87,18 @@
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 @@
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 @@
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 @@
static int
testFlagNum ()
{
- struct GNUNET_CONFIGURATION_Handle *cfg;
char *const myargv[] = {
"test_getopt",
"-f",
@@ -199,14 +176,11 @@
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);
Modified: gnunet/src/util/test_program.c
===================================================================
--- gnunet/src/util/test_program.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/test_program.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -41,7 +41,8 @@
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);
Modified: gnunet/src/util/test_service.c
===================================================================
--- gnunet/src/util/test_service.c 2009-07-26 20:25:44 UTC (rev 8790)
+++ gnunet/src/util/test_service.c 2009-07-26 21:20:11 UTC (rev 8791)
@@ -74,7 +74,7 @@
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 @@
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 @@
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 @@
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 @@
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,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r8791 - in gnunet/src: . arm core datacache datastore hostlist include peerinfo resolver statistics template topology transport util,
gnunet <=