|
|
|
@ -737,8 +737,7 @@ config_str yon_char_parsed_merge(config_str array1, int size1, config_str array2
|
|
|
|
*final_size=0;
|
|
|
|
*final_size=0;
|
|
|
|
config_str parsed_final = yon_char_parsed_new(final_size,array1[0],NULL);
|
|
|
|
config_str parsed_final = yon_char_parsed_new(final_size,array1[0],NULL);
|
|
|
|
for (int i=1;i<size1;i++){
|
|
|
|
for (int i=1;i<size1;i++){
|
|
|
|
int new_size=0;
|
|
|
|
parsed_final = yon_char_parsed_append(parsed_final,final_size,array1[i]);
|
|
|
|
parsed_final = yon_char_parsed_append(parsed_final,&new_size,array1[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (int i=0;i<size2;i++){
|
|
|
|
for (int i=0;i<size2;i++){
|
|
|
|
parsed_final = yon_char_parsed_append(parsed_final,final_size,array2[i]);
|
|
|
|
parsed_final = yon_char_parsed_append(parsed_final,final_size,array2[i]);
|
|
|
|
@ -918,8 +917,9 @@ config_str yon_dir_get_contents(char *dir_path, int *size){
|
|
|
|
DIR *directory = opendir(dir_path);
|
|
|
|
DIR *directory = opendir(dir_path);
|
|
|
|
struct dirent *de;
|
|
|
|
struct dirent *de;
|
|
|
|
while ((de = readdir(directory))){
|
|
|
|
while ((de = readdir(directory))){
|
|
|
|
if (dir) dir = yon_char_parsed_append(dir,size,yon_char_new(de->d_name));
|
|
|
|
if (dir){ dir = yon_char_parsed_append(dir,size,yon_char_new(de->d_name));
|
|
|
|
else dir = yon_char_parsed_new(size,yon_char_new(de->d_name),NULL);
|
|
|
|
free(de);
|
|
|
|
|
|
|
|
} else dir = yon_char_parsed_new(size,yon_char_new(de->d_name),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
closedir(directory);
|
|
|
|
closedir(directory);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1555,6 +1555,7 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
key=yon_char_new(key);
|
|
|
|
key=yon_char_new(key);
|
|
|
|
config_load=yon_char_new(config_load);
|
|
|
|
config_load=yon_char_new(config_load);
|
|
|
|
yon_config_parameter *current = NULL;
|
|
|
|
yon_config_parameter *current = NULL;
|
|
|
|
|
|
|
|
if (data){
|
|
|
|
if (!__yon__config__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))){
|
|
|
|
if (!__yon__config__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))){
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (__yon__config__strings){
|
|
|
|
if (__yon__config__strings){
|
|
|
|
@ -1597,6 +1598,16 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__strings,key))) {
|
|
|
|
|
|
|
|
current->data=NULL;
|
|
|
|
|
|
|
|
current->flag1=0;
|
|
|
|
|
|
|
|
current->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
|
|
|
current->load_command=config_load;
|
|
|
|
|
|
|
|
int size=0;
|
|
|
|
|
|
|
|
config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
|
|
|
current->section=yon_char_new(section[4]);
|
|
|
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
config_str yon_config_load(char *command, int *str_len){
|
|
|
|
config_str yon_config_load(char *command, int *str_len){
|
|
|
|
@ -2073,6 +2084,7 @@ config_str yon_file_open(char *file_path, int *size){
|
|
|
|
while (fgets(str_loaded,4098,file)){
|
|
|
|
while (fgets(str_loaded,4098,file)){
|
|
|
|
final_string = final_string ? yon_char_parsed_append(final_string,size,str_loaded) : yon_char_parsed_new(size,str_loaded,NULL);
|
|
|
|
final_string = final_string ? yon_char_parsed_append(final_string,size,str_loaded) : yon_char_parsed_new(size,str_loaded,NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fclose(file);
|
|
|
|
return final_string;
|
|
|
|
return final_string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|