[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3282 - in GNUnet: contrib src/setup src/setup/lib src/setu
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3282 - in GNUnet: contrib src/setup src/setup/lib src/setup/text src/util/config_impl |
Date: |
Sun, 20 Aug 2006 19:15:14 -0700 (PDT) |
Author: grothoff
Date: 2006-08-20 19:15:09 -0700 (Sun, 20 Aug 2006)
New Revision: 3282
Modified:
GNUnet/contrib/config-daemon.scm
GNUnet/src/setup/gnunet-setup.c
GNUnet/src/setup/lib/gns.c
GNUnet/src/setup/lib/tree.c
GNUnet/src/setup/text/conf.c
GNUnet/src/util/config_impl/impl.c
Log:
gnunet setup bugfixes
Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/contrib/config-daemon.scm 2006-08-21 02:15:09 UTC (rev 3282)
@@ -72,7 +72,7 @@
developers, but please read the documents <file://README> and
<http://gnunet.org/faq.php3> and use <https://gnunet.org/mantis/> for
how to report problems." )
- ()
+ '()
#t
#f
#f
@@ -89,7 +89,7 @@
"These are options that maybe difficult to understand for the beginner.
These options typically refer to features that allow tweaking of the
installation. If in a hurry, say NO." )
- ()
+ '()
#t
#t
#f
@@ -103,7 +103,6 @@
""
(_ "Meta-configuration")
(_ "Which level of configuration should be available")
- (nohelp)
(list (meta-exp builder) (meta-adv builder) )
#t
#f
@@ -133,7 +132,7 @@
;; which we use internally and which is not used by build-tree-node!
(define (setup)
(main
- (lambda (a b c d e f g h i) build-tree-node a b c d e f g h)))
+ (lambda (a b c d e f g h i) (build-tree-node a b c d e f g h) ) ) )
;; "change" is not yet implemented. However, the idea is to again use
@@ -143,3 +142,4 @@
(define (change ctx root changed)
(0))
+;; (setup)
\ No newline at end of file
Modified: GNUnet/src/setup/gnunet-setup.c
===================================================================
--- GNUnet/src/setup/gnunet-setup.c 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/src/setup/gnunet-setup.c 2006-08-21 02:15:09 UTC (rev 3282)
@@ -127,7 +127,6 @@
char * specname;
int i;
- printf("Creating ectx\n");
ectx = GE_create_context_stderr(NO,
GE_WARNING | GE_ERROR | GE_FATAL |
GE_USER | GE_ADMIN | GE_DEVELOPER |
@@ -135,7 +134,6 @@
GE_setDefaultContext(ectx);
cfg = GC_create_C_impl();
GE_ASSERT(ectx, cfg != NULL);
- printf("Parsing options\n");
i = gnunet_parse_options(INFO,
ectx,
cfg,
@@ -237,6 +235,7 @@
GE_FATAL | GE_USER | GE_ADMIN | GE_IMMEDIATE,
_("`%s' is not available."),
operation);
+ GNS_free_specification(gns);
GC_free(cfg);
GE_free_context(ectx);
FREE(filename);
Modified: GNUnet/src/setup/lib/gns.c
===================================================================
--- GNUnet/src/setup/lib/gns.c 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/src/setup/lib/gns.c 2006-08-21 02:15:09 UTC (rev 3282)
@@ -112,9 +112,10 @@
val = GC_get_configuration_value_yesno(cfg,
section,
option,
- pos->value.Boolean.def);
- if (val == SYSERR)
+ pos->value.Boolean.def);
+ if (val == SYSERR) {
return SYSERR;
+ }
pos->value.Boolean.val = val;
break;
}
@@ -127,8 +128,9 @@
pos->value.UInt64.min,
pos->value.UInt64.max,
pos->value.UInt64.def,
- &val))
+ &val)) {
return SYSERR;
+ }
pos->value.UInt64.val = val;
break;
}
@@ -168,8 +170,9 @@
option,
(const char**)
pos->value.String.legalRange,
pos->value.String.def,
- &ival))
+ &ival)) {
return SYSERR;
+ }
val = STRDUP(ival);
} else {
if (SYSERR == GC_get_configuration_value_string(cfg,
Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/src/setup/lib/tree.c 2006-08-21 02:15:09 UTC (rev 3282)
@@ -213,7 +213,7 @@
children, SCM_ARG5, "build_tree_node");
}
SCM_ASSERT(scm_boolean_p(visible), visible, SCM_ARG6, "build_tree_node");
- if (scm_string_p(value)) {
+ if (scm_is_string(value)) {
SCM_ASSERT(scm_list_p(range), range, 8, "build_tree_node");
len = scm_to_int(scm_length(range));
for (i=0;i<len;i++)
@@ -226,9 +226,9 @@
range, 8, "build_tree_node");
SCM_ASSERT(scm_is_integer(SCM_CDR(range)),
range, 8, "build_tree_node");
- } else if (scm_real_p(value)) {
+ } else if (scm_is_true(scm_real_p(value))) {
/* no checks */
- } else if (scm_boolean_p(value)) {
+ } else if (scm_is_true(scm_boolean_p(value))) {
/* no checks */
} else {
SCM_ASSERT(0,
@@ -250,7 +250,7 @@
tree->type = clen == 0 ? GNS_Leaf : GNS_Node;
tree->visible = scm_is_true(visible);
- if (scm_string_p(value)) {
+ if (scm_is_string(value)) {
tree->value.String.val = scm_to_locale_string(value);
tree->value.String.def = scm_to_locale_string(value);
len = scm_to_int32(range);
@@ -265,14 +265,13 @@
tree->value.UInt64.def = scm_to_uint64(value);
tree->value.UInt64.min = scm_to_uint64(SCM_CAR(range));
tree->value.UInt64.max = scm_to_uint64(SCM_CDR(range));
- } else if (scm_real_p(value)) {
+ } else if (scm_is_true(scm_real_p(value))) {
tree->value.Double.val = scm_to_double(value);
tree->value.Double.def = scm_to_double(value);
- } else if (scm_boolean_p(value)) {
+ } else if (scm_is_true(scm_boolean_p(value))) {
tree->value.Boolean.val = scm_is_true(value);
tree->value.Boolean.def = scm_is_true(value);
}
-
/* box and return */
return box_tree(tree);
}
Modified: GNUnet/src/setup/text/conf.c
===================================================================
--- GNUnet/src/setup/text/conf.c 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/src/setup/text/conf.c 2006-08-21 02:15:09 UTC (rev 3282)
@@ -1,6 +1,6 @@
/*
This file is part of GNUnet.
- (C) 2005 Christian Grothoff (and other contributing authors)
+ (C) 2005, 2006 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
Modified: GNUnet/src/util/config_impl/impl.c
===================================================================
--- GNUnet/src/util/config_impl/impl.c 2006-08-21 01:33:37 UTC (rev 3281)
+++ GNUnet/src/util/config_impl/impl.c 2006-08-21 02:15:09 UTC (rev 3282)
@@ -697,15 +697,31 @@
GC_ChangeListener callback,
void * ctx) {
GC_Listener l;
+ int i;
+ int j;
MUTEX_LOCK(cfg->data->lock);
+ for (i=0;i<cfg->data->ssize;i++) {
+ GC_Section * s = &cfg->data->sections[i];
+ for (j=0;j<s->size;j++) {
+ GC_Entry * e = &s->entries[j];
+ if (0 != callback(ctx,
+ cfg,
+ cfg->data->ectx,
+ s->name,
+ e->key)) {
+ MUTEX_UNLOCK(cfg->data->lock);
+ return -1;
+ }
+ }
+ }
l.listener = callback;
l.ctx = ctx;
APPEND(cfg->data->listeners,
cfg->data->lsize,
l);
MUTEX_UNLOCK(cfg->data->lock);
- return -1;
+ return 0;
}
static int
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3282 - in GNUnet: contrib src/setup src/setup/lib src/setup/text src/util/config_impl,
grothoff <=