59 print_info(argv[0]); |
59 print_info(argv[0]); |
60 return -2; |
60 return -2; |
61 } |
61 } |
62 |
62 |
63 int tool_get_tmpdir(char *configfile) { |
63 int tool_get_tmpdir(char *configfile) { |
64 ServerConfig2 *serverconf = load_server_config(configfile); |
64 ServerConfig *serverconf = serverconfig_load(configfile); |
65 UcxList *list = ucx_map_sstr_get(serverconf->objects, sstrn("Runtime", 7)); |
65 UcxList *list = serverconfig_get_node_list(serverconf->root, CONFIG_NODE_OBJECT, SC("Runtime")); |
66 if(!list) { |
66 if(!list) { |
67 fprintf(stderr, "Error: No Runtime element in %s\n", configfile); |
67 fprintf(stderr, "Error: No Runtime element in %s\n", configfile); |
68 return -1; |
68 return -1; |
69 } |
69 } |
70 if(ucx_list_size(list) != 1) { |
70 if(ucx_list_size(list) != 1) { |
71 fprintf(stderr, "Error: Multiple Runtime elements in %s\n", configfile); |
71 fprintf(stderr, "Error: Multiple Runtime elements in %s\n", configfile); |
72 return -1; |
72 return -1; |
73 } |
73 } |
74 ServerConfigObject *runtime = list->data; |
74 ConfigNode *runtime = list->data; |
75 sstr_t tmp = cfg_directivelist_get_str(runtime->directives, sstr("Temp")); |
75 scstr_t tmp = serverconfig_directive_value(runtime, SC("Temp")); |
|
76 |
|
77 ucx_list_free(list); |
|
78 |
76 if(!tmp.ptr) { |
79 if(!tmp.ptr) { |
77 fprintf(stderr, "Error: No Temp directive in Runtime Object\n"); |
80 fprintf(stderr, "Error: No Temp directive in Runtime Object\n"); |
78 return -1; |
81 return -1; |
79 } |
82 } |
80 |
83 |