|
|
|
|
@ -1302,24 +1302,25 @@ int yon_config_load_register_no_cleaning(YON_CONFIG_TYPE config_type,char *secti
|
|
|
|
|
free(yon_char_divide(final_str,0));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dictionary *dicte = yon_dictionary_get((dictionary**)&__yon__config__strings,key);
|
|
|
|
|
yon_config_parameter *cur_config = (config_type!=YON_CONFIG_DEFAULT? __yon__config__strings:__yon__config__default__strings);
|
|
|
|
|
dictionary *dicte = yon_dictionary_get((dictionary**)&cur_config,key);
|
|
|
|
|
if (!dicte){
|
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(__yon__config__strings,key,yon_char_new(final_str));
|
|
|
|
|
yon_config_parameter_add_or_create_if_exists_with_data(cur_config,key,yon_char_new(final_str));
|
|
|
|
|
} else {
|
|
|
|
|
if (strcmp((char*)dicte->data,final_str)){
|
|
|
|
|
__yon__config__strings->data=final_str;
|
|
|
|
|
cur_config->data=final_str;
|
|
|
|
|
} else {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
__yon__config__strings->flag1=0;
|
|
|
|
|
cur_config->flag1=0;
|
|
|
|
|
yon_config_remove_ignore(key);
|
|
|
|
|
if (config_type==YON_CONFIG_DEFAULT){
|
|
|
|
|
__yon__config__strings->flag1=-2;
|
|
|
|
|
cur_config->flag1=-2;
|
|
|
|
|
yon_config_set_ignore(key);
|
|
|
|
|
}
|
|
|
|
|
__yon__config__strings->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
__yon__config__strings->section=dict->key;
|
|
|
|
|
cur_config->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
cur_config->section=dict->key;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(command);
|
|
|
|
|
@ -1751,6 +1752,7 @@ int yon_config_clean(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
if (!yon_char_is_empty(key)){
|
|
|
|
|
key=yon_char_new(key);
|
|
|
|
|
config_load=yon_char_new(config_load);
|
|
|
|
|
yon_config_parameter *current = NULL;
|
|
|
|
|
@ -1783,6 +1785,7 @@ 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 ((current->data&&data!=__yon__config__strings->data&&strcmp(__yon__config__strings->data,data))||!current->data){
|
|
|
|
|
current->data=yon_char_new(data);
|
|
|
|
|
current->flag1=1;
|
|
|
|
|
@ -1795,6 +1798,9 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
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);
|
|
|
|
|
if (!cur_default||(cur_default&&strcmp((char*)cur_default->data,(char*)current->data))){
|
|
|
|
|
yon_config_remove_by_key(current->key);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))) {
|
|
|
|
|
@ -1851,6 +1857,7 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
config_str yon_config_load(char *command, int *str_len){
|
|
|
|
|
@ -2149,6 +2156,10 @@ char *yon_config_parameter_prepare_command(char *command, char *path, char *sect
|
|
|
|
|
config_str parsed = yon_char_parse(command,&size," ");
|
|
|
|
|
int source_pos=yon_char_parsed_check_exist(parsed,size,"--source");
|
|
|
|
|
int get_pos = yon_char_parsed_check_exist(parsed,size,"get");
|
|
|
|
|
if (source_pos==-1) {
|
|
|
|
|
source_pos = yon_char_parsed_check_exist(parsed,size,"--target");
|
|
|
|
|
get_pos = yon_char_parsed_check_exist(parsed,size,"set");
|
|
|
|
|
}
|
|
|
|
|
if (path&&!strcmp(path,"")){
|
|
|
|
|
if (source_pos>-1&&size>source_pos+1){
|
|
|
|
|
free(parsed[source_pos]);
|
|
|
|
|
|