|
|
|
@ -1,5 +1,18 @@
|
|
|
|
|
#include "model.h"
|
|
|
|
|
|
|
|
|
|
size_t check_null(size_t num) {
|
|
|
|
|
if (num == 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
return num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char* check_null_to_str(size_t num) {
|
|
|
|
|
if (num == 0) {
|
|
|
|
|
return yon_char_new("-");
|
|
|
|
|
}
|
|
|
|
|
return philos_char_from_size_t(num);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void model_clear_cfg(config_u_g_p* _config) {
|
|
|
|
|
free(_config->quota);
|
|
|
|
@ -90,12 +103,12 @@ int fill_tree_view_project(config_all* all_config,hotebook* widget , char* str_f
|
|
|
|
|
1,format_actors(&_config->actors),
|
|
|
|
|
2,_config->quota,
|
|
|
|
|
3,_config->size_memory,
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
|
|
|
|
|
5,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
|
|
|
|
|
5,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
|
|
|
|
|
6,deferring_size,
|
|
|
|
|
7,_config->files,
|
|
|
|
|
8,yon_char_from_int(_config->soft_restriction_file),
|
|
|
|
|
9,yon_char_from_int(_config->severe_limitation_file),
|
|
|
|
|
8,check_null_to_str(_config->soft_restriction_file),
|
|
|
|
|
9,check_null_to_str(_config->severe_limitation_file),
|
|
|
|
|
10,deferring_file,
|
|
|
|
|
-1);
|
|
|
|
|
|
|
|
|
@ -135,12 +148,12 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
|
|
|
|
|
0,format_actors(&_config->actors),
|
|
|
|
|
1,_config->quota,
|
|
|
|
|
2,_config->size_memory,
|
|
|
|
|
3,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
|
|
|
|
|
3,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
|
|
|
|
|
4,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
|
|
|
|
|
5,deferring_size,
|
|
|
|
|
6,_config->files,
|
|
|
|
|
7,yon_char_from_int(_config->soft_restriction_file),
|
|
|
|
|
8,yon_char_from_int(_config->severe_limitation_file),
|
|
|
|
|
7,check_null_to_str(_config->soft_restriction_file),
|
|
|
|
|
8,check_null_to_str(_config->severe_limitation_file),
|
|
|
|
|
9,deferring_file,
|
|
|
|
|
-1);
|
|
|
|
|
}
|
|
|
|
@ -154,7 +167,7 @@ int fill_tree_view_user_group(config_all* all_config, char* disk, hotebook* widg
|
|
|
|
|
|
|
|
|
|
char* wrapper_str_time(size_t seconds) {
|
|
|
|
|
me_time t;
|
|
|
|
|
if (seconds!=-1) {
|
|
|
|
|
if (seconds>0) {
|
|
|
|
|
t = time_convert(seconds);
|
|
|
|
|
t.str_time = yon_char_unite(yon_char_from_int(t.weeks),WEEKS,
|
|
|
|
|
yon_char_from_int(t.days), DAYS,
|
|
|
|
@ -226,11 +239,11 @@ int fill_tree_view_generate(vector* vec_fill, vector* vec_status_disk, char* str
|
|
|
|
|
0,pars_status_generate(vec_status_disk,_config->UNIX_file),
|
|
|
|
|
1,quota_type(str_fill),
|
|
|
|
|
2,_config->UNIX_file,
|
|
|
|
|
6,philos_format_cfg_str_size_memory("", _config->soft_restriction_size,_config->soft_restriction_size_pow),
|
|
|
|
|
7,philos_format_cfg_str_size_memory("", _config->severe_limitation_size,_config->severe_limitation_size_pow),
|
|
|
|
|
6,philos_format_cfg_str_size_memory("", check_null(_config->soft_restriction_size),_config->soft_restriction_size_pow),
|
|
|
|
|
7,philos_format_cfg_str_size_memory("", check_null(_config->severe_limitation_size),_config->severe_limitation_size_pow),
|
|
|
|
|
8,deferring_size,
|
|
|
|
|
9,yon_char_from_int(_config->soft_restriction_file),
|
|
|
|
|
10,yon_char_from_int(_config->severe_limitation_file),
|
|
|
|
|
9,check_null_to_str(_config->soft_restriction_file),
|
|
|
|
|
10,check_null_to_str(_config->severe_limitation_file),
|
|
|
|
|
11,deferring_file,
|
|
|
|
|
-1);
|
|
|
|
|
}
|
|
|
|
@ -239,3 +252,4 @@ int fill_tree_view_generate(vector* vec_fill, vector* vec_status_disk, char* str
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|