src/tools/wstool.c

branch
config
changeset 258
134279e804b6
parent 254
4784c14aa639
child 415
d938228c382e
--- a/src/tools/wstool.c	Mon Aug 24 17:09:16 2020 +0200
+++ b/src/tools/wstool.c	Mon Aug 24 19:19:56 2020 +0200
@@ -32,7 +32,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "../server/config/serverconf.h"
+#include "../server/config/serverconfig.h"
 
 #include "srvctrlsocket.h"
 
@@ -61,8 +61,8 @@
 }
 
 int tool_get_tmpdir(char *configfile) {
-    ServerConfig2 *serverconf = load_server_config(configfile);
-    UcxList *list = ucx_map_sstr_get(serverconf->objects, sstrn("Runtime", 7));
+    ServerConfig *serverconf = serverconfig_load(configfile);
+    UcxList *list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, SC("Runtime"));
     if(!list) {
         fprintf(stderr, "Error: No Runtime element in %s\n", configfile);
         return -1;
@@ -71,8 +71,11 @@
         fprintf(stderr, "Error: Multiple Runtime elements in %s\n", configfile);
         return -1;
     }
-    ServerConfigObject *runtime = list->data;
-    sstr_t tmp = cfg_directivelist_get_str(runtime->directives, sstr("Temp"));
+    ConfigNode *runtime = list->data;
+    scstr_t tmp = serverconfig_directive_value(runtime, SC("Temp"));
+    
+    ucx_list_free(list);
+    
     if(!tmp.ptr) {
         fprintf(stderr, "Error: No Temp directive in Runtime Object\n");
         return -1;

mercurial