added 'dummy' member so 'GLIBTOP_SYSDEPS_<feature>' now start with 1.

* include/glibtop/sysdeps.h: added 'dummy' member so
'GLIBTOP_SYSDEPS_<feature>' now start with 1.

* include/glibtop/*.h: we now #define 'glibtop_get_<feature>'
as 'glibtop_get_<feature>__l' and 'glibtop_get_<feature>__r'
either as the '__p' or the '__s' function.
This commit is contained in:
Martin Baulig
1998-06-01 15:14:50 +00:00
parent 67798e0d7d
commit b7be9a7141
19 changed files with 103 additions and 84 deletions

View File

@@ -28,26 +28,25 @@
__BEGIN_DECLS
#define GLIBTOP_CMND_QUIT 0
#define GLIBTOP_CMND_SYSDEPS 1
#define GLIBTOP_CMND_CPU 2
#define GLIBTOP_CMND_MEM 3
#define GLIBTOP_CMND_SWAP 4
#define GLIBTOP_CMND_UPTIME 5
#define GLIBTOP_CMND_LOADAVG 6
#define GLIBTOP_CMND_SHM_LIMITS 7
#define GLIBTOP_CMND_MSG_LIMITS 8
#define GLIBTOP_CMND_SEM_LIMITS 9
#define GLIBTOP_CMND_PROCLIST 10
#define GLIBTOP_CMND_CPU 1
#define GLIBTOP_CMND_MEM 2
#define GLIBTOP_CMND_SWAP 3
#define GLIBTOP_CMND_UPTIME 4
#define GLIBTOP_CMND_LOADAVG 5
#define GLIBTOP_CMND_SHM_LIMITS 6
#define GLIBTOP_CMND_MSG_LIMITS 7
#define GLIBTOP_CMND_SEM_LIMITS 8
#define GLIBTOP_CMND_PROCLIST 9
#define GLIBTOP_CMND_PROC_STATE 11
#define GLIBTOP_CMND_PROC_UID 12
#define GLIBTOP_CMND_PROC_MEM 13
#define GLIBTOP_CMND_PROC_TIME 14
#define GLIBTOP_CMND_PROC_SIGNAL 15
#define GLIBTOP_CMND_PROC_KERNEL 16
#define GLIBTOP_CMND_PROC_SEGMENT 17
#define GLIBTOP_CMND_PROC_STATE 10
#define GLIBTOP_CMND_PROC_UID 11
#define GLIBTOP_CMND_PROC_MEM 12
#define GLIBTOP_CMND_PROC_TIME 13
#define GLIBTOP_CMND_PROC_SIGNAL 14
#define GLIBTOP_CMND_PROC_KERNEL 15
#define GLIBTOP_CMND_PROC_SEGMENT 16
#define GLIBTOP_MAX_CMND 18
#define GLIBTOP_MAX_CMND 17
typedef struct _glibtop_command glibtop_command;

View File

@@ -49,16 +49,17 @@ struct _glibtop_cpu
frequency; /* GLIBTOP_CPU_FREQUENCY */
};
#define glibtop_get_cpu(cpu) glibtop_get_cpu__r(glibtop_global_server, cpu)
#define glibtop_get_cpu(cpu) glibtop_get_cpu__l(glibtop_global_server, cpu)
#if GLIBTOP_SUID_CPU
#define glibtop_get_cpu__r glibtop_get_cpu__l
#define glibtop_get_cpu__r glibtop_get_cpu__p
#else
#define glibtop_get_cpu__r glibtop_get_cpu__s
#endif
#if GLIBTOP_SUID_CPU
extern void glibtop_get_cpu__l __P((glibtop *, glibtop_cpu *));
#if GLIBTOP_SUID_CPU
extern void glibtop_get_cpu__p __P((glibtop *, glibtop_cpu *));
#else
extern void glibtop_get_cpu__s __P((glibtop *, glibtop_cpu *));

View File

