diff options
author | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-09-08 12:33:09 +0000 |
commit | d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch) | |
tree | 9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/util/configuration_loader.c | |
parent | a0fce305c565c0937d917a92712f15e9c5736260 (diff) | |
download | gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip |
uncrustify as demanded.
Diffstat (limited to 'src/util/configuration_loader.c')
-rw-r--r-- | src/util/configuration_loader.c | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/util/configuration_loader.c b/src/util/configuration_loader.c index 095e69474..ccf9a25b2 100644 --- a/src/util/configuration_loader.c +++ b/src/util/configuration_loader.c | |||
@@ -11,12 +11,12 @@ | |||
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 | Affero 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 Affero General Public License | 15 | You should have received a copy of the GNU Affero General Public License |
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | ||
18 | SPDX-License-Identifier: AGPL3.0-or-later | 18 | SPDX-License-Identifier: AGPL3.0-or-later |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /** | 21 | /** |
22 | * @file src/util/configuration_loader.c | 22 | * @file src/util/configuration_loader.c |
@@ -27,7 +27,7 @@ | |||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunet_util_lib.h" | 28 | #include "gnunet_util_lib.h" |
29 | 29 | ||
30 | #define LOG(kind,...) GNUNET_log_from (kind, "util-configuration", __VA_ARGS__) | 30 | #define LOG(kind, ...) GNUNET_log_from(kind, "util-configuration", __VA_ARGS__) |
31 | 31 | ||
32 | 32 | ||
33 | /** | 33 | /** |
@@ -39,48 +39,48 @@ | |||
39 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 39 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
40 | */ | 40 | */ |
41 | int | 41 | int |
42 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 42 | GNUNET_CONFIGURATION_load(struct GNUNET_CONFIGURATION_Handle *cfg, |
43 | const char *filename) | 43 | const char *filename) |
44 | { | 44 | { |
45 | char *baseconfig; | 45 | char *baseconfig; |
46 | const char *base_config_varname; | 46 | const char *base_config_varname; |
47 | 47 | ||
48 | base_config_varname = GNUNET_OS_project_data_get ()->base_config_varname; | 48 | base_config_varname = GNUNET_OS_project_data_get()->base_config_varname; |
49 | 49 | ||
50 | if (NULL != (baseconfig = getenv (base_config_varname))) | 50 | if (NULL != (baseconfig = getenv(base_config_varname))) |
51 | { | 51 | { |
52 | baseconfig = GNUNET_strdup (baseconfig); | 52 | baseconfig = GNUNET_strdup(baseconfig); |
53 | } | 53 | } |
54 | else | 54 | else |
55 | { | 55 | { |
56 | char *ipath; | 56 | char *ipath; |
57 | 57 | ||
58 | ipath = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR); | 58 | ipath = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_DATADIR); |
59 | if (NULL == ipath) | 59 | if (NULL == ipath) |
60 | return GNUNET_SYSERR; | 60 | return GNUNET_SYSERR; |
61 | GNUNET_asprintf (&baseconfig, "%s%s", ipath, "config.d"); | 61 | GNUNET_asprintf(&baseconfig, "%s%s", ipath, "config.d"); |
62 | GNUNET_free (ipath); | 62 | GNUNET_free(ipath); |
63 | } | 63 | } |
64 | 64 | ||
65 | if (GNUNET_SYSERR == | 65 | if (GNUNET_SYSERR == |
66 | GNUNET_CONFIGURATION_load_from (cfg, | 66 | GNUNET_CONFIGURATION_load_from(cfg, |
67 | baseconfig)) | 67 | baseconfig)) |
68 | { | 68 | { |
69 | GNUNET_free (baseconfig); | 69 | GNUNET_free(baseconfig); |
70 | return GNUNET_SYSERR; /* no configuration at all found */ | 70 | return GNUNET_SYSERR; /* no configuration at all found */ |
71 | } | 71 | } |
72 | GNUNET_free (baseconfig); | 72 | GNUNET_free(baseconfig); |
73 | if ((NULL != filename) && | 73 | if ((NULL != filename) && |
74 | (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, filename))) | 74 | (GNUNET_OK != GNUNET_CONFIGURATION_parse(cfg, filename))) |
75 | { | 75 | { |
76 | /* specified configuration not found */ | 76 | /* specified configuration not found */ |
77 | return GNUNET_SYSERR; | 77 | return GNUNET_SYSERR; |
78 | } | 78 | } |
79 | if (((GNUNET_YES != | 79 | if (((GNUNET_YES != |
80 | GNUNET_CONFIGURATION_have_value (cfg, "PATHS", "DEFAULTCONFIG"))) && | 80 | GNUNET_CONFIGURATION_have_value(cfg, "PATHS", "DEFAULTCONFIG"))) && |
81 | (filename != NULL)) | 81 | (filename != NULL)) |
82 | GNUNET_CONFIGURATION_set_value_string (cfg, "PATHS", "DEFAULTCONFIG", | 82 | GNUNET_CONFIGURATION_set_value_string(cfg, "PATHS", "DEFAULTCONFIG", |
83 | filename); | 83 | filename); |
84 | return GNUNET_OK; | 84 | return GNUNET_OK; |
85 | } | 85 | } |
86 | 86 | ||