This is a very big an possibly breaking commit.
It changes the return values of all sysdeps functions which were previosly returning void to int. This is the first step to implement better error handling in LibGTop. Martin 1999-10-24 Martin Baulig <martin@home-of-linux.org> * include/glibtop/*.h (glibtop_get_*, glibtop_init*): Changed the return value of all `glibtop_get_<feature>_* ()' and all `glibtop_init_<feature>_* ()' functions from void to int. * features.def: Reflect changes of the return values. * sysdeps/*/*.c: Reflect changes of the return values.
This commit is contained in:
committed by
Martin Baulig
parent
eae892c9b1
commit
a5dd7e9063
@@ -38,7 +38,7 @@ static const unsigned long _glibtop_sysdeps_cpu_smp =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_cpu_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.cpu = _glibtop_sysdeps_cpu;
|
||||
@@ -49,7 +49,7 @@ glibtop_init_cpu_s (glibtop *server)
|
||||
|
||||
/* Provides information about cpu usage. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
||||
{
|
||||
libgtop_stat_t stat;
|
||||
|
||||
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_loadavg =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_loadavg_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.loadavg = _glibtop_sysdeps_loadavg;
|
||||
@@ -39,7 +39,7 @@ glibtop_init_loadavg_s (glibtop *server)
|
||||
|
||||
/* Provides load averange. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
|
||||
{
|
||||
libgtop_stat_t stat;
|
||||
|
||||
@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_mem =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_mem_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.mem = _glibtop_sysdeps_mem;
|
||||
@@ -41,7 +41,7 @@ glibtop_init_mem_s (glibtop *server)
|
||||
|
||||
/* Provides information about memory usage. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
|
||||
{
|
||||
libgtop_mem_t mem;
|
||||
|
||||
@@ -34,7 +34,7 @@ static const unsigned long _glibtop_sysdeps_msg_limits =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_msg_limits_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits;
|
||||
@@ -42,7 +42,7 @@ glibtop_init_msg_limits_s (glibtop *server)
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
||||
{
|
||||
struct msginfo msginfo;
|
||||
|
||||
@@ -67,7 +67,7 @@ static const unsigned long _glibtop_sysdeps_netload =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_netload_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.netload = _glibtop_sysdeps_netload;
|
||||
@@ -75,7 +75,7 @@ glibtop_init_netload_s (glibtop *server)
|
||||
|
||||
/* Provides network statistics. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
|
||||
const char *interface)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ static const unsigned long _glibtop_sysdeps_ppp =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_ppp_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||
@@ -177,7 +177,7 @@ static int is_ISDN_on (glibtop *server, int *online)
|
||||
|
||||
/* Provides PPP/ISDN information. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||
{
|
||||
int in, out, online;
|
||||
|
||||
@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_proc_args =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_args_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_args = _glibtop_sysdeps_proc_args;
|
||||
|
||||
@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_proc_kernel_kernel =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_kernel_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel |
|
||||
@@ -48,7 +48,7 @@ glibtop_init_proc_kernel_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_proclist =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proclist_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proclist = _glibtop_sysdeps_proclist;
|
||||
|
||||
@@ -41,7 +41,7 @@ static const unsigned long _glibtop_sysdeps_map_entry =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_map_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_map = _glibtop_sysdeps_proc_map;
|
||||
|
||||
@@ -43,7 +43,7 @@ static int pageshift; /* log base 2 of the pagesize */
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_mem_s (glibtop *server)
|
||||
{
|
||||
register int pagesize;
|
||||
@@ -61,7 +61,7 @@ glibtop_init_proc_mem_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ static int pageshift; /* log base 2 of the pagesize */
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_segment_s (glibtop *server)
|
||||
{
|
||||
register int pagesize;
|
||||
@@ -69,7 +69,7 @@ glibtop_init_proc_segment_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_signal_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal;
|
||||
@@ -42,7 +42,7 @@ glibtop_init_proc_signal_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_proc_state =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_state_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_state = _glibtop_sysdeps_proc_state;
|
||||
@@ -43,7 +43,7 @@ glibtop_init_proc_state_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ static const unsigned long _glibtop_sysdeps_proc_time_smp =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_time_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_time = _glibtop_sysdeps_proc_time;
|
||||
@@ -47,7 +47,7 @@ glibtop_init_proc_time_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ static const unsigned long _glibtop_sysdeps_proc_uid =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_proc_uid_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid;
|
||||
@@ -51,7 +51,7 @@ glibtop_init_proc_uid_s (glibtop *server)
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,7 @@ static unsigned long _glibtop_sysdeps_sem_limits =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_sem_limits_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits;
|
||||
@@ -58,7 +58,7 @@ glibtop_init_sem_limits_s (glibtop *server)
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
||||
{
|
||||
struct seminfo seminfo;
|
||||
|
||||
@@ -33,7 +33,7 @@ static unsigned long _glibtop_sysdeps_shm_limits =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_shm_limits_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits;
|
||||
@@ -41,7 +41,7 @@ glibtop_init_shm_limits_s (glibtop *server)
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
||||
{
|
||||
struct shminfo shminfo;
|
||||
|
||||
@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_swap_stat =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_swap_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.swap = _glibtop_sysdeps_swap |
|
||||
@@ -44,7 +44,7 @@ glibtop_init_swap_s (glibtop *server)
|
||||
|
||||
/* Provides information about swap usage. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
|
||||
{
|
||||
libgtop_stat_t stat;
|
||||
|
||||
@@ -32,7 +32,7 @@ static unsigned long _glibtop_sysdeps_uptime =
|
||||
|
||||
/* Init function. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_init_uptime_s (glibtop *server)
|
||||
{
|
||||
server->sysdeps.uptime = _glibtop_sysdeps_uptime;
|
||||
@@ -40,7 +40,7 @@ glibtop_init_uptime_s (glibtop *server)
|
||||
|
||||
/* Provides uptime and idle time. */
|
||||
|
||||
void
|
||||
int
|
||||
glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
|
||||
{
|
||||
libgtop_stat_t stat;
|
||||
|
||||
Reference in New Issue
Block a user