|
|
|
@ -702,6 +702,28 @@ int yon_config_remove_elements(char *key, char *delete_target, char *divider){
|
|
|
|
} else return 0;
|
|
|
|
} else return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int yon_config_remove_elements_all(char *key, char *delete_target, char *divider){
|
|
|
|
|
|
|
|
check_config{
|
|
|
|
|
|
|
|
int found = 0;
|
|
|
|
|
|
|
|
yon_config_parameter *dict = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key);
|
|
|
|
|
|
|
|
if (dict&&yon_char_check_elements((char*)dict->data,delete_target,divider)){
|
|
|
|
|
|
|
|
char *temp = yon_char_remove_elements((char*)dict->data,delete_target,divider);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(temp)){
|
|
|
|
|
|
|
|
if (!yon_char_is_empty((char*)dict->data)) free(dict->data);
|
|
|
|
|
|
|
|
dict->data = temp;
|
|
|
|
|
|
|
|
yon_config_set_status(key,1);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
dict->data = NULL;
|
|
|
|
|
|
|
|
yon_config_set_status(key,-1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int yon_config_append_element(char *key, char *append, char *divider){
|
|
|
|
int yon_config_append_element(char *key, char *append, char *divider){
|
|
|
|
check_config{
|
|
|
|
check_config{
|
|
|
|
int found = 0;
|
|
|
|
int found = 0;
|
|
|
|
@ -858,7 +880,7 @@ void *yon_config_get_all_keys_by_key(char *key, int *size){
|
|
|
|
config_str ret_data=NULL;
|
|
|
|
config_str ret_data=NULL;
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
for_dictionaries(dict, (dictionary*)__yon__config__strings){
|
|
|
|
for_dictionaries(dict, (dictionary*)__yon__config__strings){
|
|
|
|
if (strstr(dict->key,key)&&((yon_config_parameter*)dict)->flag1!=-1) {
|
|
|
|
if (strstr(dict->key,key)/*&&((yon_config_parameter*)dict)->flag1!=-1*/) {
|
|
|
|
char *ret_string = yon_char_new(dict->key);
|
|
|
|
char *ret_string = yon_char_new(dict->key);
|
|
|
|
if (ret_data) ret_data = yon_char_parsed_append(ret_data,size,ret_string);
|
|
|
|
if (ret_data) ret_data = yon_char_parsed_append(ret_data,size,ret_string);
|
|
|
|
else ret_data = yon_char_parsed_new(size,ret_string,NULL);
|
|
|
|
else ret_data = yon_char_parsed_new(size,ret_string,NULL);
|
|
|
|
|