|
|
|
|
@ -121,14 +121,14 @@ int yon_char_check_element(char *target, char *element, char *divider){
|
|
|
|
|
char *yon_char_swap_element(const char *source, const char *a, const char *b, const char *divider){
|
|
|
|
|
if (yon_char_is_empty(source)||yon_char_is_empty(a)||yon_char_is_empty(b)) return 0;
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(source,&size,divider);
|
|
|
|
|
int found_a = yon_char_parsed_check_exist(parsed,size,a);
|
|
|
|
|
int found_b = yon_char_parsed_check_exist(parsed,size,b);
|
|
|
|
|
config_str parsed = yon_char_parse(source,&size,(char*)divider);
|
|
|
|
|
int found_a = yon_char_parsed_check_exist(parsed,size,(char*)a);
|
|
|
|
|
int found_b = yon_char_parsed_check_exist(parsed,size,(char*)b);
|
|
|
|
|
if (found_a>-1&&found_b>-1){
|
|
|
|
|
char *temp = parsed[found_a];
|
|
|
|
|
parsed[found_a] = parsed[found_b];
|
|
|
|
|
parsed[found_b] = temp;
|
|
|
|
|
char *full = yon_char_parsed_to_string(parsed,size,divider);
|
|
|
|
|
char *full = yon_char_parsed_to_string(parsed,size,(char*)divider);
|
|
|
|
|
yon_char_parsed_free(parsed,size);
|
|
|
|
|
return full;
|
|
|
|
|
}
|
|
|
|
|
|