|
|
|
@ -345,6 +345,8 @@ int yon_config_load_config(YON_CONFIG_TYPE config_type, ...){
|
|
|
|
if (config_type==YON_CONFIG_DEFAULT){
|
|
|
|
if (config_type==YON_CONFIG_DEFAULT){
|
|
|
|
yon_config_set_ignore(key);
|
|
|
|
yon_config_set_ignore(key);
|
|
|
|
yon_config_set_status(key,-2);
|
|
|
|
yon_config_set_status(key,-2);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_config_default_remove(key);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -678,6 +680,15 @@ int yon_config_clean(){
|
|
|
|
else return 0;
|
|
|
|
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){
|
|
|
|
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;
|
|
|
|
if (yon_char_is_empty(key)||yon_char_is_empty(config_load)) return YON_CONFIG_SAVED_ERROR;
|
|
|
|
|
|
|
|
|
|
|
|
@ -689,20 +700,17 @@ enum YON_CONFIG_SAVED_TYPE yon_config_register(char *key,char *config_load, char
|
|
|
|
if (!current){
|
|
|
|
if (!current){
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,data);
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,data);
|
|
|
|
current = (yon_config_parameter*)yon_dictionary_get_last((dictionary *)__yon__config__strings);
|
|
|
|
current = (yon_config_parameter*)yon_dictionary_get_last((dictionary *)__yon__config__strings);
|
|
|
|
} else if (!yon_char_is_empty(data)&&!strcmp((char*)current->data,(char*)data)){
|
|
|
|
} else if (!yon_char_is_empty(data)&¤t->data&&!strcmp((char*)current->data,(char*)data)){
|
|
|
|
save_type=YON_CONFIG_SAVED_EXIST;
|
|
|
|
save_type=YON_CONFIG_SAVED_EXIST;
|
|
|
|
return save_type;
|
|
|
|
return save_type;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
current->data = yon_char_new(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,data);
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,NULL);
|
|
|
|
current = __yon__config__strings;
|
|
|
|
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){
|
|
|
|
switch(current->flag1){
|
|
|
|
case -1: save_type = YON_CONFIG_SAVED_REMOVED;
|
|
|
|
case -1: save_type = YON_CONFIG_SAVED_REMOVED;
|
|
|
|
case 1: save_type = YON_CONFIG_SAVED_CHANGED;
|
|
|
|
case 1: save_type = YON_CONFIG_SAVED_CHANGED;
|
|
|
|
@ -738,6 +746,8 @@ enum YON_CONFIG_SAVED_TYPE yon_config_register_default(char *key,char *config_lo
|
|
|
|
} else if (!yon_char_is_empty(data)&&!strcmp((char*)current->data,(char*)data)){
|
|
|
|
} else if (!yon_char_is_empty(data)&&!strcmp((char*)current->data,(char*)data)){
|
|
|
|
save_type=YON_CONFIG_SAVED_EXIST;
|
|
|
|
save_type=YON_CONFIG_SAVED_EXIST;
|
|
|
|
return save_type;
|
|
|
|
return save_type;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
current->data = yon_char_new(data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__default__strings,key,data);
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__default__strings,key,data);
|
|
|
|
|