|
|
|
|
@ -1037,6 +1037,17 @@ char *yon_config_get_type_path(YON_CONFIG_TYPE type){
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *yon_config_get_all_info(){
|
|
|
|
|
check_config{
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_config_get_all(&size);
|
|
|
|
|
char *full = yon_char_parsed_to_string(parsed,size,"\n");
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
return full;
|
|
|
|
|
}
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_parameter_set_load_command(char *key, char *command){
|
|
|
|
|
dictionary *found = yon_dictionary_get((dictionary**)&__yon__config__strings,key);
|
|
|
|
|
if (found){
|
|
|
|
|
@ -1225,6 +1236,10 @@ int yon_config_load_config(YON_CONFIG_TYPE config_type, ...){
|
|
|
|
|
for (int i=0;i<command_size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
config_str parsed = yon_config_load(command[i],&parsed_size);
|
|
|
|
|
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_char_parsed_free(command_parsed,command_parsed_size);
|
|
|
|
|
if (parsed_size>0){
|
|
|
|
|
for (int j=0;j<parsed_size;j++){
|
|
|
|
|
if (!yon_char_is_empty(parsed[j])&&strcmp(parsed[j],"(null)\n")){
|
|
|
|
|
@ -1561,7 +1576,7 @@ void yon_config_register(char *key, char *config_load, void *data){
|
|
|
|
|
yon_char_parsed_free(section,size);
|
|
|
|
|
}
|
|
|
|
|
else if (yon_dictionary_get((dictionary**)&__yon__config__strings,key)){
|
|
|
|
|
if (data!=__yon__config__strings->data&&strcmp(__yon__config__strings->data,data)){
|
|
|
|
|
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;
|
|
|
|
|
@ -2186,16 +2201,6 @@ void yon_launch(char *command)
|
|
|
|
|
|
|
|
|
|
// // Trash collector functions
|
|
|
|
|
|
|
|
|
|
// typedef struct yon_trash_collector_group{
|
|
|
|
|
|
|
|
|
|
// char *group_key;
|
|
|
|
|
// void *data;
|
|
|
|
|
// struct yon_trash_collector_group *next;
|
|
|
|
|
// struct yon_trash_collector_group *prev;
|
|
|
|
|
// struct yon_trash_collector_group *first;
|
|
|
|
|
|
|
|
|
|
// } yon_trash_collector_group;
|
|
|
|
|
|
|
|
|
|
// typedef struct yon_trash_collector_element{
|
|
|
|
|
// char *key;
|
|
|
|
|
// void *data;
|
|
|
|
|
@ -2205,6 +2210,16 @@ void yon_launch(char *command)
|
|
|
|
|
|
|
|
|
|
// } yon_trash_collector_element;
|
|
|
|
|
|
|
|
|
|
// typedef struct yon_trash_collector_group{
|
|
|
|
|
|
|
|
|
|
// char *group_key;
|
|
|
|
|
// yon_trash_collector_element *data;
|
|
|
|
|
// struct yon_trash_collector_group *next;
|
|
|
|
|
// struct yon_trash_collector_group *prev;
|
|
|
|
|
// struct yon_trash_collector_group *first;
|
|
|
|
|
// } yon_trash_collector_group;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// yon_trash_collector_group *__yon_trash_collector__ = NULL;
|
|
|
|
|
|
|
|
|
|
// #define check_trash if (__yon_trash_collector__)
|
|
|
|
|
@ -2212,6 +2227,43 @@ void yon_launch(char *command)
|
|
|
|
|
// #define for_trash_group for(yon_trash_collector_group *gr = __yon_trash_collector__->first;gr;gr=gr->next)
|
|
|
|
|
// #define for_trash_element(group) for (yon_trash_collector_element *gr = group->first; gr;gr=gr->next)
|
|
|
|
|
|
|
|
|
|
// #define yon_malloc_reg(size,key,group) yon_var_create_register(size,key,group)
|
|
|
|
|
|
|
|
|
|
// yon_trash_collector_group *yon_trash_collector_group_new(){
|
|
|
|
|
// yon_trash_collector_group *group = malloc(sizeof(yon_trash_collector_group));
|
|
|
|
|
// group->data=NULL;
|
|
|
|
|
// group->first=group;
|
|
|
|
|
// group->group_key=NULL;
|
|
|
|
|
// group->next=NULL;
|
|
|
|
|
// group->prev=NULL;
|
|
|
|
|
// return group;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// int yon_trash_collector_element_register(yon_trash_collector_element *element,char *group){
|
|
|
|
|
// if (!element||yon_char_is_empty(element->key)||yon_char_is_empty(group))
|
|
|
|
|
// return 0;
|
|
|
|
|
// check_trash{
|
|
|
|
|
// if (yon_dictionary_get((dictionary**)&__yon_trash_collector__,group)){
|
|
|
|
|
// if (yon_dictionary_get((dictionary**)&__yon_trash_collector__->data,element->key));
|
|
|
|
|
// } else {
|
|
|
|
|
// yon_trash_collector_group *last = (yon_trash_collector_group*)yon_dictionary_get_last((dictionary*)__yon_trash_collector__);
|
|
|
|
|
// __yon_trash_collector__->next = yon_trash_collector_group_new();
|
|
|
|
|
// __yon_trash_collector__->next->prev=__yon_trash_collector__;
|
|
|
|
|
// __yon_trash_collector__->next->first=__yon_trash_collector__->first;
|
|
|
|
|
// __yon_trash_collector__->next->data=element;
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// __yon_trash_collector__ = yon_trash_collector_group_new();
|
|
|
|
|
// __yon_trash_collector__->data=element;
|
|
|
|
|
// }
|
|
|
|
|
// return 1;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void *yon_var_create_register(int size,char *key,char*group){
|
|
|
|
|
// void *allocated = malloc(size);
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// yon_trash_collector_element *yon_trash_collector_element_get(void *pointer,yon_trash_collector_group *group){
|
|
|
|
|
// for_trash_element(group){
|
|
|
|
|
// if (gr->data==pointer)
|
|
|
|
|
|