summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2004-07-18 20:33:56 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2004-07-18 20:33:56 +0000
commitff4fe5e8462e78ef27913b2a0d08590f482fa919 (patch)
treec4d7b14e6888dc0345f65bf007800a72009f485b
parent92c18d4e8a79be614af3561e94cce8bd2fe03301 (diff)
downloadlibgtop-ff4fe5e8462e78ef27913b2a0d08590f482fa919.tar.gz
Glibify a bit more. Closes #147618.
* doc/reference.texi: * include/glibtop/command.h: * include/glibtop/glib-arrays.h: * include/glibtop/proclist.h: * lib/glib-arrays.c: (glibtop_get_proclist_as_array_l): * lib/lib.pl: * scripts/c_types.pl: * src/daemon/main.c: (handle_parent_connection): * src/daemon/slave.c: (handle_slave_connection): * support/mkstemp.c: * sysdeps/aix/proclist.c: (glibtop_get_proclist_s): * sysdeps/freebsd/cpu.c: (glibtop_get_cpu_p): * sysdeps/freebsd/prockernel.c: (glibtop_get_proc_kernel_p): * sysdeps/freebsd/proclist.c: (glibtop_get_proclist_p): * sysdeps/freebsd/procmem.c: (glibtop_get_proc_mem_p): * sysdeps/kernel/proclist.c: (glibtop_get_proclist_s): * sysdeps/linux/proclist.c: (glibtop_get_proclist_s): * sysdeps/osf1/proclist.c: (glibtop_get_proclist_p): * sysdeps/solaris/proclist.c: (glibtop_get_proclist_s): * sysdeps/stub/proclist.c: (glibtop_get_proclist_s): * sysdeps/stub_suid/proclist.c: (glibtop_get_proclist_p): * sysdeps/sun4/proclist.c: (glibtop_get_proclist_p): Glibify a bit more. Closes #147618.
-rw-r--r--ChangeLog26
-rw-r--r--doc/reference.texi4
-rw-r--r--include/glibtop/command.h2
-rw-r--r--include/glibtop/glib-arrays.h2
-rw-r--r--include/glibtop/proclist.h6
-rw-r--r--lib/glib-arrays.c4
-rwxr-xr-xlib/lib.pl2
-rw-r--r--scripts/c_types.pl2
-rw-r--r--src/daemon/main.c4
-rw-r--r--src/daemon/slave.c4
-rw-r--r--sysdeps/aix/proclist.c2
-rw-r--r--sysdeps/freebsd/cpu.c2
-rw-r--r--sysdeps/freebsd/prockernel.c28
-rw-r--r--sysdeps/freebsd/proclist.c2
-rw-r--r--sysdeps/freebsd/procmem.c4
-rw-r--r--sysdeps/kernel/proclist.c2
-rw-r--r--sysdeps/linux/proclist.c2
-rw-r--r--sysdeps/osf1/proclist.c2
-rw-r--r--sysdeps/solaris/proclist.c2
-rw-r--r--sysdeps/stub/proclist.c2
-rw-r--r--sysdeps/stub_suid/proclist.c2
-rw-r--r--sysdeps/sun4/proclist.c2
22 files changed, 67 insertions, 41 deletions
diff --git a/ChangeLog b/ChangeLog
index 28c16bfe..c6580781 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2004-07-18 Benoît Dejean <tazforever@dlfp.org>
+
+ * doc/reference.texi:
+ * include/glibtop/command.h:
+ * include/glibtop/glib-arrays.h:
+ * include/glibtop/proclist.h:
+ * lib/glib-arrays.c: (glibtop_get_proclist_as_array_l):
+ * lib/lib.pl:
+ * scripts/c_types.pl:
+ * src/daemon/main.c: (handle_parent_connection):
+ * src/daemon/slave.c: (handle_slave_connection):
+ * support/mkstemp.c:
+ * sysdeps/aix/proclist.c: (glibtop_get_proclist_s):
+ * sysdeps/freebsd/cpu.c: (glibtop_get_cpu_p):
+ * sysdeps/freebsd/prockernel.c: (glibtop_get_proc_kernel_p):
+ * sysdeps/freebsd/proclist.c: (glibtop_get_proclist_p):
+ * sysdeps/freebsd/procmem.c: (glibtop_get_proc_mem_p):
+ * sysdeps/kernel/proclist.c: (glibtop_get_proclist_s):
+ * sysdeps/linux/proclist.c: (glibtop_get_proclist_s):
+ * sysdeps/osf1/proclist.c: (glibtop_get_proclist_p):
+ * sysdeps/solaris/proclist.c: (glibtop_get_proclist_s):
+ * sysdeps/stub/proclist.c: (glibtop_get_proclist_s):
+ * sysdeps/stub_suid/proclist.c: (glibtop_get_proclist_p):
+ * sysdeps/sun4/proclist.c: (glibtop_get_proclist_p): Glibify a bit more.
+ Closes #147618.
+
2004-07-17 Benoît Dejean <tazforever@dlfp.org>
* include/glibtop/fsusage.h: Added read, write. This members provides
diff --git a/doc/reference.texi b/doc/reference.texi
index 8f63ed31..804e6a6c 100644
--- a/doc/reference.texi
+++ b/doc/reference.texi
@@ -359,11 +359,11 @@ Library function @code{glibtop_get_proclist}:
@cartouche
unsigned *
glibtop_get_proclist (glibtop_proclist *buf,
- int64_t which, int64_t arg);
+ gint64 which, gint64 arg);
unsigned *
glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg);
+ gint64 which, gint64 arg);
@end cartouche
@end example
diff --git a/include/glibtop/command.h b/include/glibtop/command.h
index d6219133..87688eb2 100644
--- a/include/glibtop/command.h
+++ b/include/glibtop/command.h
@@ -82,7 +82,7 @@ union _glibtop_response_union
struct _glibtop_response
{
- int64_t offset;
+ gint64 offset;
guint64 size, data_size;
glibtop_response_union u;
};
diff --git a/include/glibtop/glib-arrays.h b/include/glibtop/glib-arrays.h
index 6fa0247b..40dcf585 100644
--- a/include/glibtop/glib-arrays.h
+++ b/include/glibtop/glib-arrays.h
@@ -38,7 +38,7 @@ GPtrArray *
glibtop_get_proc_args_as_array_l (glibtop_client *client, pid_t pid);
GArray *
-glibtop_get_proclist_as_array_l (glibtop_client *client, int64_t which, int64_t arg);
+glibtop_get_proclist_as_array_l (glibtop_client *client, gint64 which, gint64 arg);
GPtrArray *
glibtop_get_proc_map_as_array_l (glibtop_client *client, pid_t pid);
diff --git a/include/glibtop/proclist.h b/include/glibtop/proclist.h
index 3b9d1d76..83ec6c47 100644
--- a/include/glibtop/proclist.h
+++ b/include/glibtop/proclist.h
@@ -72,20 +72,20 @@ struct _glibtop_proclist
unsigned *
glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg);
+ gint64 which, gint64 arg);
#if GLIBTOP_SUID_PROCLIST
void glibtop_init_proclist_p (glibtop *server);
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg);
+ gint64 which, gint64 arg);
#else
void glibtop_init_proclist_s (glibtop *server);
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg);
+ gint64 which, gint64 arg);
#endif
#ifdef GLIBTOP_NAMES
diff --git a/lib/glib-arrays.c b/lib/glib-arrays.c
index 13c80422..5853775d 100644
--- a/lib/glib-arrays.c
+++ b/lib/glib-arrays.c
@@ -29,8 +29,8 @@
#include <glibtop/glib-arrays.h>
GArray *
-glibtop_get_proclist_as_array_l (glibtop_client *client, int64_t which,
- int64_t arg)
+glibtop_get_proclist_as_array_l (glibtop_client *client, gint64 which,
+ gint64 arg)
{
glibtop_array array;
GArray *retval;
diff --git a/lib/lib.pl b/lib/lib.pl
index 749bd872..592d78fe 100755
--- a/lib/lib.pl
+++ b/lib/lib.pl
@@ -67,7 +67,7 @@ print '';
print '/* Library functions. */';
print '';
-$convert{'long'} = 'int64_t';
+$convert{'long'} = 'gint64';
$convert{'ulong'} = 'guint64';
$convert{'pid_t'} = 'pid_t';
$convert{'int'} = 'int';
diff --git a/scripts/c_types.pl b/scripts/c_types.pl
index 06d61e96..d02a8e1f 100644
--- a/scripts/c_types.pl
+++ b/scripts/c_types.pl
@@ -49,7 +49,7 @@ my $c_demarshal_func = sub {
# * Flag specifying whether we need to copy the parameter into temp storage
#
-$typeinfo = {'long' => ['int64_t', 0],
+$typeinfo = {'long' => ['gint64', 0],
'ulong' => ['guint64', 0],
'pid_t' => ['pid_t', 0],
'int' => ['int', 0],
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 25530738..84ecc6b8 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -41,7 +41,7 @@ handle_parent_connection (int s)
glibtop_mountentry *mount_list;
char parameter [BUFSIZ];
unsigned short device;
- int64_t *param_ptr;
+ gint64 *param_ptr;
int all_fs;
pid_t pid;
void *ptr;
@@ -133,7 +133,7 @@ handle_parent_connection (int s)
do_output (s, resp, _offset_data (sem_limits), 0, NULL);
break;
case GLIBTOP_CMND_PROCLIST:
- param_ptr = (int64_t *) parameter;
+ param_ptr = (gint64 *) parameter;
ptr = glibtop_get_proclist_l (server,
&resp->u.data.proclist,
param_ptr [0],
diff --git a/src/daemon/slave.c b/src/daemon/slave.c
index 5811ddc9..33c99cbc 100644
--- a/src/daemon/slave.c
+++ b/src/daemon/slave.c
@@ -27,7 +27,7 @@ void
handle_slave_connection (int input, int output)
{
glibtop *server G_GNUC_UNUSED = glibtop_global_server;
- int64_t *param_ptr G_GNUC_UNUSED;
+ gint64 *param_ptr G_GNUC_UNUSED;
const void *ptr G_GNUC_UNUSED;
unsigned short max_len G_GNUC_UNUSED;
@@ -72,7 +72,7 @@ handle_slave_connection (int input, int output)
return;
#if GLIBTOP_SUID_PROCLIST
case GLIBTOP_CMND_PROCLIST:
- param_ptr = (int64_t *) parameter;
+ param_ptr = (gint64 *) parameter;
ptr = glibtop_get_proclist_p
(server, &resp->u.data.proclist,
param_ptr [0], param_ptr [1]);
diff --git a/sysdeps/aix/proclist.c b/sysdeps/aix/proclist.c
index c5c52e01..eaa86fda 100644
--- a/sysdeps/aix/proclist.c
+++ b/sysdeps/aix/proclist.c
@@ -50,7 +50,7 @@ glibtop_init_proclist_s (glibtop *server)
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
struct procsinfo pinfo;
int count, total;
diff --git a/sysdeps/freebsd/cpu.c b/sysdeps/freebsd/cpu.c
index 426188e2..50678366 100644
--- a/sysdeps/freebsd/cpu.c
+++ b/sysdeps/freebsd/cpu.c
@@ -77,7 +77,7 @@ void
glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf)
{
#ifdef KERN_CP_TIME
- u_int64_t cpts [CPUSTATES];
+ guint64 cpts [CPUSTATES];
#else
long cpts [CPUSTATES];
#endif
diff --git a/sysdeps/freebsd/prockernel.c b/sysdeps/freebsd/prockernel.c
index 0d633770..05c57d6d 100644
--- a/sysdeps/freebsd/prockernel.c
+++ b/sysdeps/freebsd/prockernel.c
@@ -225,27 +225,27 @@ glibtop_get_proc_kernel_p (glibtop *server,
#else
#if defined(__NetBSD__)
#if defined(__m68k__)
- buf->kstk_esp = (u_int64_t) pcb.pcb_usp;
- buf->kstk_eip = (u_int64_t) 0;
+ buf->kstk_esp = (guint64) pcb.pcb_usp;
+ buf->kstk_eip = (guint64) 0;
#elif defined(__x86_64__)
- buf->kstk_esp = (u_int64_t) pcb.pcb_usersp;
- buf->kstk_eip = (u_int64_t) 0;
+ buf->kstk_esp = (guint64) pcb.pcb_usersp;
+ buf->kstk_eip = (guint64) 0;
#elif (defined(__arm32__) || defined(__powerpc__))
- buf->kstk_esp = (u_int64_t) pcb.pcb_sp;
- buf->kstk_eip = (u_int64_t) 0;
+ buf->kstk_esp = (guint64) pcb.pcb_sp;
+ buf->kstk_eip = (guint64) 0;
#elif defined(__mipsel__)
- buf->kstk_esp = (u_int64_t) pcb.pcb_context[8];
- buf->kstk_eip = (u_int64_t) 0;
+ buf->kstk_esp = (guint64) pcb.pcb_context[8];
+ buf->kstk_eip = (guint64) 0;
#elif defined(__sparc__)
- buf->kstk_esp = (u_int64_t) pcb.pcb_sp;
- buf->kstk_eip = (u_int64_t) pcb.pcb_pc;
+ buf->kstk_esp = (guint64) pcb.pcb_sp;
+ buf->kstk_eip = (guint64) pcb.pcb_pc;
#elif defined(__alpha__)
- buf->kstk_esp = (u_int64_t) pcb.pcb_context[9];
- buf->kstk_eip = (u_int64_t) pcb.pcb_context[8];
+ buf->kstk_esp = (guint64) pcb.pcb_context[9];
+ buf->kstk_eip = (guint64) pcb.pcb_context[8];
#else
/* provide some defaults for other platforms */
- buf->kstk_esp = (u_int64_t) 0;
- buf->kstk_eip = (u_int64_t) 0;
+ buf->kstk_esp = (guint64) 0;
+ buf->kstk_eip = (guint64) 0;
#endif /* ${MACHINE_ARCH} */
#endif /* __NetBSD__ */
buf->flags |= _glibtop_sysdeps_proc_kernel_pcb;
diff --git a/sysdeps/freebsd/proclist.c b/sysdeps/freebsd/proclist.c
index 902c9754..0038e426 100644
--- a/sysdeps/freebsd/proclist.c
+++ b/sysdeps/freebsd/proclist.c
@@ -59,7 +59,7 @@ glibtop_init_proclist_p (glibtop *server)
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
- int64_t real_which, int64_t arg)
+ gint64 real_which, gint64 arg)
{
struct kinfo_proc *pinfo;
unsigned *pids = NULL;
diff --git a/sysdeps/freebsd/procmem.c b/sysdeps/freebsd/procmem.c
index 51f3a37c..78b376a2 100644
--- a/sysdeps/freebsd/procmem.c
+++ b/sysdeps/freebsd/procmem.c
@@ -150,10 +150,10 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf,
buf->rss_rlim = pinfo [0].ki_rssize;
- buf->vsize = buf->size = (u_int64_t) pagetok
+ buf->vsize = buf->size = (guint64) pagetok
(pinfo [0].ki_tsize + pinfo [0].ki_dsize + pinfo[0].ki_ssize)
<< LOG1024;
- buf->resident = buf->rss = (u_int64_t) pagetok
+ buf->resident = buf->rss = (guint64) pagetok
(pinfo [0].ki_rssize) << LOG1024;
#else
diff --git a/sysdeps/kernel/proclist.c b/sysdeps/kernel/proclist.c
index 78808cd1..7a243061 100644
--- a/sysdeps/kernel/proclist.c
+++ b/sysdeps/kernel/proclist.c
@@ -56,7 +56,7 @@ glibtop_init_proclist_s (glibtop *server)
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
union table tbl;
unsigned *pids_chain;
diff --git a/sysdeps/linux/proclist.c b/sysdeps/linux/proclist.c
index 9728ee92..33faf179 100644
--- a/sysdeps/linux/proclist.c
+++ b/sysdeps/linux/proclist.c
@@ -62,7 +62,7 @@ glibtop_init_proclist_s (glibtop *server)
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
DIR *proc;
struct dirent *entry;
diff --git a/sysdeps/osf1/proclist.c b/sysdeps/osf1/proclist.c
index 7ab357c4..3caf81ad 100644
--- a/sysdeps/osf1/proclist.c
+++ b/sysdeps/osf1/proclist.c
@@ -66,7 +66,7 @@ glibtop_init_proclist_p (glibtop *server)
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
unsigned count = 0, total = 0;
unsigned pids [BLOCK_COUNT], *pids_chain = NULL;
diff --git a/sysdeps/solaris/proclist.c b/sysdeps/solaris/proclist.c
index 84fb5ea1..9b3be69e 100644
--- a/sysdeps/solaris/proclist.c
+++ b/sysdeps/solaris/proclist.c
@@ -55,7 +55,7 @@ glibtop_init_proclist_s (glibtop *server)
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
DIR *proc;
struct dirent *entry;
diff --git a/sysdeps/stub/proclist.c b/sysdeps/stub/proclist.c
index 7794cdba..0bb5ea07 100644
--- a/sysdeps/stub/proclist.c
+++ b/sysdeps/stub/proclist.c
@@ -45,7 +45,7 @@ glibtop_init_proclist_s (glibtop *server)
unsigned *
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
memset (buf, 0, sizeof (glibtop_proclist));
return NULL;
diff --git a/sysdeps/stub_suid/proclist.c b/sysdeps/stub_suid/proclist.c
index 41b50e0f..38171fce 100644
--- a/sysdeps/stub_suid/proclist.c
+++ b/sysdeps/stub_suid/proclist.c
@@ -39,7 +39,7 @@ glibtop_init_proclist_p (glibtop *server)
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
glibtop_init_p (server, GLIBTOP_SYSDEPS_PROCLIST, 0);
diff --git a/sysdeps/sun4/proclist.c b/sysdeps/sun4/proclist.c
index af38ec79..dd13e0c1 100644
--- a/sysdeps/sun4/proclist.c
+++ b/sysdeps/sun4/proclist.c
@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_proclist =
unsigned *
glibtop_get_proclist_p (glibtop *server, glibtop_proclist *buf,
- int64_t which, int64_t arg)
+ gint64 which, gint64 arg)
{
register struct proc *pp;
register int i, nproc = 0;