|
|
|
@ -390,20 +390,20 @@ char** philos_pars_terminal_systemd_cgls(char* CMD_GET_SLICE_SERVICE, char* str_
|
|
|
|
|
}
|
|
|
|
|
return array_data;
|
|
|
|
|
}
|
|
|
|
|
char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int* array_io, int* array_io_pow_size) {
|
|
|
|
|
char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int* array_io, int* array_io_pow_size, char** disk, int size) {
|
|
|
|
|
char* split_simvol = g_malloc0(sizeof(char)*2);
|
|
|
|
|
int flag_format = 0;
|
|
|
|
|
char* cmd_old = yon_char_new(cmd);
|
|
|
|
|
char* cmd_new = "";
|
|
|
|
|
if (_config->disk && _config->size && array_io && array_io_pow_size) {
|
|
|
|
|
if (disk && size && array_io && array_io_pow_size) {
|
|
|
|
|
int index_find = 0;
|
|
|
|
|
for (int index = 0; index < _config->size; index++) {
|
|
|
|
|
for (int index = 0; index < size; index++) {
|
|
|
|
|
if (array_io_pow_size[index] >= 0 && array_io[index]>= 0) {
|
|
|
|
|
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,
|
|
|
|
|
split_simvol,
|
|
|
|
|
_config->disk[index],
|
|
|
|
|
disk[index],
|
|
|
|
|
num_and_pow_size, NULL);
|
|
|
|
|
split_simvol[0] = ',';
|
|
|
|
|
split_simvol[1] = '\0';
|
|
|
|
@ -431,12 +431,12 @@ char* philos_pard_array_add_cmd(char* cmd, temp_config* _config, char* key, int*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
int philos_check_activ_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
int philos_check_activ_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array) {
|
|
|
|
|
char* disk = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtTempDevice));
|
|
|
|
|
disk = yon_char_divide_search(disk," ", -1);
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
if (disk == NULL || _config->size == 0) {
|
|
|
|
|
if (disk == NULL || (_config->size_read == 0 && flag_check_array == 0) && (_config->size_write == 0 && flag_check_array==1)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
@ -483,28 +483,43 @@ void philos_temp_generate_cmd(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
split_simvol[1] = '\0';
|
|
|
|
|
}
|
|
|
|
|
if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempDevice))!=-1) {
|
|
|
|
|
if (_config->size!=0) {
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOReadBandwidthMax=", _config->i_o_limit_read, _config->i_o_limit_read_size);
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOWriteBandwidthMax=", _config->i_o_limit_write, _config->i_o_limit_write_size);
|
|
|
|
|
if (_config->size_read!=0) {
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOReadBandwidthMax=", _config->i_o_limit_read, _config->i_o_limit_read_size, _config->disk_read, _config->size_read);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (_config->size_write!=0) {
|
|
|
|
|
str_cmd = philos_pard_array_add_cmd(str_cmd, _config, "IOWriteBandwidthMax=", _config->i_o_limit_write, _config->i_o_limit_write_size, _config->disk_write, _config->size_write);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->entryTempCmd), str_cmd);
|
|
|
|
|
free(split_simvol);
|
|
|
|
|
}
|
|
|
|
|
void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
// flag_check_array = 0 READ
|
|
|
|
|
// flag_check_array = 1 WRITE
|
|
|
|
|
void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array) {
|
|
|
|
|
char* disk = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtTempDevice));
|
|
|
|
|
disk = yon_char_divide_search(disk, " ", -1);
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
if (philos_check_activ_disk(widgets, _config) == 0) {
|
|
|
|
|
char** ptr_disk = NULL;
|
|
|
|
|
int size = -1;
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
ptr_disk = _config->disk_read;
|
|
|
|
|
size = _config->size_read;
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
ptr_disk = _config->disk_write;
|
|
|
|
|
size = _config->size_write;
|
|
|
|
|
}
|
|
|
|
|
if (philos_check_activ_disk(widgets, _config, flag_check_array) == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (_config->size) {
|
|
|
|
|
if (size) {
|
|
|
|
|
int index_find = -1;
|
|
|
|
|
if (_config->disk) {
|
|
|
|
|
for (int index = 0; index < _config->size; index++) {
|
|
|
|
|
char* disk_cfg = _config->disk[index];
|
|
|
|
|
if (ptr_disk) {
|
|
|
|
|
for (int index = 0; index < size; index++) {
|
|
|
|
|
char* disk_cfg = ptr_disk[index];
|
|
|
|
|
if (disk_cfg) {
|
|
|
|
|
if (strstr(disk_cfg, disk) != NULL) {
|
|
|
|
|
index_find = index;
|
|
|
|
@ -515,33 +530,50 @@ void philos_temp_del_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ((bool_read == 0 && bool_write == 0 && index_find != -1)) {
|
|
|
|
|
_config->disk = yon_char_parsed_shrink(_config->disk,&_config->size, index_find);
|
|
|
|
|
_config->size++;
|
|
|
|
|
_config->i_o_limit_read_size = remove_element_int_array(_config->i_o_limit_read_size,&_config->size, index_find);
|
|
|
|
|
_config->size++;
|
|
|
|
|
_config->i_o_limit_write_size = remove_element_int_array(_config->i_o_limit_write_size,&_config->size, index_find);
|
|
|
|
|
_config->size++;
|
|
|
|
|
_config->i_o_limit_read = remove_element_int_array(_config->i_o_limit_read,&_config->size, index_find);
|
|
|
|
|
_config->size++;
|
|
|
|
|
_config->i_o_limit_write = remove_element_int_array(_config->i_o_limit_write,&_config->size, index_find);
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (ptr_disk) {
|
|
|
|
|
_config->disk_read = ptr_disk;
|
|
|
|
|
_config->size_read = size;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
if (ptr_disk) {
|
|
|
|
|
_config->disk_write = ptr_disk;
|
|
|
|
|
_config->size_write = size;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void philos_temp_config_init(temp_config* _config) {
|
|
|
|
|
if (_config->size != 0) {
|
|
|
|
|
philos_free_string_array(&_config->disk, _config->size);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_read, _config->size);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_read_size, _config->size);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_write, _config->size);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_write_size, _config->size);
|
|
|
|
|
}
|
|
|
|
|
_config->disk = NULL;
|
|
|
|
|
if (_config->size_read != 0) {
|
|
|
|
|
philos_free_string_array(&_config->disk_read, _config->size_read);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_read, _config->size_read);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_read_size, _config->size_read);
|
|
|
|
|
}
|
|
|
|
|
else if (_config->size_write != 0) {
|
|
|
|
|
philos_free_string_array(&_config->disk_write, _config->size_write);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_write, _config->size_write);
|
|
|
|
|
philos_free_int_array(&_config->i_o_limit_write_size, _config->size_write);
|
|
|
|
|
}
|
|
|
|
|
_config->disk_read = NULL;
|
|
|
|
|
_config->disk_write = NULL;
|
|
|
|
|
_config->i_o_limit_read = NULL;
|
|
|
|
|
_config->i_o_limit_write = NULL;
|
|
|
|
|
_config->i_o_limit_read_size = NULL;
|
|
|
|
|
_config->i_o_limit_write_size = NULL;
|
|
|
|
|
_config->size = 0;
|
|
|
|
|
_config->size_read = 0;
|
|
|
|
|
_config->size_write = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// flag_check_array = 0 READ
|
|
|
|
@ -552,9 +584,23 @@ void philos_update_device_to_entry(temp_set_window *widgets, temp_config* _confi
|
|
|
|
|
disk = yon_char_divide_search(disk, " ", -1);
|
|
|
|
|
if (disk_id != -1) {
|
|
|
|
|
int index_find = -1;
|
|
|
|
|
if (_config->disk) {
|
|
|
|
|
for (int index = 0; index < _config->size; index++) {
|
|
|
|
|
char* disk_cfg = _config->disk[index];
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (_config->disk_read) {
|
|
|
|
|
for (int index = 0; index < _config->size_read; index++) {
|
|
|
|
|
char* disk_cfg = _config->disk_read[index];
|
|
|
|
|
if (disk_cfg) {
|
|
|
|
|
if (strstr(disk_cfg, disk) != NULL) {
|
|
|
|
|
index_find = index;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
if (_config->disk_write) {
|
|
|
|
|
for (int index = 0; index < _config->size_write; index++) {
|
|
|
|
|
char* disk_cfg = _config->disk_write[index];
|
|
|
|
|
if (disk_cfg) {
|
|
|
|
|
if (strstr(disk_cfg, disk) != NULL) {
|
|
|
|
|
index_find = index;
|
|
|
|
@ -563,6 +609,8 @@ void philos_update_device_to_entry(temp_set_window *widgets, temp_config* _confi
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (index_find != -1) {
|
|
|
|
|
if (flag_check_array==0) {
|
|
|
|
@ -617,18 +665,29 @@ void philos_update_device_to_entry(temp_set_window *widgets, temp_config* _confi
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->cbtTempRead), 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
// flag_check_array = 0 READ
|
|
|
|
|
// flag_check_array = 1 WRITE
|
|
|
|
|
void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config, int flag_check_array) {
|
|
|
|
|
char* disk = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->cbtTempDevice));
|
|
|
|
|
disk = yon_char_divide_search(disk, " ", -1);
|
|
|
|
|
int disk_id = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempDevice));
|
|
|
|
|
int bool_read = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead));
|
|
|
|
|
int bool_write = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite));
|
|
|
|
|
if (disk_id >= 0 && _config->size !=0) {
|
|
|
|
|
char** ptr_disk = NULL;
|
|
|
|
|
int size = -1;
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
ptr_disk = _config->disk_read;
|
|
|
|
|
size = _config->size_read;
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
ptr_disk = _config->disk_write;
|
|
|
|
|
size = _config->size_write;
|
|
|
|
|
}
|
|
|
|
|
if (disk_id >= 0 && size !=0) {
|
|
|
|
|
int index_find = -1;
|
|
|
|
|
if (_config->disk){
|
|
|
|
|
for (int index = 0; index < _config->size; index++) {
|
|
|
|
|
char* disk_cfg = _config->disk[index];
|
|
|
|
|
if (ptr_disk){
|
|
|
|
|
for (int index = 0; index < size; index++) {
|
|
|
|
|
char* disk_cfg = ptr_disk[index];
|
|
|
|
|
if (disk_cfg) {
|
|
|
|
|
if (strstr(disk_cfg, disk) != NULL) {
|
|
|
|
|
index_find = index;
|
|
|
|
@ -640,33 +699,33 @@ void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
|
|
|
|
|
if (index_find == -1) {
|
|
|
|
|
// Добавление
|
|
|
|
|
_config->disk = yon_char_parsed_append(_config->disk,&_config->size, disk);
|
|
|
|
|
_config->size--;
|
|
|
|
|
ptr_disk = yon_char_parsed_append(ptr_disk,&size, disk);
|
|
|
|
|
size--;
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&_config->size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&_config->size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&_config->size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&_config->size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
_config->size++;
|
|
|
|
|
size--;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -692,37 +751,50 @@ void philos_temp_add_disk(temp_set_window *widgets, temp_config* _config) {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (bool_read == 1 || bool_write == 1) {
|
|
|
|
|
_config->disk = yon_char_parsed_append(_config->disk,&_config->size, disk);
|
|
|
|
|
_config->size--;
|
|
|
|
|
ptr_disk = yon_char_parsed_append(ptr_disk,&size, disk);
|
|
|
|
|
size--;
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempRead))) {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&_config->size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&_config->size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempRead)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_read_size = philos_int_append(_config->i_o_limit_read_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_read = philos_int_append(_config->i_o_limit_read,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->chbTempWrite))) {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&_config->size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&_config->size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,(int)gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->cbtTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinTempWrite)));
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&_config->size,-3);
|
|
|
|
|
_config->size--;
|
|
|
|
|
_config->i_o_limit_write_size = philos_int_append(_config->i_o_limit_write_size,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
_config->i_o_limit_write = philos_int_append(_config->i_o_limit_write,&size,-3);
|
|
|
|
|
size--;
|
|
|
|
|
}
|
|
|
|
|
_config->size++;
|
|
|
|
|
size++;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (flag_check_array == 0) {
|
|
|
|
|
if (ptr_disk) {
|
|
|
|
|
_config->disk_read = ptr_disk;
|
|
|
|
|
_config->size_read = size;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array == 1) {
|
|
|
|
|
if (ptr_disk) {
|
|
|
|
|
_config->disk_write = ptr_disk;
|
|
|
|
|
_config->size_write = size;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int* philos_int_append(int* array, int* size, int value) {
|
|
|
|
|
array = yon_remalloc(array, (*size+1)*sizeof(int));
|
|
|
|
|