netstar pushed a commit to branch master. http://git.enlightenment.org/apps/evisum.git/commit/?id=ce200bf65fb9c55f89879ce7af3fe8e7a088cf79
commit ce200bf65fb9c55f89879ce7af3fe8e7a088cf79 Author: Alastair Poole <nets...@gmail.com> Date: Wed Jun 17 23:04:52 2020 +0100 filesystems: fix naming --- src/bin/system/filesystems.c | 26 +++++++++++++------------- src/bin/system/filesystems.h | 16 ++++++++-------- src/bin/ui/ui.c | 2 +- src/bin/ui/ui_disk.c | 10 +++++----- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/bin/system/filesystems.c b/src/bin/system/filesystems.c index c45cb32..e289131 100644 --- a/src/bin/system/filesystems.c +++ b/src/bin/system/filesystems.c @@ -108,7 +108,7 @@ static _magic _magique[] = { }; unsigned int -filesystem_id_by_name(const char *name) +file_system_id_by_name(const char *name) { size_t n = sizeof(_magique) / sizeof(_magic); for (int i = 0; i < n; i++) @@ -120,7 +120,7 @@ filesystem_id_by_name(const char *name) } const char * -filesystem_name_by_id(unsigned int id) +file_system_name_by_id(unsigned int id) { size_t n = sizeof(_magique) / sizeof(_magic); for (int i = 0; i < n; i++) @@ -133,7 +133,7 @@ filesystem_name_by_id(unsigned int id) #if defined(__linux__) static char * -filesystem_type_name(const char *mountpoint) +file_system_type_name(const char *mountpoint) { FILE *f; char *mount, *res, *type, *end; @@ -166,10 +166,10 @@ filesystem_type_name(const char *mountpoint) #endif -Filesystem_Info * -filesystem_info_get(const char *path) +File_System * +file_system_info_get(const char *path) { - Filesystem_Info *fs; + File_System *fs; const char *mountpoint; struct statfs stats; @@ -179,7 +179,7 @@ filesystem_info_get(const char *path) if (statfs(mountpoint, &stats) < 0) return NULL; - fs = calloc(1, sizeof(Filesystem_Info)); + fs = calloc(1, sizeof(File_System)); fs->mount = strdup(mountpoint); fs->path = strdup(path); @@ -189,7 +189,7 @@ filesystem_info_get(const char *path) #endif #if defined(__linux__) - fs->type_name = filesystem_type_name(fs->mount); + fs->type_name = file_system_type_name(fs->mount); #else fs->type_name = strdup(stats.f_fstypename); #endif @@ -201,7 +201,7 @@ filesystem_info_get(const char *path) } void -filesystem_info_free(Filesystem_Info *fs) +file_system_info_free(File_System *fs) { free(fs->mount); free(fs->path); @@ -211,7 +211,7 @@ filesystem_info_free(Filesystem_Info *fs) } Eina_Bool -filesystem_in_use(const char *name) +file_system_in_use(const char *name) { Eina_List *disks; char *path; @@ -221,13 +221,13 @@ filesystem_in_use(const char *name) disks = disks_get(); EINA_LIST_FREE(disks, path) { - Filesystem_Info *fs = filesystem_info_get(path); + File_System *fs = file_system_info_get(path); if (fs) { - if (fs->type == filesystem_id_by_name(name)) + if (fs->type == file_system_id_by_name(name)) fs_mounted = EINA_TRUE; - filesystem_info_free(fs); + file_system_info_free(fs); } free(path); } diff --git a/src/bin/system/filesystems.h b/src/bin/system/filesystems.h index e0f0d18..a7d8c9f 100644 --- a/src/bin/system/filesystems.h +++ b/src/bin/system/filesystems.h @@ -8,27 +8,27 @@ typedef struct { unsigned long long used; } _Usage; -typedef struct _Filesystem_Info { +typedef struct _File_System { char *path; char *mount; char *type_name; unsigned int type; _Usage usage; -} Filesystem_Info; +} File_System; const char * -filesystem_name_by_id(unsigned int id); +file_system_name_by_id(unsigned int id); unsigned int -filesystem_id_by_name(const char *name); +file_system_id_by_name(const char *name); -Filesystem_Info * -filesystem_info_get(const char *path); +File_System * +file_system_info_get(const char *path); void -filesystem_info_free(Filesystem_Info *fs); +file_system_info_free(File_System *fs); Eina_Bool -filesystem_in_use(const char *name); +file_system_in_use(const char *name); #endif diff --git a/src/bin/ui/ui.c b/src/bin/ui/ui.c index c99ce49..c0915fb 100644 --- a/src/bin/ui/ui.c +++ b/src/bin/ui/ui.c @@ -1646,7 +1646,7 @@ _ui_init(Evas_Object *parent) ui->cpu_list = NULL; // Only take account of the ZFS ARC if there is an active mount. - ui->zfs_mounted = filesystem_in_use("ZFS"); + ui->zfs_mounted = file_system_in_use("ZFS"); _ui = NULL; _evisum_config = NULL; diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c index d6b5f6c..ef86a4a 100644 --- a/src/bin/ui/ui_disk.c +++ b/src/bin/ui/ui_disk.c @@ -38,7 +38,7 @@ ui_tab_disk_add(Ui *ui) } static void -_ui_disk_add(Ui *ui, Filesystem_Info *inf) +_ui_disk_add(Ui *ui, File_System *inf) { Evas_Object *box, *frame, *pb, *label; const char *type; @@ -46,7 +46,7 @@ _ui_disk_add(Ui *ui, Filesystem_Info *inf) type = inf->type_name; if (!type) - type = filesystem_name_by_id(inf->type); + type = file_system_name_by_id(inf->type); if (!type) type = "unknown"; box = elm_box_add(ui->disk_activity); @@ -107,17 +107,17 @@ ui_tab_disk_update(Ui *ui) disks = disks_get(); EINA_LIST_FREE(disks, path) { - Filesystem_Info *fs = filesystem_info_get(path); + File_System *fs = file_system_info_get(path); if (fs) { // ZFS usage may have changed during application's lifetime. // Keep track of ZFS mounts else we may report bogus use // of memory. - if (fs->type == filesystem_id_by_name("ZFS")) + if (fs->type == file_system_id_by_name("ZFS")) zfs_mounted = EINA_TRUE; _ui_disk_add(ui, fs); - filesystem_info_free(fs); + file_system_info_free(fs); } free(path); } --