@@ -39,16 +39,17 @@ struct _glibtop_loadavg
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
};
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg__r(glibtop_global_server, loadavg)
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg__l(glibtop_global_server, loadavg)
#if GLIBTOP_SUID_LOADAVG
#define glibtop_get_loadavg__r glibtop_get_loadavg__l
#define glibtop_get_loadavg__r glibtop_get_loadavg__p
#else
#define glibtop_get_loadavg__r glibtop_get_loadavg__s
#endif
#if GLIBTOP_SUID_LOADAVG
extern void glibtop_get_loadavg__l __P((glibtop *, glibtop_loadavg *));
#if GLIBTOP_SUID_LOADAVG
extern void glibtop_get_loadavg__p __P((glibtop *, glibtop_loadavg *));
#else
extern void glibtop_get_loadavg__s __P((glibtop *, glibtop_loadavg *));

View File

@@ -53,16 +53,17 @@ struct _glibtop_mem
locked; /* GLIBTOP_MEM_LOCKED */
};
#define glibtop_get_mem(mem) glibtop_get_mem__r(glibtop_global_server, mem)
#define glibtop_get_mem(mem) glibtop_get_mem__l(glibtop_global_server, mem)
#if GLIBTOP_SUID_MEM
#define glibtop_get_mem__r glibtop_get_mem__l
#define glibtop_get_mem__r glibtop_get_mem__p
#else
#define glibtop_get_mem__r glibtop_get_mem__s
#endif
#if GLIBTOP_SUID_MEM
extern void glibtop_get_mem__l __P((glibtop *, glibtop_mem *));
#if GLIBTOP_SUID_MEM
extern void glibtop_get_mem__p __P((glibtop *, glibtop_mem *));
#else
extern void glibtop_get_mem__s __P((glibtop *, glibtop_mem *));

View File

@@ -51,16 +51,17 @@ struct _glibtop_msg_limits
msgtql; /* GLIBTOP_IPC_MSGTQL */
};
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits__r(glibtop_global_server, msg)
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits__l(glibtop_global_server, msg)
#if GLIBTOP_SUID_MSG_LIMITS
#define glibtop_get_msg_limits__r glibtop_get_msg_limits__l
#define glibtop_get_msg_limits__r glibtop_get_msg_limits__p
#else
#define glibtop_get_msg_limits__r glibtop_get_msg_limits__s
#endif
#if GLIBTOP_SUID_MSG_LIMITS
extern void glibtop_get_msg_limits__l __P((glibtop *, glibtop_msg_limits *));
#if GLIBTOP_SUID_MSG_LIMITS
extern void glibtop_get_msg_limits__p __P((glibtop *, glibtop_msg_limits *));
#else
extern void glibtop_get_msg_limits__s __P((glibtop *, glibtop_msg_limits *));

View File

@@ -26,7 +26,9 @@
__BEGIN_DECLS
extern void glibtop_open __P((glibtop *, const char *));
#define GLIBTOP_OPEN_IMMEDIATE 1
extern void glibtop_open __P((glibtop *, const char *, const unsigned long, const unsigned));
__END_DECLS

View File

@@ -60,16 +60,17 @@ struct _glibtop_proc_kernel
* proc is sleeping in */
};
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_KERNEL
#define glibtop_get_proc_kernel__r glibtop_get_proc_kernel__l
#define glibtop_get_proc_kernel__r glibtop_get_proc_kernel__p
#else
#define glibtop_get_proc_kernel__r glibtop_get_proc_kernel__s
#endif
#if GLIBTOP_SUID_PROC_KERNEL
extern void glibtop_get_proc_kernel__l __P((glibtop *, glibtop_proc_kernel *, pid_t));
#if GLIBTOP_SUID_PROC_KERNEL
extern void glibtop_get_proc_kernel__p __P((glibtop *, glibtop_proc_kernel *, pid_t));
#else
extern void glibtop_get_proc_kernel__s __P((glibtop *, glibtop_proc_kernel *, pid_t));

View File

