Revert "Revert "Code clean up and add example""

This reverts commit ea08151ae6.
This commit is contained in:
James Dominic P. Guana
2021-04-10 18:20:21 +08:00
committed by Robert Roth
parent 48595809ed
commit 2ec1815e6c
21 changed files with 238 additions and 20 deletions

View File

@@ -2,7 +2,7 @@ glibtopdir = $(includedir)/libgtop-2.0/glibtop
glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
sem_limits.h uptime.h command.h mem.h proclist.h \
proctime.h shm_limits.h cpu.h msg_limits.h \
proctime.h shm_limits.h cpu.h disk.h msg_limits.h \
procmem.h procuid.h swap.h \
procsegment.h sysdeps.h global.h \
procsignal.h union.h gnuserv.h \

View File

@@ -60,8 +60,9 @@ G_BEGIN_DECLS
#define GLIBTOP_CMND_PROC_WD 26
#define GLIBTOP_CMND_PROC_AFFINITY 27
#define GLIBTOP_CMND_PROC_IO 28
#define GLIBTOP_CMND_DISK 29
#define GLIBTOP_MAX_CMND 29
#define GLIBTOP_MAX_CMND 30
#define _GLIBTOP_PARAM_SIZE 16

View File

@@ -46,16 +46,20 @@ struct _partition_info
{
char name[256];
char type[256];
char raid_num[256];
char raid_num[256];
int max;
};
typedef struct _partition_info partition_info;
struct _glibtop_disk
{
guint64 flags;
guint64 xdisk_sectors_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_READ */
guint64 xdisk_time_read [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_READ */
guint64 xdisk_sectors_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_SECTORS_WRITE */
guint64 xdisk_time_write [GLIBTOP_NDISK]; /* GLIBTOP_XDISK_TIME_WRITE */
guint64 xdisk_flags;
};
void glibtop_get_disk (glibtop_disk *buf);

View File

@@ -61,7 +61,7 @@ typedef union _glibtop_union glibtop_union;
union _glibtop_union
{
glibtop_cpu cpu;
glibtop_disk disk;
glibtop_disk disk;
glibtop_mem mem;
glibtop_swap swap;
glibtop_uptime uptime;