|
|
|
@ -14,84 +14,83 @@ void philos_set_pow_size_memory(char* str_find, int** array_size,int index, char
|
|
|
|
|
char* STR_TB = array_size_pow[3];
|
|
|
|
|
size_t length = strlen(str_find);
|
|
|
|
|
if (strstr(str_find,"K") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, 0);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,0);
|
|
|
|
|
}
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
str_find = yon_char_unite(str_find, " ", STR_KB, NULL);
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"M") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,1);
|
|
|
|
|
}
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_MB, NULL);
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"G") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, 2);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,2);
|
|
|
|
|
}
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_GB, NULL);
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"T") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, 3);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,3);
|
|
|
|
|
}
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_TB, NULL);
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"%%") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, -1);
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,-1);
|
|
|
|
|
else if (strstr(str_find,"-") != NULL) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, -1);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void philos_set_pow_size_memory_device(char* str_find, int** array_size,int index, char** array_size_pow) {
|
|
|
|
|
char* STR_KB = array_size_pow[0];
|
|
|
|
|
char* STR_MB = array_size_pow[1];
|
|
|
|
|
char* STR_GB = array_size_pow[2];
|
|
|
|
|
char* STR_TB = array_size_pow[3];
|
|
|
|
|
size_t length = strlen(str_find);
|
|
|
|
|
if (strstr(str_find,"K") != NULL) {
|
|
|
|
|
(*array_size)[index] = 0;
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
str_find = yon_char_unite(str_find, " ", STR_KB, NULL);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"M") != NULL) {
|
|
|
|
|
(*array_size)[index] = 1;
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_MB, NULL);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"-") != NULL) {
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
*array_size = philos_int_append(*array_size, &index, -1);
|
|
|
|
|
else if (strstr(str_find,"G") != NULL) {
|
|
|
|
|
(*array_size)[index] = 2;
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_GB, NULL);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
philos_array_int_pars_to(array_size,-1);
|
|
|
|
|
else if (strstr(str_find,"T") != NULL) {
|
|
|
|
|
(*array_size)[index] = 3;
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
|
|
|
|
|
str_find = yon_char_unite(str_find," ", STR_TB, NULL);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
if (index!=-1) {
|
|
|
|
|
else if (strstr(str_find,"%%") != NULL) {
|
|
|
|
|
(*array_size)[index] = -1;
|
|
|
|
|
str_find = yon_char_divide(str_find, length-1);
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
else if (strstr(str_find,"-") != NULL) {
|
|
|
|
|
(*array_size)[index] = -1;
|
|
|
|
|
index--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void philos_set_size_memory_integer_char(char* str_find, char*** array_data, int index) {
|
|
|
|
|
char* simv_del_array[10] = {"K","M","G","T","k","m","g","t"," ","%"};
|
|
|
|
|
for (size_t i = 0; i < 10; i++) {
|
|
|
|
@ -324,8 +323,11 @@ char* philos_format_cfg_str_size_memory(char* str_key, int value, int pow_size_m
|
|
|
|
|
else if (pow_size_memory== -1) {
|
|
|
|
|
return yon_char_unite(str_key, str_value, "%" ,NULL);
|
|
|
|
|
}
|
|
|
|
|
else if (pow_size_memory== -3) {
|
|
|
|
|
return yon_char_new("-");
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
return yon_char_unite(str_key, str_value, "-" ,NULL);
|
|
|
|
|
return yon_char_new("-");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -398,7 +400,7 @@ char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int*
|
|
|
|
|
if (disk && size && array_io && array_io_pow_size) {
|
|
|
|
|
int index_find = 0;
|
|
|
|
|
for (int index = 0; index < size; index++) {
|
|
|
|
|
if (array_io_pow_size[index] >= 0 && array_io[index]>= 0) {
|
|
|
|
|
if (array_io_pow_size[index] >= 0 && array_io[index]>= 0 && !strstr(disk[index], "-")) {
|
|
|
|
|
char* num_and_pow_size = philos_format_cfg_str_size_memory(" ", array_io[index], array_io_pow_size[index]);
|
|
|
|
|
if (!strstr(num_and_pow_size, "-")) {
|
|
|
|
|
cmd_new = yon_char_unite(cmd_new,
|
|
|
|
@ -532,15 +534,11 @@ void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config, int fl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((bool_read == 0 && bool_write == 0 && index_find != -1)) {
|
|
|
|
|
ptr_disk = yon_char_parsed_shrink(ptr_disk,&size, index_find);
|
|
|
|
|
size++;
|
|
|
|
|
_config->i_o_limit_read_size = remove_element_int_array(_config->i_o_limit_read_size,&size, index_find);
|
|
|
|
|
size++;
|
|
|
|
|
_config->i_o_limit_write_size = remove_element_int_array(_config->i_o_limit_write_size,&size, index_find);
|
|
|
|
|
size++;
|
|
|
|
|
_config->i_o_limit_read = remove_element_int_array(_config->i_o_limit_read,&size, index_find);
|
|
|
|
|
size++;
|
|
|
|
|
_config->i_o_limit_write = remove_element_int_array(_config->i_o_limit_write,&size, index_find);
|
|
|
|
|
ptr_disk[index_find] = yon_char_new("-");
|
|
|
|
|
_config->i_o_limit_read_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_write_size[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_read[index_find] = -3;
|
|
|
|
|
_config->i_o_limit_write[index_find] = -3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|