|
|
|
|
@ -774,114 +774,6 @@ enum YON_CONFIG_SAVED_TYPE yon_config_register_default(char *key,char *config_lo
|
|
|
|
|
return save_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// void yon_config_register_default(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;
|
|
|
|
|
// if (data){
|
|
|
|
|
// if (!__yon__config__default__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key))){
|
|
|
|
|
// {
|
|
|
|
|
// if (__yon__config__default__strings){
|
|
|
|
|
// char *data_copy = yon_char_new(data);
|
|
|
|
|
// yon_config_parameter* dict=NULL;
|
|
|
|
|
// for_dictionaries(dict,__yon__config__default__strings){
|
|
|
|
|
// if (!dict->next){
|
|
|
|
|
// __yon__config__default__strings=dict;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// __yon__config__default__strings=yon_config_parameter_append_with_data(__yon__config__default__strings,key,data_copy);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// char *data_copy = yon_char_new(data);
|
|
|
|
|
// __yon__config__strings=yon_config_parameter_new_with_data(key,yon_char_new(data));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// __yon__config__default__strings = (yon_config_parameter*)yon_dictionary_get_last((dictionary*)__yon__config__default__strings);
|
|
|
|
|
// __yon__config__default__strings->flag1=1;
|
|
|
|
|
// __yon__config__default__strings->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
// __yon__config__default__strings->load_command=config_load;
|
|
|
|
|
// int size=0;
|
|
|
|
|
// config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
// __yon__config__default__strings->section=yon_char_new(section[yon_char_parsed_check_exist(section,size,"get")+1]);
|
|
|
|
|
// yon_char_parsed_free(section,size);
|
|
|
|
|
// }
|
|
|
|
|
// else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__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__default__strings->data&&strcmp(__yon__config__default__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_config_ignored = yon_dictionary_rip(__yon_config_ignored);
|
|
|
|
|
// }
|
|
|
|
|
// int size=0;
|
|
|
|
|
// 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&&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__default__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[yon_char_parsed_check_exist(section,size,"get")+1]);
|
|
|
|
|
// yon_char_parsed_free(section,size);
|
|
|
|
|
// } else {
|
|
|
|
|
// if (!__yon__config__default__strings||!(current=(yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key))){
|
|
|
|
|
// {
|
|
|
|
|
// if (__yon__config__default__strings){
|
|
|
|
|
// yon_config_parameter* dict=NULL;
|
|
|
|
|
// for_dictionaries(dict,__yon__config__default__strings){
|
|
|
|
|
// if (!dict->next){
|
|
|
|
|
// __yon__config__default__strings=dict;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// __yon__config__default__strings=yon_config_parameter_append_with_data(__yon__config__default__strings,key,NULL);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// __yon__config__default__strings=yon_config_parameter_new_with_data(key,NULL);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// yon_config_set_ignore(key);
|
|
|
|
|
// __yon__config__default__strings = (yon_config_parameter*)yon_dictionary_get_last((dictionary*)__yon__config__default__strings);
|
|
|
|
|
// __yon__config__default__strings->flag1=0;
|
|
|
|
|
// __yon__config__default__strings->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
// __yon__config__default__strings->load_command=config_load;
|
|
|
|
|
// int size=0;
|
|
|
|
|
// config_str section = yon_char_parse(config_load,&size," ");
|
|
|
|
|
// __yon__config__default__strings->section=yon_char_new(section[yon_char_parsed_check_exist(section,size,"get")+1]);
|
|
|
|
|
// yon_char_parsed_free(section,size);
|
|
|
|
|
// }
|
|
|
|
|
// else if ((current = (yon_config_parameter*)yon_dictionary_get((dictionary**)&__yon__config__default__strings,key))){
|
|
|
|
|
// if ((current->data&&data!=__yon__config__default__strings->data&&strcmp(__yon__config__default__strings->data,data))||!current->data){
|
|
|
|
|
// yon_config_set_ignore(key);
|
|
|
|
|
|
|
|
|
|
// current->data=NULL;
|
|
|
|
|
// current->flag1=0;
|
|
|
|
|
// current->data_type=DICTIONARY_CHAR_TYPE;
|
|
|
|
|
// current->load_command=config_load;
|
|
|
|
|
// if (yon_dictionary_get(&__yon_config_ignored, current->key)){
|
|
|
|
|
// __yon_config_ignored= yon_dictionary_rip(__yon_config_ignored);
|
|
|
|
|
// }
|
|
|
|
|
// int size=0;
|
|
|
|
|
// 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);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
config_str yon_config_load(char *command, int *str_len){
|
|
|
|
|
FILE *output = popen(command, "r");
|
|
|
|
|
|