aboutsummaryrefslogtreecommitdiff
path: root/src/util/gnunet-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/gnunet-config.c')
-rw-r--r--src/util/gnunet-config.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/src/util/gnunet-config.c b/src/util/gnunet-config.c
index 5f7d9fc0d..16b826ee2 100644
--- a/src/util/gnunet-config.c
+++ b/src/util/gnunet-config.c
@@ -2,20 +2,18 @@
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2012 GNUnet e.V. 3 Copyright (C) 2012 GNUnet e.V.
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software: you can redistribute it and/or modify it
6 it under the terms of the GNU General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation; either version 3, or (at your 7 by the Free Software Foundation, either version 3 of the License,
8 option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with GNUnet; see the file COPYING. If not, write to the 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/ 17*/
20 18
21/** 19/**
@@ -77,12 +75,28 @@ print_option (void *cls,
77 const char *option, 75 const char *option,
78 const char *value) 76 const char *value)
79{ 77{
80 (void) cls;
81 (void) section; 78 (void) section;
82 fprintf (stdout, 79 const struct GNUNET_CONFIGURATION_Handle *cfg = cls;
83 "%s = %s\n", 80 char *value_fn;
84 option, 81 if (is_filename)
85 value); 82 {
83 GNUNET_assert (GNUNET_OK ==
84 GNUNET_CONFIGURATION_get_value_filename (cfg,
85 section,
86 option,
87 &value_fn));
88 fprintf (stdout,
89 "%s = %s\n",
90 option,
91 GNUNET_STRINGS_filename_expand (value_fn));
92 }
93 else
94 {
95 fprintf (stdout,
96 "%s = %s\n",
97 option,
98 value);
99 }
86} 100}
87 101
88 102
@@ -161,8 +175,8 @@ run (void *cls,
161 { 175 {
162 GNUNET_CONFIGURATION_iterate_section_values (cfg, 176 GNUNET_CONFIGURATION_iterate_section_values (cfg,
163 section, 177 section,
164 &print_option, 178 &print_option,
165 NULL); 179 (void *) cfg);
166 } 180 }
167 else 181 else
168 { 182 {