@@ -43,16 +43,17 @@ struct _glibtop_proclist
size; /* GLIBTOP_PROCLIST_SIZE */
};
#define glibtop_get_proclist(proclist) glibtop_get_proclist__r(glibtop_global_server, proclist)
#define glibtop_get_proclist(proclist) glibtop_get_proclist__l(glibtop_global_server, proclist)
#if GLIBTOP_SUID_PROCLIST
#define glibtop_get_proclist__r glibtop_get_proclist__l
#define glibtop_get_proclist__r glibtop_get_proclist__p
#else
#define glibtop_get_proclist__r glibtop_get_proclist__s
#endif
#if GLIBTOP_SUID_PROCLIST
extern unsigned *glibtop_get_proclist__l __P((glibtop *, glibtop_proclist *));
#if GLIBTOP_SUID_PROCLIST
extern unsigned *glibtop_get_proclist__p __P((glibtop *, glibtop_proclist *));
#else
extern unsigned *glibtop_get_proclist__s __P((glibtop *, glibtop_proclist *));

View File

@@ -53,16 +53,17 @@ struct _glibtop_proc_mem
* of the process; usually 2,147,483,647 */
};
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_MEM
#define glibtop_get_proc_mem__r glibtop_get_proc_mem__l
#define glibtop_get_proc_mem__r glibtop_get_proc_mem__p
#else
#define glibtop_get_proc_mem__r glibtop_get_proc_mem__s
#endif
#if GLIBTOP_SUID_PROC_MEM
extern void glibtop_get_proc_mem__l __P((glibtop *, glibtop_proc_mem *, pid_t));
#if GLIBTOP_SUID_PROC_MEM
extern void glibtop_get_proc_mem__p __P((glibtop *, glibtop_proc_mem *, pid_t));
#else
extern void glibtop_get_proc_mem__s __P((glibtop *, glibtop_proc_mem *, pid_t));

View File

@@ -54,16 +54,17 @@ struct _glibtop_proc_segment
start_stack; /* address of the bottom of stack segment */
};
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_SEGMENT
#define glibtop_get_proc_segment__r glibtop_get_proc_segment__l
#define glibtop_get_proc_segment__r glibtop_get_proc_segment__p
#else
#define glibtop_get_proc_segment__r glibtop_get_proc_segment__s
#endif
#if GLIBTOP_SUID_PROC_SEGMENT
extern void glibtop_get_proc_segment__l __P((glibtop *, glibtop_proc_segment *, pid_t));
#if GLIBTOP_SUID_PROC_SEGMENT
extern void glibtop_get_proc_segment__p __P((glibtop *, glibtop_proc_segment *, pid_t));
#else
extern void glibtop_get_proc_segment__s __P((glibtop *, glibtop_proc_segment *, pid_t));

View File

@@ -47,16 +47,17 @@ struct _glibtop_proc_signal
sigcatch; /* mask of caught signals */
};
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_SIGNAL
#define glibtop_get_proc_signal__r glibtop_get_proc_signal__l
#define glibtop_get_proc_signal__r glibtop_get_proc_signal__p
#else
#define glibtop_get_proc_signal__r glibtop_get_proc_signal__s
#endif
#if GLIBTOP_SUID_PROC_SIGNAL
extern void glibtop_get_proc_signal__l __P((glibtop *, glibtop_proc_signal *, pid_t));
#if GLIBTOP_SUID_PROC_SIGNAL
extern void glibtop_get_proc_signal__p __P((glibtop *, glibtop_proc_signal *, pid_t));
#else
extern void glibtop_get_proc_signal__s __P((glibtop *, glibtop_proc_signal *, pid_t));

View File

@@ -54,16 +54,17 @@ struct _glibtop_proc_state
gid; /* GID of process */
};
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_STATE
#define glibtop_get_proc_state__r glibtop_get_proc_state__l
#define glibtop_get_proc_state__r glibtop_get_proc_state__p
#else
#define glibtop_get_proc_state__r glibtop_get_proc_state__s
#endif
#if GLIBTOP_SUID_PROC_STATE
extern void glibtop_get_proc_state__l __P((glibtop *, glibtop_proc_state *, pid_t));
#if GLIBTOP_SUID_PROC_STATE
extern void glibtop_get_proc_state__p __P((glibtop *, glibtop_proc_state *, pid_t));
#else
extern void glibtop_get_proc_state__s __P((glibtop *, glibtop_proc_state *, pid_t));

View File

