Test fix for saving

pull/45/head
parent 93e4b69d59
commit b94c02b62b

@ -345,6 +345,8 @@ int yon_config_load_config(YON_CONFIG_TYPE config_type, ...){
if (config_type==YON_CONFIG_DEFAULT){
yon_config_set_ignore(key);
yon_config_set_status(key,-2);
} else {
yon_config_default_remove(key);
}
}
}
@ -678,6 +680,15 @@ int yon_config_clean(){
else return 0;
}
int yon_config_default_remove(char *key){
yon_config_parameter *default_parameter = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key);
if (default_parameter){
__yon__config__default__strings = (yon_config_parameter*)yon_dictionary_rip((dictionary*)default_parameter);
return 1;
}
return 0;
}
enum YON_CONFIG_SAVED_TYPE yon_config_register(char *key,char *config_load, char *data){
if (yon_char_is_empty(key)||yon_char_is_empty(config_load)) return YON_CONFIG_SAVED_ERROR;
@ -698,11 +709,6 @@ enum YON_CONFIG_SAVED_TYPE yon_config_register(char *key,char *config_load, char
current = __yon__config__strings;
}
yon_config_parameter *default_parameter = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key);
if (default_parameter){
__yon__config__default__strings = (yon_config_parameter*)yon_dictionary_rip((dictionary*)default_parameter);
}
switch(current->flag1){
case -1: save_type = YON_CONFIG_SAVED_REMOVED;
case 1: save_type = YON_CONFIG_SAVED_CHANGED;

@ -972,6 +972,7 @@ int yon_config_append(char *key, char *data, char *divider);
*/
int yon_config_clean();
int yon_config_default_remove(char *key);
enum YON_CONFIG_SAVED_TYPE{
YON_CONFIG_SAVED_NEW,

Loading…
Cancel
Save