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:
Martin Baulig
1999-10-24 19:09:32 +00:00
committed by Martin Baulig
parent eae892c9b1
commit a5dd7e9063
180 changed files with 403 additions and 394 deletions

View File

@@ -37,7 +37,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;
@@ -50,7 +50,7 @@ glibtop_init_cpu_s (glibtop *server)
#define FILENAME "/proc/stat"
void
int
glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
{
char buffer [BUFSIZ], *p;

View File

@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_loadavg_tasks =
/* Init function. */
void
int
glibtop_init_loadavg_s (glibtop *server)
{
server->sysdeps.loadavg = _glibtop_sysdeps_loadavg;
@@ -45,7 +45,7 @@ glibtop_init_loadavg_s (glibtop *server)
#define FILENAME "/proc/loadavg"
void
int
glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
{
char buffer [BUFSIZ], *p, *old;

View File

@@ -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;
@@ -43,7 +43,7 @@ glibtop_init_mem_s (glibtop *server)
#define FILENAME "/proc/meminfo"
void
int
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{
char buffer [BUFSIZ], *p;

View File

@@ -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;

View File

@@ -88,7 +88,7 @@ static const unsigned long _glibtop_sysdeps_netload_out =
/* Init function. */
void
int
glibtop_init_netload_s (glibtop *server)
{
server->sysdeps.netload = _glibtop_sysdeps_netload |
@@ -99,7 +99,7 @@ glibtop_init_netload_s (glibtop *server)
/* Provides network statistics. */
void
int
glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
const char *interface)
{

View File

@@ -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;

View File

@@ -31,7 +31,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;

View File

@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_proc_kernel =
/* Init function. */
void
int
glibtop_init_proc_kernel_s (glibtop *server)
{
server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel;
@@ -41,7 +41,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)
{
char buffer [BUFSIZ], *p;

View File

@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_proclist =
/* Init function. */
void
int
glibtop_init_proclist_s (glibtop *server)
{
server->sysdeps.proclist = _glibtop_sysdeps_proclist;

View File

@@ -38,7 +38,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;

View File

@@ -45,7 +45,7 @@ static int pageshift; /* log base 2 of the pagesize */
/* Init function. */
void
int
glibtop_init_proc_mem_s (glibtop *server)
{
register int pagesize;
@@ -65,7 +65,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)
{
char buffer [BUFSIZ], *p;

View File

@@ -49,7 +49,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)
{

View File

@@ -31,7 +31,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;
@@ -39,7 +39,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)
{
char buffer [BUFSIZ], *p;

View File

@@ -35,7 +35,7 @@ static const unsigned long _glibtop_sysdeps_proc_state_uid =
/* Init function. */
void
int
glibtop_init_proc_state_s (glibtop *server)
{
server->sysdeps.proc_state = _glibtop_sysdeps_proc_state |
@@ -44,7 +44,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)
{
char buffer [BUFSIZ], state, *p;

View File

@@ -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)
{
char buffer [BUFSIZ], *p;

View File

@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_proc_uid_stat =
/* Init function. */
void
int
glibtop_init_proc_uid_s (glibtop *server)
{
server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid |
@@ -48,7 +48,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)
{
char buffer [BUFSIZ], *p;

View File

@@ -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;

View File

@@ -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;

View File

@@ -36,7 +36,7 @@ static unsigned long _glibtop_sysdeps_swap_paging =
/* Init function. */
void
int
glibtop_init_swap_s (glibtop *server)
{
server->sysdeps.swap = _glibtop_sysdeps_swap |
@@ -48,7 +48,7 @@ glibtop_init_swap_s (glibtop *server)
#define MEMINFO "/proc/meminfo"
#define PROC_STAT "/proc/stat"
void
int
glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
{
char buffer [BUFSIZ], *p;

View File

@@ -30,7 +30,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)
#define FILENAME "/proc/uptime"
void
int
glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
{
char buffer [BUFSIZ], *p;