@@ -59,16 +59,17 @@ struct _glibtop_proc_time
* due to an interval timer. */
};
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_TIME
#define glibtop_get_proc_time__r glibtop_get_proc_time__l
#define glibtop_get_proc_time__r glibtop_get_proc_time__p
#else
#define glibtop_get_proc_time__r glibtop_get_proc_time__s
#endif
#if GLIBTOP_SUID_PROC_TIME
extern void glibtop_get_proc_time__l __P((glibtop *, glibtop_proc_time *, pid_t));
#if GLIBTOP_SUID_PROC_TIME
extern void glibtop_get_proc_time__p __P((glibtop *, glibtop_proc_time *, pid_t));
#else
extern void glibtop_get_proc_time__s __P((glibtop *, glibtop_proc_time *, pid_t));

View File

@@ -63,16 +63,17 @@ struct _glibtop_proc_uid
nice; /* standard unix nice level of process */
};
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid__r(glibtop_global_server, p1, p2)
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid__l(glibtop_global_server, p1, p2)
#if GLIBTOP_SUID_PROC_UID
#define glibtop_get_proc_uid__r glibtop_get_proc_uid__l
#define glibtop_get_proc_uid__r glibtop_get_proc_uid__p
#else
#define glibtop_get_proc_uid__r glibtop_get_proc_uid__s
#endif
#if GLIBTOP_SUID_PROC_UID
extern void glibtop_get_proc_uid__l __P((glibtop *, glibtop_proc_uid *, pid_t));
#if GLIBTOP_SUID_PROC_UID
extern void glibtop_get_proc_uid__p __P((glibtop *, glibtop_proc_uid *, pid_t));
#else
extern void glibtop_get_proc_uid__s __P((glibtop *, glibtop_proc_uid *, pid_t));

View File

@@ -57,16 +57,17 @@ struct _glibtop_sem_limits
semaem; /* GLIBTOP_IPC_SEMAEM */
};
#define glibtop_get_sem_limits(sem) glibtop_get_sem_limits__r(glibtop_global_server, sem)
#define glibtop_get_sem_limits(sem) glibtop_get_sem_limits__l(glibtop_global_server, sem)
#if GLIBTOP_SUID_SEM_LIMITS
#define glibtop_get_sem_limits__r glibtop_get_sem_limits__l
#define glibtop_get_sem_limits__r glibtop_get_sem_limits__p
#else
#define glibtop_get_sem_limits__r glibtop_get_sem_limits__s
#endif
#if GLIBTOP_SUID_SEM_LIMITS
extern void glibtop_get_sem_limits__l __P((glibtop *, glibtop_sem_limits *));
#if GLIBTOP_SUID_SEM_LIMITS
extern void glibtop_get_sem_limits__p __P((glibtop *, glibtop_sem_limits *));
#else
extern void glibtop_get_sem_limits__s __P((glibtop *, glibtop_sem_limits *));

View File

@@ -47,16 +47,17 @@ struct _glibtop_shm_limits
shmall; /* GLIBTOP_IPC_SHMALL */
};
#define glibtop_get_shm_limits(shm) glibtop_get_shm_limits__r(glibtop_global_server, shm)
#define glibtop_get_shm_limits(shm) glibtop_get_shm_limits__l(glibtop_global_server, shm)
#if GLIBTOP_SUID_SHM_LIMITS
#define glibtop_get_shm_limits__r glibtop_get_shm_limits__l
#define glibtop_get_shm_limits__r glibtop_get_shm_limits__p
#else
#define glibtop_get_shm_limits__r glibtop_get_shm_limits__s
#endif
#if GLIBTOP_SUID_SHM_LIMITS
extern void glibtop_get_shm_limits__l __P((glibtop *, glibtop_shm_limits *));
#if GLIBTOP_SUID_SHM_LIMITS
extern void glibtop_get_shm_limits__p __P((glibtop *, glibtop_shm_limits *));
#else
extern void glibtop_get_shm_limits__s __P((glibtop *, glibtop_shm_limits *));

View File

