diff --git a/glibtop.h b/glibtop.h index 2d4756f0..adfd95d6 100644 --- a/glibtop.h +++ b/glibtop.h @@ -25,6 +25,7 @@ #include #include +#include #ifdef HAVE_GLIBTOP_MACHINE_H #include diff --git a/include/glibtop/types.h b/include/glibtop/types.h new file mode 100644 index 00000000..b622426f --- /dev/null +++ b/include/glibtop/types.h @@ -0,0 +1,36 @@ +/* $Id$ */ + +/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. + This file is part of the Gnome Top Library. + Contributed by Martin Baulig , April 1998. + + The Gnome Top Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The Gnome Top Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef __GLIBTOP_TYPES_H__ +#define __GLIBTOP_TYPES_H__ + +__BEGIN_DECLS + +#define GLIBTOP_TYPE_LONG 1 +#define GLIBTOP_TYPE_ULONG 2 +#define GLIBTOP_TYPE_DOUBLE 3 +#define GLIBTOP_TYPE_INT 4 +#define GLIBTOP_TYPE_CHAR 5 +#define GLIBTOP_TYPE_STRING 6 + +__END_DECLS + +#endif diff --git a/sysdeps/names/cpu.c b/sysdeps/names/cpu.c index e33c9f95..8bf80d8d 100644 --- a/sysdeps/names/cpu.c +++ b/sysdeps/names/cpu.c @@ -28,8 +28,8 @@ const char *glibtop_names_cpu [GLIBTOP_MAX_CPU] = const char *glibtop_types_cpu [GLIBTOP_MAX_CPU] = { - "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_cpu [GLIBTOP_MAX_CPU] = diff --git a/sysdeps/names/loadavg.c b/sysdeps/names/loadavg.c index 4e41e621..351f3675 100644 --- a/sysdeps/names/loadavg.c +++ b/sysdeps/names/loadavg.c @@ -28,7 +28,7 @@ const char *glibtop_names_loadavg [GLIBTOP_MAX_LOADAVG] = const char *glibtop_types_loadavg [GLIBTOP_MAX_LOADAVG] = { - "double" + GLIBTOP_TYPE_DOUBLE }; const char *glibtop_labels_loadavg [GLIBTOP_MAX_LOADAVG] = diff --git a/sysdeps/names/mem.c b/sysdeps/names/mem.c index 4914b04d..534274ca 100644 --- a/sysdeps/names/mem.c +++ b/sysdeps/names/mem.c @@ -29,9 +29,9 @@ const char *glibtop_names_mem [GLIBTOP_MAX_MEM] = const char *glibtop_types_mem [GLIBTOP_MAX_MEM] = { - "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_mem [GLIBTOP_MAX_MEM] = diff --git a/sysdeps/names/msg_limits.c b/sysdeps/names/msg_limits.c index 46dbf7e8..a2a9ee1f 100644 --- a/sysdeps/names/msg_limits.c +++ b/sysdeps/names/msg_limits.c @@ -28,8 +28,9 @@ const char *glibtop_names_msg_limits [GLIBTOP_MAX_MSG_LIMITS] = const char *glibtop_types_msg_limits [GLIBTOP_MAX_MSG_LIMITS] = { - "unsigned long", "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_msg_limits [GLIBTOP_MAX_MSG_LIMITS] = diff --git a/sysdeps/names/prockernel.c b/sysdeps/names/prockernel.c index 20f4a87b..a9442100 100644 --- a/sysdeps/names/prockernel.c +++ b/sysdeps/names/prockernel.c @@ -30,8 +30,9 @@ const char *glibtop_names_proc_kernel [GLIBTOP_MAX_PROC_KERNEL] = const char *glibtop_types_proc_kernel [GLIBTOP_MAX_PROC_KERNEL] = { - "unsigned long", "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long", "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_proc_kernel [GLIBTOP_MAX_PROC_KERNEL] = diff --git a/sysdeps/names/proclist.c b/sysdeps/names/proclist.c index d5bf022d..b1c8a360 100644 --- a/sysdeps/names/proclist.c +++ b/sysdeps/names/proclist.c @@ -28,7 +28,7 @@ const char *glibtop_names_proclist [GLIBTOP_MAX_PROCLIST] = const char *glibtop_types_proclist [GLIBTOP_MAX_PROCLIST] = { - "unsigned long", "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_proclist [GLIBTOP_MAX_PROCLIST] = diff --git a/sysdeps/names/procmem.c b/sysdeps/names/procmem.c index 920f1a8b..eeb5f46f 100644 --- a/sysdeps/names/procmem.c +++ b/sysdeps/names/procmem.c @@ -36,7 +36,8 @@ const char *glibtop_names_proc_mem [GLIBTOP_MAX_PROC_MEM] = const char *glibtop_types_proc_mem [GLIBTOP_MAX_PROC_MEM] = { - "long", "long", "long", "long", "long", "long" + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG }; const char *glibtop_labels_proc_mem [GLIBTOP_MAX_PROC_MEM] = diff --git a/sysdeps/names/procsegment.c b/sysdeps/names/procsegment.c index 85a89304..fd81b9e3 100644 --- a/sysdeps/names/procsegment.c +++ b/sysdeps/names/procsegment.c @@ -29,8 +29,9 @@ const char *glibtop_names_proc_segment [GLIBTOP_MAX_PROC_SEGMENT] = const char *glibtop_types_proc_segment [GLIBTOP_MAX_PROC_SEGMENT] = { - "long", "long", "long", "long", "unsigned long", - "unsigned long", "unsigned long" + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_proc_segment [GLIBTOP_MAX_PROC_SEGMENT] = diff --git a/sysdeps/names/procsignal.c b/sysdeps/names/procsignal.c index a278e60b..fe915a51 100644 --- a/sysdeps/names/procsignal.c +++ b/sysdeps/names/procsignal.c @@ -29,7 +29,8 @@ const char *glibtop_names_proc_signal [GLIBTOP_MAX_PROC_SIGNAL] = const char *glibtop_types_proc_signal [GLIBTOP_MAX_PROC_SIGNAL] = { - "int", "int", "int", "int" + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, + GLIBTOP_TYPE_INT }; const char *glibtop_labels_proc_signal [GLIBTOP_MAX_PROC_SIGNAL] = diff --git a/sysdeps/names/procstate.c b/sysdeps/names/procstate.c index bdd85499..d2a4511d 100644 --- a/sysdeps/names/procstate.c +++ b/sysdeps/names/procstate.c @@ -29,7 +29,8 @@ const char *glibtop_names_proc_state [GLIBTOP_MAX_PROC_STATE] = const char *glibtop_types_proc_state [GLIBTOP_MAX_PROC_STATE] = { - "char *", "char", "int", "int" + GLIBTOP_TYPE_STRING, GLIBTOP_TYPE_CHAR, + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT }; const char *glibtop_labels_proc_state [GLIBTOP_MAX_PROC_STATE] = diff --git a/sysdeps/names/proctime.c b/sysdeps/names/proctime.c index f7990b50..1010d6d7 100644 --- a/sysdeps/names/proctime.c +++ b/sysdeps/names/proctime.c @@ -38,7 +38,9 @@ const char *glibtop_names_proc_time [GLIBTOP_MAX_PROC_TIME] = const char *glibtop_types_proc_time [GLIBTOP_MAX_PROC_TIME] = { - "long", "long", "long", "long", "long", "long", "long" + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, + GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, GLIBTOP_TYPE_LONG, + GLIBTOP_TYPE_LONG }; const char *glibtop_labels_proc_time [GLIBTOP_MAX_PROC_TIME] = diff --git a/sysdeps/names/procuid.c b/sysdeps/names/procuid.c index 8d50f8bc..6f27d57f 100644 --- a/sysdeps/names/procuid.c +++ b/sysdeps/names/procuid.c @@ -43,8 +43,10 @@ const char *glibtop_names_proc_uid [GLIBTOP_MAX_PROC_UID] = const char *glibtop_types_proc_uid [GLIBTOP_MAX_PROC_UID] = { - "int", "int", "int", "int", "int", "int", "int", - "int", "int", "int", "int", "int" + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, + GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT, GLIBTOP_TYPE_INT }; const char *glibtop_labels_proc_uid [GLIBTOP_MAX_PROC_UID] = diff --git a/sysdeps/names/sem_limits.c b/sysdeps/names/sem_limits.c index a75d9192..86650fa4 100644 --- a/sysdeps/names/sem_limits.c +++ b/sysdeps/names/sem_limits.c @@ -29,9 +29,10 @@ const char *glibtop_names_sem_limits [GLIBTOP_MAX_SEM_LIMITS] = const char *glibtop_types_sem_limits [GLIBTOP_MAX_SEM_LIMITS] = { - "unsigned long", "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_sem_limits [GLIBTOP_MAX_SEM_LIMITS] = diff --git a/sysdeps/names/shm_limits.c b/sysdeps/names/shm_limits.c index 6786d2dc..1d0ce27d 100644 --- a/sysdeps/names/shm_limits.c +++ b/sysdeps/names/shm_limits.c @@ -28,8 +28,8 @@ const char *glibtop_names_shm_limits [GLIBTOP_MAX_SHM_LIMITS] = const char *glibtop_types_shm_limits [GLIBTOP_MAX_SHM_LIMITS] = { - "unsigned long", "unsigned long", "unsigned long", - "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_shm_limits [GLIBTOP_MAX_SHM_LIMITS] = diff --git a/sysdeps/names/swap.c b/sysdeps/names/swap.c index 06c51513..2b617f70 100644 --- a/sysdeps/names/swap.c +++ b/sysdeps/names/swap.c @@ -28,7 +28,7 @@ const char *glibtop_names_swap [GLIBTOP_MAX_SWAP] = const char *glibtop_types_swap [GLIBTOP_MAX_SWAP] = { - "unsigned long", "unsigned long", "unsigned long" + GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG }; const char *glibtop_labels_swap [GLIBTOP_MAX_SWAP] = diff --git a/sysdeps/names/uptime.c b/sysdeps/names/uptime.c index 6561c006..8271d729 100644 --- a/sysdeps/names/uptime.c +++ b/sysdeps/names/uptime.c @@ -28,7 +28,7 @@ const char *glibtop_names_uptime [GLIBTOP_MAX_UPTIME] = const char *glibtop_types_uptime [GLIBTOP_MAX_UPTIME] = { - "double", "double" + GLIBTOP_TYPE_DOUBLE, GLIBTOP_TYPE_DOUBLE }; const char *glibtop_labels_uptime [GLIBTOP_MAX_UPTIME] =