GF_EXPORT GF_Config *gf_cfg_force_new(const char *filePath, const char* file_name) { GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config)); memset((void *)tmp, 0, sizeof(GF_Config)); gf_cfg_parse_config_file(tmp, filePath, file_name); return tmp; }
GF_EXPORT GF_Config *gf_cfg_new(const char *filePath, const char* file_name) { GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config)); memset((void *)tmp, 0, sizeof(GF_Config)); if (gf_cfg_parse_config_file(tmp, filePath, file_name)){ gf_free( tmp ); tmp = NULL; } return tmp; }
GF_EXPORT GF_Config *gf_cfg_new(const char *filePath, const char* file_name) { GF_Config *tmp = (GF_Config *)gf_malloc(sizeof(GF_Config)); memset((void *)tmp, 0, sizeof(GF_Config)); if (!filePath && !file_name) { tmp->sections = gf_list_new(); return tmp; } if (gf_cfg_parse_config_file(tmp, filePath, file_name)) { gf_cfg_clear(tmp); gf_free(tmp); tmp = NULL; } return tmp; }