|
|
|
@ -1969,9 +1969,11 @@ config_str yon_config_get_save_parameters_by_list(int *size, config_str paramete
|
|
|
|
config_str final = NULL;
|
|
|
|
config_str final = NULL;
|
|
|
|
char *current_str = NULL;
|
|
|
|
char *current_str = NULL;
|
|
|
|
for (int i=0;i<params_size;i++){
|
|
|
|
for (int i=0;i<params_size;i++){
|
|
|
|
|
|
|
|
int found = 0;
|
|
|
|
current_str=parameters[i];
|
|
|
|
current_str=parameters[i];
|
|
|
|
for_config{
|
|
|
|
for_config{
|
|
|
|
if (!strcmp(temp->key,current_str)){
|
|
|
|
if (!strcmp(temp->key,current_str)){
|
|
|
|
|
|
|
|
found = 1;
|
|
|
|
if (((yon_config_parameter*)temp)->flag1!=-2){
|
|
|
|
if (((yon_config_parameter*)temp)->flag1!=-2){
|
|
|
|
char *action = NULL;
|
|
|
|
char *action = NULL;
|
|
|
|
config_str *current=NULL;
|
|
|
|
config_str *current=NULL;
|
|
|
|
@ -2002,6 +2004,20 @@ config_str yon_config_get_save_parameters_by_list(int *size, config_str paramete
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!found){
|
|
|
|
|
|
|
|
if(removed){
|
|
|
|
|
|
|
|
int position = yon_char_parsed_find_element(removed,removed_size,((yon_config_parameter*)temp)->section);
|
|
|
|
|
|
|
|
if (position>=0){
|
|
|
|
|
|
|
|
char *string = yon_char_unite((removed)[position]," ",yon_config_parameter_to_string((yon_config_parameter*)temp,0),NULL);
|
|
|
|
|
|
|
|
free(removed[position]);
|
|
|
|
|
|
|
|
removed[position]=string;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
char *string = yon_char_unite("remove"," ",parameters[i],NULL);
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(removed,&removed_size,string);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (updated&&removed){
|
|
|
|
if (updated&&removed){
|
|
|
|
final = yon_char_parsed_merge(updated,updated_size,removed,removed_size,size);
|
|
|
|
final = yon_char_parsed_merge(updated,updated_size,removed,removed_size,size);
|
|
|
|
@ -2299,6 +2315,16 @@ char *yon_config_get_parameter(config_str parameters, int size, char *param)
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int yon_config_change_key(char *target, char *key){
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(target)&&!yon_char_is_empty(key)){
|
|
|
|
|
|
|
|
dictionary *dict = yon_dictionary_get((dictionary**)&__yon__config__strings,target);
|
|
|
|
|
|
|
|
if (!dict) return 0;
|
|
|
|
|
|
|
|
free(dict->key);
|
|
|
|
|
|
|
|
dict->key = yon_char_new(key);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
char *yon_file_path_proceed_spaces(char *path){
|
|
|
|
char *yon_file_path_proceed_spaces(char *path){
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str parsed = yon_char_parse(path,&size,"/");
|
|
|
|
config_str parsed = yon_char_parse(path,&size,"/");
|
|
|
|
|