|
|
|
@ -105,7 +105,6 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(current->data);
|
|
|
|
free(current->data);
|
|
|
|
cur_section->data = parameters_for_current_command;
|
|
|
|
cur_section->data = parameters_for_current_command;
|
|
|
|
printf("%s\n",parameters_for_current_command);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
char *parameters_for_current_command = NULL;
|
|
|
|
char *parameters_for_current_command = NULL;
|
|
|
|
if (yon_config_get_status(current->key)==-1){
|
|
|
|
if (yon_config_get_status(current->key)==-1){
|
|
|
|
@ -116,7 +115,6 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe
|
|
|
|
dictionary *sections_dict = NULL;
|
|
|
|
dictionary *sections_dict = NULL;
|
|
|
|
if (sections) sections_dict = yon_dictionary_get_last((dictionary*)sections);
|
|
|
|
if (sections) sections_dict = yon_dictionary_get_last((dictionary*)sections);
|
|
|
|
sections = malloc(sizeof(struct yon_temp_command_sections));
|
|
|
|
sections = malloc(sizeof(struct yon_temp_command_sections));
|
|
|
|
printf("%s\n",parameters_for_current_command);
|
|
|
|
|
|
|
|
sections->data=parameters_for_current_command;
|
|
|
|
sections->data=parameters_for_current_command;
|
|
|
|
sections->first=sections;
|
|
|
|
sections->first=sections;
|
|
|
|
sections->key=yon_char_new(current->section);
|
|
|
|
sections->key=yon_char_new(current->section);
|
|
|
|
@ -145,7 +143,6 @@ config_str yon_loaded_config_convert_to_save_command(struct loaded_config *targe
|
|
|
|
dull_command = ubconfig_remove_command_full(path,current->key,(char*)current->data);
|
|
|
|
dull_command = ubconfig_remove_command_full(path,current->key,(char*)current->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_char_parsed_add_or_create_if_exists(commands,size,dull_command);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(commands,size,dull_command);
|
|
|
|
printf("%s\n",dull_command);
|
|
|
|
|
|
|
|
free(dull_command);
|
|
|
|
free(dull_command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -369,17 +366,9 @@ void yon_save_window_compared_config_init_unfound(template_saving_window *window
|
|
|
|
int yon_config_parameter_prepare_elements(config_str target, int *size){
|
|
|
|
int yon_config_parameter_prepare_elements(config_str target, int *size){
|
|
|
|
int success = 0;
|
|
|
|
int success = 0;
|
|
|
|
for (int i=0;i<(*size);i++){
|
|
|
|
for (int i=0;i<(*size);i++){
|
|
|
|
int parameters_size;
|
|
|
|
char *start_bracket_replaced_string = yon_char_replace(target[i],"[","[\"");
|
|
|
|
config_str parameters = yon_config_command_get_parameters(target[i],¶meters_size);
|
|
|
|
|
|
|
|
char *parameters_string = yon_char_parsed_to_string(parameters,parameters_size," ");
|
|
|
|
|
|
|
|
char *start_bracket_replaced_string = yon_char_replace(parameters_string,"[","[\"");
|
|
|
|
|
|
|
|
char *end_bracket_replaced_string = yon_char_replace(start_bracket_replaced_string,"]","\"]");
|
|
|
|
char *end_bracket_replaced_string = yon_char_replace(start_bracket_replaced_string,"]","\"]");
|
|
|
|
char *temp = yon_config_parameter_prepare_command(target[i],NULL,NULL,end_bracket_replaced_string);
|
|
|
|
target[i] = end_bracket_replaced_string;
|
|
|
|
if (!yon_char_is_empty(target[i])) free(target[i]);
|
|
|
|
|
|
|
|
target[i] = temp;
|
|
|
|
|
|
|
|
yon_char_parsed_free(parameters,parameters_size);
|
|
|
|
|
|
|
|
free(parameters_string);
|
|
|
|
|
|
|
|
free(start_bracket_replaced_string);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return success;
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -389,12 +378,6 @@ struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
char *value = yon_char_new(parsed[i]);
|
|
|
|
char *value = yon_char_new(parsed[i]);
|
|
|
|
char *key = yon_char_divide_search(value,"=",-1);
|
|
|
|
char *key = yon_char_divide_search(value,"=",-1);
|
|
|
|
char *section = NULL;
|
|
|
|
|
|
|
|
if (key[0]=='['){
|
|
|
|
|
|
|
|
section = yon_char_divide_search(key," ",-1);
|
|
|
|
|
|
|
|
free(yon_char_divide(section,yon_char_find_last(section,'/')));
|
|
|
|
|
|
|
|
yon_char_remove_last_symbol(section,']');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(value)){
|
|
|
|
if (!yon_char_is_empty(value)){
|
|
|
|
yon_char_remove_brackets(value);
|
|
|
|
yon_char_remove_brackets(value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -404,7 +387,7 @@ struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
|
|
|
|
loaded->first=loaded;
|
|
|
|
loaded->first=loaded;
|
|
|
|
loaded->next=NULL;
|
|
|
|
loaded->next=NULL;
|
|
|
|
loaded->prev=NULL;
|
|
|
|
loaded->prev=NULL;
|
|
|
|
loaded->section=section;
|
|
|
|
loaded->section=NULL;
|
|
|
|
loaded->data=value;
|
|
|
|
loaded->data=value;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
loaded->next = (struct loaded_config*)malloc(sizeof(struct loaded_config));
|
|
|
|
loaded->next = (struct loaded_config*)malloc(sizeof(struct loaded_config));
|
|
|
|
@ -414,7 +397,7 @@ struct loaded_config *yon_config_convert_parameter(config_str parsed, int size){
|
|
|
|
next->key=key;
|
|
|
|
next->key=key;
|
|
|
|
next->first=loaded->first;
|
|
|
|
next->first=loaded->first;
|
|
|
|
next->next=NULL;
|
|
|
|
next->next=NULL;
|
|
|
|
next->section=section;
|
|
|
|
next->section=NULL;
|
|
|
|
next->data=value;
|
|
|
|
next->data=value;
|
|
|
|
loaded=next;
|
|
|
|
loaded=next;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|