@@ -43,16 +43,17 @@ struct _glibtop_swap
free; /* GLIBTOP_SWAP_FREE */
};
#define glibtop_get_swap(swap) glibtop_get_swap__r(glibtop_global_server, swap)
#define glibtop_get_swap(swap) glibtop_get_swap__l(glibtop_global_server, swap)
#if GLIBTOP_SUID_SWAP
#define glibtop_get_swap__r glibtop_get_swap__l
#define glibtop_get_swap__r glibtop_get_swap__p
#else
#define glibtop_get_swap__r glibtop_get_swap__s
#endif
#if GLIBTOP_SUID_SWAP
extern void glibtop_get_swap__l __P((glibtop *, glibtop_swap *));
#if GLIBTOP_SUID_SWAP
extern void glibtop_get_swap__p __P((glibtop *, glibtop_swap *));
#else
extern void glibtop_get_swap__s __P((glibtop *, glibtop_swap *));

View File

@@ -27,30 +27,32 @@
__BEGIN_DECLS
#define GLIBTOP_SYSDEPS_CPU 0
#define GLIBTOP_SYSDEPS_MEM 1
#define GLIBTOP_SYSDEPS_SWAP 2
#define GLIBTOP_SYSDEPS_UPTIME 3
#define GLIBTOP_SYSDEPS_LOADAVG 4
#define GLIBTOP_SYSDEPS_SHM_LIMITS 5
#define GLIBTOP_SYSDEPS_MSG_LIMITS 6
#define GLIBTOP_SYSDEPS_SEM_LIMITS 7
#define GLIBTOP_SYSDEPS_PROCLIST 8
#define GLIBTOP_SYSDEPS_PROC_STATE 9
#define GLIBTOP_SYSDEPS_PROC_UID 10
#define GLIBTOP_SYSDEPS_PROC_MEM 11
#define GLIBTOP_SYSDEPS_PROC_TIME 12
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 13
#define GLIBTOP_SYSDEPS_PROC_KERNEL 14
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 15
#define GLIBTOP_SYSDEPS_DUMMY 0
#define GLIBTOP_SYSDEPS_CPU 1
#define GLIBTOP_SYSDEPS_MEM 2
#define GLIBTOP_SYSDEPS_SWAP 3
#define GLIBTOP_SYSDEPS_UPTIME 4
#define GLIBTOP_SYSDEPS_LOADAVG 5
#define GLIBTOP_SYSDEPS_SHM_LIMITS 6
#define GLIBTOP_SYSDEPS_MSG_LIMITS 7
#define GLIBTOP_SYSDEPS_SEM_LIMITS 8
#define GLIBTOP_SYSDEPS_PROCLIST 9
#define GLIBTOP_SYSDEPS_PROC_STATE 10
#define GLIBTOP_SYSDEPS_PROC_UID 11
#define GLIBTOP_SYSDEPS_PROC_MEM 12
#define GLIBTOP_SYSDEPS_PROC_TIME 13
#define GLIBTOP_SYSDEPS_PROC_SIGNAL 14
#define GLIBTOP_SYSDEPS_PROC_KERNEL 15
#define GLIBTOP_SYSDEPS_PROC_SEGMENT 16
#define GLIBTOP_MAX_SYSDEPS 16
#define GLIBTOP_MAX_SYSDEPS 17
typedef struct _glibtop_sysdeps glibtop_sysdeps;
struct _glibtop_sysdeps
{
unsigned long flags,
dummy, /* dummy field */
cpu, /* glibtop_cpu */
mem, /* glibtop_mem */
swap, /* glibtop_swap */

View File

@@ -41,16 +41,17 @@ struct _glibtop_uptime
idletime; /* GLIBTOP_UPTIME_IDLETIME */
};
#define glibtop_get_uptime(uptime) glibtop_get_uptime__r(glibtop_global_server, uptime)
#define glibtop_get_uptime(uptime) glibtop_get_uptime__l(glibtop_global_server, uptime)
#if GLIBTOP_SUID_UPTIME
#define glibtop_get_uptime__r glibtop_get_uptime__l
#define glibtop_get_uptime__r glibtop_get_uptime__p
#else
#define glibtop_get_uptime__r glibtop_get_uptime__s
#endif
#if GLIBTOP_SUID_UPTIME
extern void glibtop_get_uptime__l __P((glibtop *, glibtop_uptime *));
#if GLIBTOP_SUID_UPTIME
extern void glibtop_get_uptime__p __P((glibtop *, glibtop_uptime *));
#else
extern void glibtop_get_uptime__s __P((glibtop *, glibtop_uptime *));