|
|
|
|
@ -745,8 +745,13 @@ config_str yon_char_parsed_merge(config_str array1, int size1, config_str array2
|
|
|
|
|
}
|
|
|
|
|
return parsed_final;
|
|
|
|
|
} else {
|
|
|
|
|
*final_size=size1;
|
|
|
|
|
return array1;
|
|
|
|
|
if (array1){
|
|
|
|
|
*final_size=size1;
|
|
|
|
|
return array1;
|
|
|
|
|
}
|
|
|
|
|
if (array2)
|
|
|
|
|
*final_size=size2;
|
|
|
|
|
return array2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1239,6 +1244,7 @@ int yon_config_load_config(YON_CONFIG_TYPE config_type, ...){
|
|
|
|
|
int command_parsed_size=0;
|
|
|
|
|
config_str command_parsed = yon_char_parse(command[i],&command_parsed_size," ");
|
|
|
|
|
yon_config_register(command_parsed[5], command[i],NULL);
|
|
|
|
|
yon_config_set_status(command_parsed[5],0);
|
|
|
|
|
yon_char_parsed_free(command_parsed,command_parsed_size);
|
|
|
|
|
if (parsed_size>0){
|
|
|
|
|
for (int j=0;j<parsed_size;j++){
|
|
|
|
|
@ -1548,7 +1554,8 @@ int yon_config_clean(){
|
|
|
|
|
void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
key=yon_char_new(key);
|
|
|
|
|
config_load=yon_char_new(config_load);
|
|
|
|
|
if (!__yon__config__strings||!yon_dictionary_get((dictionary**)&__yon__config__strings,key)){
|
|
|
|
|
yon_config_parameter *current = NULL;
|
|
|
|
|
if (!__yon__config__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))){
|
|
|
|
|
{
|
|
|
|
|
if (__yon__config__strings){
|
|
|
|
|
char *data_copy = yon_char_new(data);
|
|
|
|
|
@ -1575,18 +1582,18 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
__yon__config__strings->section=yon_char_new(section[4]);
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
}
|
|
|
|
|
else if (yon_dictionary_get((dictionary**)&__yon__config__strings,key)){
|
|
|
|
|
if (__yon__config__strings->data&&data!=__yon__config__strings->data&&strcmp(__yon__config__strings->data,data)){
|
|
|
|
|
__yon__config__strings->data=yon_char_new(data);
|
|
|
|
|
__yon__config__strings->flag1=1;
|
|
|
|
|
__yon__config__strings->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
__yon__config__strings->load_command=config_load;
|
|
|
|
|
if (yon_dictionary_get(&__yon_config_ignored, __yon__config__strings->key)){
|
|
|
|
|
else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,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;
|
|
|
|
|
current->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
current->load_command=config_load;
|
|
|
|
|
if (yon_dictionary_get(&__yon_config_ignored, current->key)){
|
|
|
|
|
yon_dictionary_rip(__yon_config_ignored);
|
|
|
|
|
}
|
|
|
|
|
int size=0;
|
|
|
|
|
config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
__yon__config__strings->section=yon_char_new(section[4]);
|
|
|
|
|
current->section=yon_char_new(section[4]);
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -1805,9 +1812,9 @@ config_str yon_config_get_save_parameters_by_key(int *size, char *parameter,...)
|
|
|
|
|
config_str yon_config_get_save_parameters(int *size){
|
|
|
|
|
|
|
|
|
|
(*size)=0;
|
|
|
|
|
int removed_size;
|
|
|
|
|
int removed_size=0;
|
|
|
|
|
config_str removed = NULL;
|
|
|
|
|
int updated_size;
|
|
|
|
|
int updated_size=0;
|
|
|
|
|
config_str updated = NULL;
|
|
|
|
|
config_str final = NULL;
|
|
|
|
|
for_config{
|
|
|
|
|
|