config.c (558B)
1 #include "domain/config.h" 2 3 #include <stdio.h> 4 #include <stdlib.h> 5 #include <string.h> 6 7 resp_object *domain_cfg = NULL; 8 9 void domain_config_init(void) { 10 if (domain_cfg) return; 11 domain_cfg = resp_array_init(); 12 } 13 14 void domain_config_free(void) { 15 if (domain_cfg) { 16 resp_free(domain_cfg); 17 domain_cfg = NULL; 18 } 19 } 20 21 resp_object *domain_config_get_cluster_nodes(void) { 22 if (!domain_cfg) return NULL; 23 resp_object *udphole_sec = resp_map_get(domain_cfg, "udphole"); 24 if (!udphole_sec) return NULL; 25 return resp_map_get(udphole_sec, "cluster"); 26 }