summaryrefslogtreecommitdiff
path: root/sysdeps/stub
diff options
context:
space:
mode:
authorMartin Baulig <baulig@suse.de>2000-11-20 22:37:15 +0000
committerMartin Baulig <martin@src.gnome.org>2000-11-20 22:37:15 +0000
commit752d5b47d2134cd6e76465943aadcdcb0ea5e777 (patch)
tree062defcfdaa4a83273e1c0112025f725a74f4332 /sysdeps/stub
parentc15ff3f342e7f5eb74a5f5867ebe87c89d9a5cb0 (diff)
downloadlibgtop-752d5b47d2134cd6e76465943aadcdcb0ea5e777.tar.gz
Started with the big rewrite for GNOME 2.0:
2000-11-20 Martin Baulig <baulig@suse.de> Started with the big rewrite for GNOME 2.0: - split the `glibtop' structure into `glibtop_server' and `glibtop_client' and make `glibtop_client' a GObject. - cleanly separate the library and the backends. This stuff currently does not compile. * glibtop.h (glibtop_server_private, glibtop_server_info): Removed typedefs. (struct _glibtop, struct _glibtop_server_info): Removed. (glibtop_global_server, glibtop_server_features): Removed. (glibtop_server_ref, glibtop_server_unref): Removed. * glibtop.h (glibtop_init_s): First argument is now a `glibtop_server *'. * include/glibtop/*.h: Removed all #defines with the glibtop_global_server. (glibtop_get_*_l): First argument is now a `glibtop_client *'. (glibtop_get_*_s, glibtop_init_*_s): First argument is now a `glibtop_server *'. * lib/glibtop-client.c: New file. * sysdeps/common/xmalloc.c: Moved to lib/. * sysdeps/common/error.c: Moved to lib/. * lib/xmalloc.c: Moved here from sysdeps/common/. * lib/error.c: Moved here from sysdeps/common/. * include/glibtop/backend.h (glibtop_backend_open_func_t, glibtop_backend_close_func_t): First argument is now a `glibtop_server *'. (glibtop_backend_info): Added `glibtop_server *server'. (glibtop_open_backend_l): Returns `glibtop_backend *', first argument is `glibtop_client *' and added `GError **'. * include/glibtop/close.h (glibtop_close_s, glibtop_close_p): First argument is now a `glibtop_server *'. * include/glibtop/error.h (*): First argument is now a `glibtop_server *'. * include/glibtop/errors.h: Switched this to use GError.
Diffstat (limited to 'sysdeps/stub')
-rw-r--r--sysdeps/stub/Makefile.am4
-rw-r--r--sysdeps/stub/close.c2
-rw-r--r--sysdeps/stub/cpu.c6
-rw-r--r--sysdeps/stub/glibtop_server_private.h (renamed from sysdeps/stub/glibtop_server.h)4
-rw-r--r--sysdeps/stub/interfaces.c6
-rw-r--r--sysdeps/stub/loadavg.c6
-rw-r--r--sysdeps/stub/mem.c6
-rw-r--r--sysdeps/stub/msg_limits.c6
-rw-r--r--sysdeps/stub/netload.c6
-rw-r--r--sysdeps/stub/open.c2
-rw-r--r--sysdeps/stub/ppp.c8
-rw-r--r--sysdeps/stub/procargs.c7
-rw-r--r--sysdeps/stub/proccwd.c6
-rw-r--r--sysdeps/stub/prockernel.c6
-rw-r--r--sysdeps/stub/proclist.c7
-rw-r--r--sysdeps/stub/procmap.c7
-rw-r--r--sysdeps/stub/procmem.c6
-rw-r--r--sysdeps/stub/procsegment.c6
-rw-r--r--sysdeps/stub/procsignal.c6
-rw-r--r--sysdeps/stub/procstate.c6
-rw-r--r--sysdeps/stub/proctime.c6
-rw-r--r--sysdeps/stub/procuid.c6
-rw-r--r--sysdeps/stub/sem_limits.c4
-rw-r--r--sysdeps/stub/shm_limits.c4
-rw-r--r--sysdeps/stub/swap.c6
-rw-r--r--sysdeps/stub/uptime.c6
26 files changed, 92 insertions, 53 deletions
diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am
index 29f1e593..12bcaf9f 100644
--- a/sysdeps/stub/Makefile.am
+++ b/sysdeps/stub/Makefile.am
@@ -1,6 +1,6 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
-INCLUDES = @INCLUDES@
+INCLUDES = @INCLUDES@ -D_IN_LIBGTOP_SERVER
lib_LTLIBRARIES = libgtop_sysdeps.la
@@ -13,5 +13,5 @@ libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
-include_HEADERS = glibtop_server.h
+noinst_HEADERS = glibtop_server_private.h
diff --git a/sysdeps/stub/close.c b/sysdeps/stub/close.c
index 3378b817..defd8fd4 100644
--- a/sysdeps/stub/close.c
+++ b/sysdeps/stub/close.c
@@ -28,5 +28,5 @@
/* Closes pipe to gtop server. */
void
-glibtop_close_s (glibtop *server)
+glibtop_close_s (glibtop_server *server)
{ }
diff --git a/sysdeps/stub/cpu.c b/sysdeps/stub/cpu.c
index c6b2dee9..266afe49 100644
--- a/sysdeps/stub/cpu.c
+++ b/sysdeps/stub/cpu.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_cpu = 0;
/* Init function. */
int
-glibtop_init_cpu_s (glibtop *server)
+glibtop_init_cpu_s (glibtop_server *server)
{
server->info->sysdeps.cpu = _glibtop_sysdeps_cpu;
@@ -41,8 +41,10 @@ glibtop_init_cpu_s (glibtop *server)
/* Provides information about cpu usage. */
int
-glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
+glibtop_get_cpu_s (glibtop_server *server, glibtop_cpu *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_CPU, 0);
+
memset (buf, 0, sizeof (glibtop_cpu));
return 0;
diff --git a/sysdeps/stub/glibtop_server.h b/sysdeps/stub/glibtop_server_private.h
index ce0acf4f..3ca3737c 100644
--- a/sysdeps/stub/glibtop_server.h
+++ b/sysdeps/stub/glibtop_server_private.h
@@ -23,8 +23,8 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef __GLIBTOP_SERVER_H__
-#define __GLIBTOP_SERVER_H__
+#ifndef __GLIBTOP_SERVER_PRIVATE_H__
+#define __GLIBTOP_SERVER_PRIVATE_H__
BEGIN_LIBGTOP_DECLS
diff --git a/sysdeps/stub/interfaces.c b/sysdeps/stub/interfaces.c
index 319f4ee6..c3dbccf9 100644
--- a/sysdeps/stub/interfaces.c
+++ b/sysdeps/stub/interfaces.c
@@ -34,7 +34,7 @@ static const unsigned long _glibtop_sysdeps_interface_names =
/* Init function. */
int
-glibtop_init_interface_names_s (glibtop *server)
+glibtop_init_interface_names_s (glibtop_server *server)
{
server->info->sysdeps.interface_names = _glibtop_sysdeps_interface_names;
@@ -45,11 +45,11 @@ glibtop_init_interface_names_s (glibtop *server)
glibtop_interface *
-glibtop_get_interface_names_s (glibtop *server, glibtop_array *array,
+glibtop_get_interface_names_s (glibtop_server *server, glibtop_array *array,
u_int64_t interface, u_int64_t number,
u_int64_t instance, u_int64_t strategy)
{
- glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
memset (array, 0, sizeof (glibtop_array));
diff --git a/sysdeps/stub/loadavg.c b/sysdeps/stub/loadavg.c
index c666d2ca..27fc4bf8 100644
--- a/sysdeps/stub/loadavg.c
+++ b/sysdeps/stub/loadavg.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_loadavg = 0;
/* Init function. */
int
-glibtop_init_loadavg_s (glibtop *server)
+glibtop_init_loadavg_s (glibtop_server *server)
{
server->info->sysdeps.loadavg = _glibtop_sysdeps_loadavg;
@@ -41,8 +41,10 @@ glibtop_init_loadavg_s (glibtop *server)
/* Provides load averange. */
int
-glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
+glibtop_get_loadavg_s (glibtop_server *server, glibtop_loadavg *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_LOADAVG, 0);
+
memset (buf, 0, sizeof (glibtop_loadavg));
return 0;
diff --git a/sysdeps/stub/mem.c b/sysdeps/stub/mem.c
index 3b16c0a9..0a659dcd 100644
--- a/sysdeps/stub/mem.c
+++ b/sysdeps/stub/mem.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_mem = 0;
/* Init function. */
int
-glibtop_init_mem_s (glibtop *server)
+glibtop_init_mem_s (glibtop_server *server)
{
server->info->sysdeps.mem = _glibtop_sysdeps_mem;
@@ -41,8 +41,10 @@ glibtop_init_mem_s (glibtop *server)
/* Provides information about memory usage. */
int
-glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
+glibtop_get_mem_s (glibtop_server *server, glibtop_mem *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_MEM, 0);
+
memset (buf, 0, sizeof (glibtop_mem));
return 0;
diff --git a/sysdeps/stub/msg_limits.c b/sysdeps/stub/msg_limits.c
index f917678c..d59f0036 100644
--- a/sysdeps/stub/msg_limits.c
+++ b/sysdeps/stub/msg_limits.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_msg_limits = 0;
/* Init function. */
int
-glibtop_init_msg_limits_s (glibtop *server)
+glibtop_init_msg_limits_s (glibtop_server *server)
{
server->info->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits;
@@ -41,8 +41,10 @@ glibtop_init_msg_limits_s (glibtop *server)
/* Provides information about sysv ipc limits. */
int
-glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
+glibtop_get_msg_limits_s (glibtop_server *server, glibtop_msg_limits *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
+
memset (buf, 0, sizeof (glibtop_msg_limits));
return 0;
diff --git a/sysdeps/stub/netload.c b/sysdeps/stub/netload.c
index e0f974b1..239194fe 100644
--- a/sysdeps/stub/netload.c
+++ b/sysdeps/stub/netload.c
@@ -32,7 +32,7 @@ static const unsigned long _glibtop_sysdeps_netload = 0;
/* Init function. */
int
-glibtop_init_netload_s (glibtop *server)
+glibtop_init_netload_s (glibtop_server *server)
{
server->info->sysdeps.netload = _glibtop_sysdeps_netload;
@@ -42,10 +42,12 @@ glibtop_init_netload_s (glibtop *server)
/* Provides network statistics. */
int
-glibtop_get_netload_s (glibtop *server, glibtop_netload *buf,
+glibtop_get_netload_s (glibtop_server *server, glibtop_netload *buf,
const char *interface, unsigned transport,
unsigned protocol)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_NETLOAD, 0);
+
memset (buf, 0, sizeof (glibtop_netload));
return 0;
diff --git a/sysdeps/stub/open.c b/sysdeps/stub/open.c
index f269292e..27cf36bb 100644
--- a/sysdeps/stub/open.c
+++ b/sysdeps/stub/open.c
@@ -29,7 +29,7 @@
/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */
void
-glibtop_open_s (glibtop *server, const char *program_name,
+glibtop_open_s (glibtop_server *server, const char *program_name,
const unsigned long features, const unsigned flags)
{
server->name = program_name;
diff --git a/sysdeps/stub/ppp.c b/sysdeps/stub/ppp.c
index 0b177842..6d165881 100644
--- a/sysdeps/stub/ppp.c
+++ b/sysdeps/stub/ppp.c
@@ -32,7 +32,7 @@ static const unsigned long _glibtop_sysdeps_ppp = 0;
/* Init function. */
int
-glibtop_init_ppp_s (glibtop *server)
+glibtop_init_ppp_s (glibtop_server *server)
{
server->info->sysdeps.ppp = _glibtop_sysdeps_ppp;
@@ -42,9 +42,11 @@ glibtop_init_ppp_s (glibtop *server)
/* Provides PPP/ISDN information. */
int
-glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device,
- unsigned short isdn)
+glibtop_get_ppp_s (glibtop_server *server, glibtop_ppp *buf,
+ unsigned short device, unsigned short isdn)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PPP, 0);
+
memset (buf, 0, sizeof (glibtop_ppp));
return 0;
diff --git a/sysdeps/stub/procargs.c b/sysdeps/stub/procargs.c
index 15d2a749..63a57a4d 100644
--- a/sysdeps/stub/procargs.c
+++ b/sysdeps/stub/procargs.c
@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_proc_args = 0;
/* Init function. */
int
-glibtop_init_proc_args_s (glibtop *server)
+glibtop_init_proc_args_s (glibtop_server *server)
{
server->info->sysdeps.proc_args = _glibtop_sysdeps_proc_args;
@@ -43,8 +43,11 @@ glibtop_init_proc_args_s (glibtop *server)
/* Provides detailed information about a process. */
char **
-glibtop_get_proc_args_s (glibtop *server, glibtop_array *array, pid_t pid)
+glibtop_get_proc_args_s (glibtop_server *server, glibtop_array *array, pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_ARGS, 0);
+
memset (array, 0, sizeof (glibtop_array));
+
return NULL;
}
diff --git a/sysdeps/stub/proccwd.c b/sysdeps/stub/proccwd.c
index daca2964..03d99ee4 100644
--- a/sysdeps/stub/proccwd.c
+++ b/sysdeps/stub/proccwd.c
@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_proc_cwd = 0;
/* Init function. */
int
-glibtop_init_proc_cwd_s (glibtop *server)
+glibtop_init_proc_cwd_s (glibtop_server *server)
{
server->info->sysdeps.proc_cwd = _glibtop_sysdeps_proc_cwd;
@@ -43,8 +43,10 @@ glibtop_init_proc_cwd_s (glibtop *server)
/* Provides detailed information about a process. */
char *
-glibtop_get_proc_cwd_s (glibtop *server, glibtop_proc_cwd *buf, pid_t pid)
+glibtop_get_proc_cwd_s (glibtop_server *server, glibtop_proc_cwd *buf, pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_CWD, 0);
+
memset (buf, 0, sizeof (glibtop_proc_cwd));
return NULL;
diff --git a/sysdeps/stub/prockernel.c b/sysdeps/stub/prockernel.c
index 90ea5d82..4e132d5d 100644
--- a/sysdeps/stub/prockernel.c
+++ b/sysdeps/stub/prockernel.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_kernel = 0;
/* Init function. */
int
-glibtop_init_proc_kernel_s (glibtop *server)
+glibtop_init_proc_kernel_s (glibtop_server *server)
{
server->info->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel;
@@ -41,9 +41,11 @@ glibtop_init_proc_kernel_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf,
+glibtop_get_proc_kernel_s (glibtop_server *server, glibtop_proc_kernel *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
+
memset (buf, 0, sizeof (glibtop_proc_kernel));
return 0;
diff --git a/sysdeps/stub/proclist.c b/sysdeps/stub/proclist.c
index 0cfd699d..a7e8523d 100644
--- a/sysdeps/stub/proclist.c
+++ b/sysdeps/stub/proclist.c
@@ -33,7 +33,7 @@ static const unsigned long _glibtop_sysdeps_proclist = 0;
/* Init function. */
int
-glibtop_init_proclist_s (glibtop *server)
+glibtop_init_proclist_s (glibtop_server *server)
{
server->info->sysdeps.proclist = _glibtop_sysdeps_proclist;
@@ -48,9 +48,12 @@ glibtop_init_proclist_s (glibtop *server)
* each buf->size big. The total size is stored in buf->total. */
unsigned *
-glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
+glibtop_get_proclist_s (glibtop_server *server, glibtop_proclist *buf,
int64_t which, int64_t arg)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROCLIST, 0);
+
memset (buf, 0, sizeof (glibtop_proclist));
+
return NULL;
}
diff --git a/sysdeps/stub/procmap.c b/sysdeps/stub/procmap.c
index b8c60491..18484cc9 100644
--- a/sysdeps/stub/procmap.c
+++ b/sysdeps/stub/procmap.c
@@ -34,7 +34,7 @@ static const unsigned long _glibtop_sysdeps_proc_map = 0;
/* Init function. */
int
-glibtop_init_proc_map_s (glibtop *server)
+glibtop_init_proc_map_s (glibtop_server *server)
{
server->info->sysdeps.proc_map = _glibtop_sysdeps_proc_map;
@@ -44,9 +44,10 @@ glibtop_init_proc_map_s (glibtop *server)
/* Provides detailed information about a process. */
glibtop_map_entry *
-glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
+glibtop_get_proc_map_s (glibtop_server *server, glibtop_proc_map *buf,
+ pid_t pid)
{
- glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0);
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_MAP, 0);
memset (buf, 0, sizeof (glibtop_proc_map));
diff --git a/sysdeps/stub/procmem.c b/sysdeps/stub/procmem.c
index 51b2df11..fe989df6 100644
--- a/sysdeps/stub/procmem.c
+++ b/sysdeps/stub/procmem.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_mem = 0;
/* Init function. */
int
-glibtop_init_proc_mem_s (glibtop *server)
+glibtop_init_proc_mem_s (glibtop_server *server)
{
server->info->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem;
@@ -41,9 +41,11 @@ glibtop_init_proc_mem_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf,
+glibtop_get_proc_mem_s (glibtop_server *server, glibtop_proc_mem *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_MEM, 0);
+
memset (buf, 0, sizeof (glibtop_proc_mem));
return 0;
diff --git a/sysdeps/stub/procsegment.c b/sysdeps/stub/procsegment.c
index 7f20dd9c..4afca8ad 100644
--- a/sysdeps/stub/procsegment.c
+++ b/sysdeps/stub/procsegment.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_segment = 0;
/* Init function. */
int
-glibtop_init_proc_segment_s (glibtop *server)
+glibtop_init_proc_segment_s (glibtop_server *server)
{
server->info->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment;
@@ -41,9 +41,11 @@ glibtop_init_proc_segment_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
+glibtop_get_proc_segment_s (glibtop_server *server, glibtop_proc_segment *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
+
memset (buf, 0, sizeof (glibtop_proc_segment));
return 0;
diff --git a/sysdeps/stub/procsignal.c b/sysdeps/stub/procsignal.c
index e6fdd529..0fce3989 100644
--- a/sysdeps/stub/procsignal.c
+++ b/sysdeps/stub/procsignal.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_signal = 0;
/* Init function. */
int
-glibtop_init_proc_signal_s (glibtop *server)
+glibtop_init_proc_signal_s (glibtop_server *server)
{
server->info->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal;
@@ -41,9 +41,11 @@ glibtop_init_proc_signal_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
+glibtop_get_proc_signal_s (glibtop_server *server, glibtop_proc_signal *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
+
memset (buf, 0, sizeof (glibtop_proc_signal));
return 0;
diff --git a/sysdeps/stub/procstate.c b/sysdeps/stub/procstate.c
index 008517b6..6a9cbab9 100644
--- a/sysdeps/stub/procstate.c
+++ b/sysdeps/stub/procstate.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_state = 0;
/* Init function. */
int
-glibtop_init_proc_state_s (glibtop *server)
+glibtop_init_proc_state_s (glibtop_server *server)
{
server->info->sysdeps.proc_state = _glibtop_sysdeps_proc_state;
@@ -41,9 +41,11 @@ glibtop_init_proc_state_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf,
+glibtop_get_proc_state_s (glibtop_server *server, glibtop_proc_state *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
+
memset (buf, 0, sizeof (glibtop_proc_state));
return 0;
diff --git a/sysdeps/stub/proctime.c b/sysdeps/stub/proctime.c
index 470c8be4..b8704918 100644
--- a/sysdeps/stub/proctime.c
+++ b/sysdeps/stub/proctime.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_time = 0;
/* Init function. */
int
-glibtop_init_proc_time_s (glibtop *server)
+glibtop_init_proc_time_s (glibtop_server *server)
{
server->info->sysdeps.proc_time = _glibtop_sysdeps_proc_time;
@@ -41,9 +41,11 @@ glibtop_init_proc_time_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf,
+glibtop_get_proc_time_s (glibtop_server *server, glibtop_proc_time *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
+
memset (buf, 0, sizeof (glibtop_proc_time));
return 0;
diff --git a/sysdeps/stub/procuid.c b/sysdeps/stub/procuid.c
index 652b1be8..53277fbf 100644
--- a/sysdeps/stub/procuid.c
+++ b/sysdeps/stub/procuid.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_proc_uid = 0;
/* Init function. */
int
-glibtop_init_proc_uid_s (glibtop *server)
+glibtop_init_proc_uid_s (glibtop_server *server)
{
server->info->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid;
@@ -41,9 +41,11 @@ glibtop_init_proc_uid_s (glibtop *server)
/* Provides detailed information about a process. */
int
-glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf,
+glibtop_get_proc_uid_s (glibtop_server *server, glibtop_proc_uid *buf,
pid_t pid)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_PROC_UID, 0);
+
memset (buf, 0, sizeof (glibtop_proc_uid));
return 0;
diff --git a/sysdeps/stub/sem_limits.c b/sysdeps/stub/sem_limits.c
index f1265180..8f26cbd1 100644
--- a/sysdeps/stub/sem_limits.c
+++ b/sysdeps/stub/sem_limits.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_sem_limits = 0;
/* Init function. */
int
-glibtop_init_sem_limits_s (glibtop *server)
+glibtop_init_sem_limits_s (glibtop_server *server)
{
server->info->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits;
@@ -41,7 +41,7 @@ glibtop_init_sem_limits_s (glibtop *server)
/* Provides information about sysv sem limits. */
int
-glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
+glibtop_get_sem_limits_s (glibtop_server *server, glibtop_sem_limits *buf)
{
memset (buf, 0, sizeof (glibtop_sem_limits));
diff --git a/sysdeps/stub/shm_limits.c b/sysdeps/stub/shm_limits.c
index 7807faef..6abeeaf3 100644
--- a/sysdeps/stub/shm_limits.c
+++ b/sysdeps/stub/shm_limits.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_shm_limits = 0;
/* Init function. */
int
-glibtop_init_shm_limits_s (glibtop *server)
+glibtop_init_shm_limits_s (glibtop_server *server)
{
server->info->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits;
@@ -41,7 +41,7 @@ glibtop_init_shm_limits_s (glibtop *server)
/* Provides information about sysv ipc limits. */
int
-glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
+glibtop_get_shm_limits_s (glibtop_server *server, glibtop_shm_limits *buf)
{
memset (buf, 0, sizeof (glibtop_shm_limits));
diff --git a/sysdeps/stub/swap.c b/sysdeps/stub/swap.c
index b3451b67..5ceac8ac 100644
--- a/sysdeps/stub/swap.c
+++ b/sysdeps/stub/swap.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_swap = 0;
/* Init function. */
int
-glibtop_init_swap_s (glibtop *server)
+glibtop_init_swap_s (glibtop_server *server)
{
server->info->sysdeps.swap = _glibtop_sysdeps_swap;
@@ -41,8 +41,10 @@ glibtop_init_swap_s (glibtop *server)
/* Provides information about swap usage. */
int
-glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
+glibtop_get_swap_s (glibtop_server *server, glibtop_swap *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_SWAP, 0);
+
memset (buf, 0, sizeof (glibtop_swap));
return 0;
diff --git a/sysdeps/stub/uptime.c b/sysdeps/stub/uptime.c
index 5829f700..a0e1c489 100644
--- a/sysdeps/stub/uptime.c
+++ b/sysdeps/stub/uptime.c
@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_uptime = 0;
/* Init function. */
int
-glibtop_init_uptime_s (glibtop *server)
+glibtop_init_uptime_s (glibtop_server *server)
{
server->info->sysdeps.uptime = _glibtop_sysdeps_uptime;
@@ -41,8 +41,10 @@ glibtop_init_uptime_s (glibtop *server)
/* Provides uptime and idle time. */
int
-glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
+glibtop_get_uptime_s (glibtop_server *server, glibtop_uptime *buf)
{
+ glibtop_init_s (server, GLIBTOP_SYSDEPS_UPTIME, 0);
+
memset (buf, 0, sizeof (glibtop_uptime));
return 0;