|
|
|
|
@ -884,7 +884,8 @@ yon_config_parameter *yon_config_parameter_new_with_data(char *key, void *data){
|
|
|
|
|
yon_config_parameter *yon_config_parameter_append_with_data(yon_config_parameter *dict, char *key, void *data){
|
|
|
|
|
yon_config_parameter *param = yon_config_parameter_new_with_data(key,data);
|
|
|
|
|
param->first=dict->first;
|
|
|
|
|
(param->prev)=(yon_config_parameter*)yon_dictionary_get_last((dictionary*)dict);
|
|
|
|
|
dict = (yon_config_parameter*)yon_dictionary_get_last((dictionary*)dict);
|
|
|
|
|
(param->prev)=dict;
|
|
|
|
|
dict->next=param;
|
|
|
|
|
return param;
|
|
|
|
|
}
|
|
|
|
|
@ -966,16 +967,17 @@ int yon_config_load_register_no_cleaning(YON_CONFIG_TYPE config_type,char *secti
|
|
|
|
|
free(yon_char_divide(final_str,0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!yon_dictionary_get((dictionary**)&__yon__config__strings,key)){
|
|
|
|
|
dictionary *dicte = yon_dictionary_get((dictionary**)&__yon__config__strings,key);
|
|
|
|
|
if (!dicte){
|
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,yon_char_new(final_str));
|
|
|
|
|
} else {
|
|
|
|
|
if (strcmp((char*)__yon__config__strings->data,final_str)){
|
|
|
|
|
if (strcmp((char*)dicte->data,final_str)){
|
|
|
|
|
__yon__config__strings->data=final_str;
|
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
__yon__config__strings->flag1=0;
|
|
|
|
|
yon_config_remove_ignore(key);
|
|
|
|
|
if (config_type==YON_CONFIG_DEFAULT){
|
|
|
|
|
__yon__config__strings->flag1=-2;
|
|
|
|
|
@ -1029,7 +1031,8 @@ int yon_config_load_register(YON_CONFIG_TYPE config_type,char *section,char *par
|
|
|
|
|
free(yon_char_divide(final_str,0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!yon_dictionary_get((dictionary**)&__yon__config__strings,key)){
|
|
|
|
|
dictionary *dicte = yon_dictionary_get((dictionary**)&__yon__config__strings,key);
|
|
|
|
|
if (!dicte){
|
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,yon_char_new(final_str));
|
|
|
|
|
} else {
|
|
|
|
|
if (strcmp((char*)__yon__config__strings->data,final_str)){
|
|
|
|
|
@ -1038,6 +1041,7 @@ int yon_config_load_register(YON_CONFIG_TYPE config_type,char *section,char *par
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
__yon__config__strings->flag1=0;
|
|
|
|
|
yon_config_remove_ignore(key);
|
|
|
|
|
if (config_type==YON_CONFIG_DEFAULT){
|
|
|
|
|
__yon__config__strings->flag1=-2;
|
|
|
|
|
@ -1070,7 +1074,7 @@ int yon_config_remove_by_key(char *key){
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_config_remove_element(char *key, char *delete, char *divider){
|
|
|
|
|
int yon_config_remove_element(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);
|
|
|
|
|
@ -1079,7 +1083,7 @@ int yon_config_remove_element(char *key, char *delete, char *divider){
|
|
|
|
|
config_str parsed = yon_char_parse((char*)dict->data,&size,divider);
|
|
|
|
|
config_str final = NULL;
|
|
|
|
|
for(int i=0;i<size;i++){
|
|
|
|
|
if (!strcmp(parsed[i],delete)){
|
|
|
|
|
if (!strcmp(parsed[i],delete_target)){
|
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&size,i--);
|
|
|
|
|
found = 1;
|
|
|
|
|
}
|
|
|
|
|
@ -1235,7 +1239,7 @@ int yon_config_append(char *key, char *data, char *divider){
|
|
|
|
|
if (dict){
|
|
|
|
|
if (strcmp(((char*)dict->data),"")!=0){
|
|
|
|
|
char *str = (char*)dict->data;
|
|
|
|
|
dict->data=(void*)(yon_char_unite(yon_char_is_empty(str)?"":str,yon_char_is_empty(str)?"":",",divider,data,NULL));
|
|
|
|
|
dict->data=(void*)(yon_char_unite(yon_char_is_empty(str)?"":str,yon_char_is_empty(str)?"":divider,data,NULL));
|
|
|
|
|
}
|
|
|
|
|
else dict->data=(void*)yon_char_new(data);
|
|
|
|
|
dict->flag1=1;
|
|
|
|
|
|