|
|
|
|
@ -604,27 +604,32 @@ char **yon_char_parse(char *parameters, int *size, char *divider){
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char **yon_char_parsed_rip(char **char_string, int *size, int item_to_delete){
|
|
|
|
|
if (char_string&&(*size)>0&&(*size)>item_to_delete&&item_to_delete>=0){
|
|
|
|
|
char **new_char_parsed=NULL;
|
|
|
|
|
new_char_parsed=malloc(sizeof(char*)*((*size)-1));
|
|
|
|
|
int flag = 0;
|
|
|
|
|
for (int i=0;i < (*size);i++){
|
|
|
|
|
if (i==item_to_delete) {
|
|
|
|
|
flag = 1;
|
|
|
|
|
}
|
|
|
|
|
if (flag == 0) {
|
|
|
|
|
new_char_parsed[i]=yon_char_new(char_string[i]);
|
|
|
|
|
char **yon_char_parsed_rip(char **char_string, int *size, int item_to_delete) {
|
|
|
|
|
if (char_string && size && (*size) > 0 && (*size) > item_to_delete && item_to_delete >= 0) {
|
|
|
|
|
char **new_char_parsed = malloc(sizeof(char*) * ((*size) - 1));
|
|
|
|
|
if (!new_char_parsed) {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
else if (flag == 1 && i!=item_to_delete) {
|
|
|
|
|
new_char_parsed[i-1]=yon_char_new(char_string[i]);
|
|
|
|
|
|
|
|
|
|
int new_index = 0;
|
|
|
|
|
for (int i = 0; i < (*size); i++) {
|
|
|
|
|
if (i != item_to_delete) {
|
|
|
|
|
new_char_parsed[new_index] = yon_char_new(char_string[i]);
|
|
|
|
|
new_index++;
|
|
|
|
|
} else {
|
|
|
|
|
free(char_string[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
(*size)=(*size)-1;
|
|
|
|
|
|
|
|
|
|
free(char_string);
|
|
|
|
|
(*size) = (*size) - 1;
|
|
|
|
|
return new_char_parsed;
|
|
|
|
|
} else return NULL;
|
|
|
|
|
} else {
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int yon_char_parsed_check_exist(char **parameters, int size, char *param){
|
|
|
|
|
if (parameters){
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
@ -1192,8 +1197,16 @@ int yon_config_parse_parameter(char *parameter,char **key, char **value){
|
|
|
|
|
|
|
|
|
|
int yon_char_remove_brackets(char *string){
|
|
|
|
|
int done=0;
|
|
|
|
|
if (string[0]=='\''||string[0]=='\"'){done=1; free(yon_char_divide(string,0));}
|
|
|
|
|
if (string[strlen(string)-1]=='\''||string[strlen(string)-1]=='\"') {done=1; string[strlen(string)-1] = '\0';}
|
|
|
|
|
if (strlen(string)>2){
|
|
|
|
|
if (string[0]=='\''||string[0]=='\"'){
|
|
|
|
|
done=1;
|
|
|
|
|
free(yon_char_divide(string,0));}
|
|
|
|
|
if (string[strlen(string)-1]=='\''||
|
|
|
|
|
string[strlen(string)-1]=='\"') {
|
|
|
|
|
done=1;
|
|
|
|
|
string[strlen(string)-1] = '\0';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return done;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|