|
|
|
|
@ -1764,6 +1764,11 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
if (data){
|
|
|
|
|
if (!__yon__config__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))){
|
|
|
|
|
{
|
|
|
|
|
yon_config_parameter *cur_default = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key);
|
|
|
|
|
if ((cur_default&&cur_default->data&&!strcmp((char*)cur_default->data,(char*)data))){
|
|
|
|
|
yon_config_remove_by_key(current->key);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (__yon__config__strings){
|
|
|
|
|
char *data_copy = yon_char_new(data);
|
|
|
|
|
yon_config_parameter* dict=NULL;
|
|
|
|
|
@ -1790,22 +1795,17 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
}
|
|
|
|
|
else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))){
|
|
|
|
|
yon_config_parameter *cur_default = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,current->key);
|
|
|
|
|
if ((cur_default&&((yon_config_parameter*)current)->flag1==1&&!strcmp((char*)cur_default->data,(char*)data))){
|
|
|
|
|
yon_config_remove_by_key(current->key);
|
|
|
|
|
} else if ((current->data&&data!=__yon__config__strings->data&&strcmp(__yon__config__strings->data,data))||!current->data){
|
|
|
|
|
current->data=yon_char_new(data);
|
|
|
|
|
current->flag1=1;
|
|
|
|
|
current->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
current->load_command=config_load;
|
|
|
|
|
if (yon_dictionary_get(&__yon_config_ignored, current->key)){
|
|
|
|
|
__yon_config_ignored = yon_dictionary_rip(__yon_config_ignored);
|
|
|
|
|
}
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
current->section=yon_char_new(section[yon_char_parsed_check_exist(section,size,"get")+1]);
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
current->data=yon_char_new(data);
|
|
|
|
|
current->flag1=1;
|
|
|
|
|
current->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
current->load_command=config_load;
|
|
|
|
|
if (yon_dictionary_get(&__yon_config_ignored, current->key)){
|
|
|
|
|
__yon_config_ignored = yon_dictionary_rip(__yon_config_ignored);
|
|
|
|
|
}
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
current->section=yon_char_new(section[yon_char_parsed_check_exist(section,size,"get")+1]);
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
}
|
|
|
|
|
} else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))) {
|
|
|
|
|
current->data=NULL;
|
|
|
|
|
|