summaryrefslogtreecommitdiffstats
path: root/ctl-lib/ctl-config.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-10-25 19:10:56 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-10-25 19:10:56 +0200
commite532f01fc3028ee8d766a692651243661b2769f8 (patch)
tree140d833a1a7f3eb3ed31c9be0e1327d26ff66c3f /ctl-lib/ctl-config.c
parente9205ca171ed794ac18dcdec40578955a64361f3 (diff)
Formating
Change-Id: I2b805a60b67db1a72b429093256999673e2c3964 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib/ctl-config.c')
-rw-r--r--ctl-lib/ctl-config.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/ctl-lib/ctl-config.c b/ctl-lib/ctl-config.c
index 9b04df6..42d2897 100644
--- a/ctl-lib/ctl-config.c
+++ b/ctl-lib/ctl-config.c
@@ -39,7 +39,7 @@ PUBLIC int CtlConfigMagicNew() {
gettimeofday(&tv,NULL);
srand ((int)tv.tv_usec);
}
-
+
return ((long)rand());
}
@@ -56,7 +56,7 @@ PUBLIC json_object* CtlConfigScan(const char *dirList, const char *prefix) {
PUBLIC char* CtlConfigSearch(AFB_ApiT apiHandle, const char *dirList, const char *prefix) {
int index, err;
-
+
// search for default dispatch config file
json_object* responseJ = CtlConfigScan (dirList, prefix);
@@ -86,7 +86,7 @@ PUBLIC char* CtlConfigSearch(AFB_ApiT apiHandle, const char *dirList, const char
}
PUBLIC int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) {
-
+
// best effort to initialise everything before starting
if (ctlConfig->requireJ) {
@@ -115,12 +115,12 @@ PUBLIC int CtlConfigExec(AFB_ApiT apiHandle, CtlConfigT *ctlConfig) {
// Loop on every section and process config
int errcount=0;
for (int idx = 0; ctlConfig->sections[idx].key != NULL; idx++) {
-
+
if (!ctlConfig->sections[idx].actions) {
AFB_ApiNotice(apiHandle, "CtlConfigLoad: notice empty section '%s'", ctlConfig->sections[idx].key);
continue;
}
-
+
errcount += ctlConfig->sections[idx].loadCB(apiHandle, &ctlConfig->sections[idx], NULL);
}
return errcount;
@@ -154,10 +154,10 @@ PUBLIC CtlConfigT *CtlLoadMetaData(AFB_ApiT apiHandle, const char* filepath) {
goto OnErrorExit;
}
}
-
- ctlHandle->configJ = ctlConfigJ;
+
+ ctlHandle->configJ = ctlConfigJ;
return ctlHandle;
-
+
OnErrorExit:
if (ctlHandle) free(ctlHandle);
return NULL;