Using single underscore instead of two underscores for function prefixes

1998-06-07  Martin Baulig  <martin@home-of-linux.org>

	* *.[ch]: Using single underscore instead of two underscores
	for function prefixes (regexp: ``s,__([rspl])\b,_$1,g'') to
	avoid ambiguity with mangled C++ names.
This commit is contained in:
Martin Baulig
1998-06-07 13:57:45 +00:00
committed by Martin Baulig
parent 85f31a1707
commit c84923132a
129 changed files with 409 additions and 399 deletions

View File

@@ -1,3 +1,9 @@
1998-06-07 Martin Baulig <martin@home-of-linux.org>
* *.[ch]: Using single underscore instead of two underscores
for function prefixes (regexp: ``s,__([rspl])\b,_$1,g'') to
avoid ambiguity with mangled C++ names.
1998-06-06 Martin Baulig <martin@home-of-linux.org>
* sysdeps/osf1/glibtop_server.h: New file.

View File

@@ -55,9 +55,11 @@ extern glibtop *glibtop_global_server;
extern const unsigned long glibtop_server_features;
#define glibtop_init() glibtop_init__r(&glibtop_global_server, 0, 0);
#define glibtop_init() glibtop_init_r(&glibtop_global_server, 0, 0);
extern glibtop *glibtop_init__r __P((glibtop **, const unsigned long, const unsigned));
#define glibtop_close() glibtop_close_r(&glibtop_global_server);
extern glibtop *glibtop_init_r __P((glibtop **, const unsigned long, const unsigned));
#ifdef HAVE_GUILE

View File

@@ -26,7 +26,7 @@
__BEGIN_DECLS
extern void glibtop_close __P((glibtop *));
extern void glibtop_close_r __P((glibtop *));
__END_DECLS

View File

@@ -59,10 +59,10 @@ struct _glibtop_command
size_t size;
};
#define glibtop_call(p1, p2, p3, p4) glibtop_call__r(glibtop_global_server, p1, p2, p3, p4)
#define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4)
extern void *glibtop_call__l __P((glibtop *, unsigned, size_t, void *, size_t, void *));
extern void *glibtop_call__s __P((glibtop *, unsigned, size_t, void *, size_t, void *));
extern void *glibtop_call_l __P((glibtop *, unsigned, size_t, void *, size_t, void *));
extern void *glibtop_call_s __P((glibtop *, unsigned, size_t, void *, size_t, void *));
__END_DECLS

View File

@@ -49,20 +49,20 @@ struct _glibtop_cpu
frequency; /* GLIBTOP_CPU_FREQUENCY */
};
#define glibtop_get_cpu(cpu) glibtop_get_cpu__l(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__p
#define glibtop_get_cpu_r glibtop_get_cpu_p
#else
#define glibtop_get_cpu__r glibtop_get_cpu__s
#define glibtop_get_cpu_r glibtop_get_cpu_s
#endif
extern void glibtop_get_cpu__l __P((glibtop *, glibtop_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 *));
extern void glibtop_get_cpu_p __P((glibtop *, glibtop_cpu *));
#else
extern void glibtop_get_cpu__s __P((glibtop *, glibtop_cpu *));
extern void glibtop_get_cpu_s __P((glibtop *, glibtop_cpu *));
#endif
#ifdef HAVE_GUILE

View File

@@ -26,9 +26,9 @@
__BEGIN_DECLS
#define glibtop_error(p1, args...) glibtop_error__r(glibtop_global_server , p1 , ## args)
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
extern void glibtop_error__r __P((glibtop *, char *, ...));
extern void glibtop_error_r __P((glibtop *, char *, ...));
__END_DECLS

View File

@@ -39,20 +39,20 @@ struct _glibtop_loadavg
double loadavg [3]; /* GLIBTOP_LOADAVG_LOADAVG */
};
#define glibtop_get_loadavg(loadavg) glibtop_get_loadavg__l(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__p
#define glibtop_get_loadavg_r glibtop_get_loadavg_p
#else
#define glibtop_get_loadavg__r glibtop_get_loadavg__s
#define glibtop_get_loadavg_r glibtop_get_loadavg_s
#endif
extern void glibtop_get_loadavg__l __P((glibtop *, glibtop_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 *));
extern void glibtop_get_loadavg_p __P((glibtop *, glibtop_loadavg *));
#else
extern void glibtop_get_loadavg__s __P((glibtop *, glibtop_loadavg *));
extern void glibtop_get_loadavg_s __P((glibtop *, glibtop_loadavg *));
#endif
#ifdef HAVE_GUILE

View File

@@ -53,20 +53,20 @@ struct _glibtop_mem
locked; /* GLIBTOP_MEM_LOCKED */
};
#define glibtop_get_mem(mem) glibtop_get_mem__l(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__p
#define glibtop_get_mem_r glibtop_get_mem_p
#else
#define glibtop_get_mem__r glibtop_get_mem__s
#define glibtop_get_mem_r glibtop_get_mem_s
#endif
extern void glibtop_get_mem__l __P((glibtop *, glibtop_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 *));
extern void glibtop_get_mem_p __P((glibtop *, glibtop_mem *));
#else
extern void glibtop_get_mem__s __P((glibtop *, glibtop_mem *));
extern void glibtop_get_mem_s __P((glibtop *, glibtop_mem *));
#endif
#ifdef HAVE_GUILE

View File

@@ -51,20 +51,20 @@ struct _glibtop_msg_limits
msgtql; /* GLIBTOP_IPC_MSGTQL */
};
#define glibtop_get_msg_limits(msg) glibtop_get_msg_limits__l(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__p
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_p
#else
#define glibtop_get_msg_limits__r glibtop_get_msg_limits__s
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_s
#endif
extern void glibtop_get_msg_limits__l __P((glibtop *, glibtop_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 *));
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 *));
extern void glibtop_get_msg_limits_s __P((glibtop *, glibtop_msg_limits *));
#endif
#ifdef HAVE_GUILE

View File

@@ -28,9 +28,9 @@ __BEGIN_DECLS
#define GLIBTOP_OPEN_NO_OVERRIDE 1
extern void glibtop_open__l __P((glibtop *, const char *, const unsigned long, const unsigned));
extern void glibtop_open_l __P((glibtop *, const char *, const unsigned long, const unsigned));
extern void glibtop_open__r __P((glibtop *, const char *, const unsigned long, const unsigned));
extern void glibtop_open_r __P((glibtop *, const char *, const unsigned long, const unsigned));
__END_DECLS

View File

@@ -60,20 +60,20 @@ struct _glibtop_proc_kernel
* proc is sleeping in */
};
#define glibtop_get_proc_kernel(p1, p2) glibtop_get_proc_kernel__l(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__p
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_p
#else
#define glibtop_get_proc_kernel__r glibtop_get_proc_kernel__s
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_s
#endif
extern void glibtop_get_proc_kernel__l __P((glibtop *, glibtop_proc_kernel *, pid_t));
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));
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));
extern void glibtop_get_proc_kernel_s __P((glibtop *, glibtop_proc_kernel *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -43,20 +43,20 @@ struct _glibtop_proclist
size; /* GLIBTOP_PROCLIST_SIZE */
};
#define glibtop_get_proclist(proclist) glibtop_get_proclist__l(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__p
#define glibtop_get_proclist_r glibtop_get_proclist_p
#else
#define glibtop_get_proclist__r glibtop_get_proclist__s
#define glibtop_get_proclist_r glibtop_get_proclist_s
#endif
extern unsigned *glibtop_get_proclist__l __P((glibtop *, glibtop_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 *));
extern unsigned *glibtop_get_proclist_p __P((glibtop *, glibtop_proclist *));
#else
extern unsigned *glibtop_get_proclist__s __P((glibtop *, glibtop_proclist *));
extern unsigned *glibtop_get_proclist_s __P((glibtop *, glibtop_proclist *));
#endif
#ifdef HAVE_GUILE

View File

@@ -53,20 +53,20 @@ struct _glibtop_proc_mem
* of the process; usually 2,147,483,647 */
};
#define glibtop_get_proc_mem(p1, p2) glibtop_get_proc_mem__l(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__p
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_p
#else
#define glibtop_get_proc_mem__r glibtop_get_proc_mem__s
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_s
#endif
extern void glibtop_get_proc_mem__l __P((glibtop *, glibtop_proc_mem *, pid_t));
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));
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));
extern void glibtop_get_proc_mem_s __P((glibtop *, glibtop_proc_mem *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -54,20 +54,20 @@ struct _glibtop_proc_segment
start_stack; /* address of the bottom of stack segment */
};
#define glibtop_get_proc_segment(p1, p2) glibtop_get_proc_segment__l(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__p
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_p
#else
#define glibtop_get_proc_segment__r glibtop_get_proc_segment__s
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_s
#endif
extern void glibtop_get_proc_segment__l __P((glibtop *, glibtop_proc_segment *, pid_t));
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));
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));
extern void glibtop_get_proc_segment_s __P((glibtop *, glibtop_proc_segment *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -47,20 +47,20 @@ struct _glibtop_proc_signal
sigcatch; /* mask of caught signals */
};
#define glibtop_get_proc_signal(p1, p2) glibtop_get_proc_signal__l(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__p
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_p
#else
#define glibtop_get_proc_signal__r glibtop_get_proc_signal__s
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_s
#endif
extern void glibtop_get_proc_signal__l __P((glibtop *, glibtop_proc_signal *, pid_t));
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));
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));
extern void glibtop_get_proc_signal_s __P((glibtop *, glibtop_proc_signal *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -54,20 +54,20 @@ struct _glibtop_proc_state
gid; /* GID of process */
};
#define glibtop_get_proc_state(p1, p2) glibtop_get_proc_state__l(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__p
#define glibtop_get_proc_state_r glibtop_get_proc_state_p
#else
#define glibtop_get_proc_state__r glibtop_get_proc_state__s
#define glibtop_get_proc_state_r glibtop_get_proc_state_s
#endif
extern void glibtop_get_proc_state__l __P((glibtop *, glibtop_proc_state *, pid_t));
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));
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));
extern void glibtop_get_proc_state_s __P((glibtop *, glibtop_proc_state *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -59,20 +59,20 @@ struct _glibtop_proc_time
* due to an interval timer. */
};
#define glibtop_get_proc_time(p1, p2) glibtop_get_proc_time__l(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__p
#define glibtop_get_proc_time_r glibtop_get_proc_time_p
#else
#define glibtop_get_proc_time__r glibtop_get_proc_time__s
#define glibtop_get_proc_time_r glibtop_get_proc_time_s
#endif
extern void glibtop_get_proc_time__l __P((glibtop *, glibtop_proc_time *, pid_t));
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));
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));
extern void glibtop_get_proc_time_s __P((glibtop *, glibtop_proc_time *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -63,20 +63,20 @@ struct _glibtop_proc_uid
nice; /* standard unix nice level of process */
};
#define glibtop_get_proc_uid(p1, p2) glibtop_get_proc_uid__l(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__p
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_p
#else
#define glibtop_get_proc_uid__r glibtop_get_proc_uid__s
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_s
#endif
extern void glibtop_get_proc_uid__l __P((glibtop *, glibtop_proc_uid *, pid_t));
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));
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));
extern void glibtop_get_proc_uid_s __P((glibtop *, glibtop_proc_uid *, pid_t));
#endif
#ifdef HAVE_GUILE

View File

@@ -29,8 +29,8 @@ __BEGIN_DECLS
#define glibtop_read(p1, p2) glibtop_read(glibtop_global_server, p1, p2)
extern void glibtop_read__l __P((glibtop *, size_t, void *));
extern void glibtop_read__s __P((glibtop *, size_t, void *));
extern void glibtop_read_l __P((glibtop *, size_t, void *));
extern void glibtop_read_s __P((glibtop *, size_t, void *));
__END_DECLS

View File

@@ -27,10 +27,10 @@
__BEGIN_DECLS
#define glibtop_read_data() glibtop_read_data__r(glibtop_global_server)
#define glibtop_read_data() glibtop_read_data_r(glibtop_global_server)
extern void *glibtop_read_data__l __P((glibtop *));
extern void *glibtop_read_data__s __P((glibtop *));
extern void *glibtop_read_data_l __P((glibtop *));
extern void *glibtop_read_data_s __P((glibtop *));
__END_DECLS

View File

@@ -57,20 +57,20 @@ struct _glibtop_sem_limits
semaem; /* GLIBTOP_IPC_SEMAEM */
};
#define glibtop_get_sem_limits(sem) glibtop_get_sem_limits__l(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__p
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_p
#else
#define glibtop_get_sem_limits__r glibtop_get_sem_limits__s
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_s
#endif
extern void glibtop_get_sem_limits__l __P((glibtop *, glibtop_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 *));
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 *));
extern void glibtop_get_sem_limits_s __P((glibtop *, glibtop_sem_limits *));
#endif
#ifdef HAVE_GUILE

View File

@@ -47,20 +47,20 @@ struct _glibtop_shm_limits
shmall; /* GLIBTOP_IPC_SHMALL */
};
#define glibtop_get_shm_limits(shm) glibtop_get_shm_limits__l(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__p
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_p
#else
#define glibtop_get_shm_limits__r glibtop_get_shm_limits__s
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_s
#endif
extern void glibtop_get_shm_limits__l __P((glibtop *, glibtop_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 *));
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 *));
extern void glibtop_get_shm_limits_s __P((glibtop *, glibtop_shm_limits *));
#endif
#ifdef HAVE_GUILE

View File

@@ -43,20 +43,20 @@ struct _glibtop_swap
free; /* GLIBTOP_SWAP_FREE */
};
#define glibtop_get_swap(swap) glibtop_get_swap__l(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__p
#define glibtop_get_swap_r glibtop_get_swap_p
#else
#define glibtop_get_swap__r glibtop_get_swap__s
#define glibtop_get_swap_r glibtop_get_swap_s
#endif
extern void glibtop_get_swap__l __P((glibtop *, glibtop_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 *));
extern void glibtop_get_swap_p __P((glibtop *, glibtop_swap *));
#else
extern void glibtop_get_swap__s __P((glibtop *, glibtop_swap *));
extern void glibtop_get_swap_s __P((glibtop *, glibtop_swap *));
#endif
#ifdef HAVE_GUILE

View File

@@ -73,9 +73,9 @@ struct _glibtop_sysdeps
proc_segment; /* glibtop_proc_segment */
};
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps__r(glibtop_global_server,sysdeps)
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
extern void glibtop_get_sysdeps__r __P((glibtop *, glibtop_sysdeps *));
extern void glibtop_get_sysdeps_r __P((glibtop *, glibtop_sysdeps *));
#ifdef HAVE_GUILE

View File

@@ -41,20 +41,20 @@ struct _glibtop_uptime
idletime; /* GLIBTOP_UPTIME_IDLETIME */
};
#define glibtop_get_uptime(uptime) glibtop_get_uptime__l(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__p
#define glibtop_get_uptime_r glibtop_get_uptime_p
#else
#define glibtop_get_uptime__r glibtop_get_uptime__s
#define glibtop_get_uptime_r glibtop_get_uptime_s
#endif
extern void glibtop_get_uptime__l __P((glibtop *, glibtop_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 *));
extern void glibtop_get_uptime_p __P((glibtop *, glibtop_uptime *));
#else
extern void glibtop_get_uptime__s __P((glibtop *, glibtop_uptime *));
extern void glibtop_get_uptime_s __P((glibtop *, glibtop_uptime *));
#endif
#ifdef HAVE_GUILE

View File

@@ -29,8 +29,8 @@ __BEGIN_DECLS
#define glibtop_write(p1, p2) glibtop_write(glibtop_global_server, p1, p2)
extern void glibtop_write__l __P((glibtop *, size_t, void *));
extern void glibtop_write__s __P((glibtop *, size_t, void *));
extern void glibtop_write_l __P((glibtop *, size_t, void *));
extern void glibtop_write_s __P((glibtop *, size_t, void *));
__END_DECLS

View File

@@ -27,15 +27,15 @@
__BEGIN_DECLS
#define glibtop_malloc(p1) glibtop_malloc__r(glibtop_global_server, p1)
#define glibtop_calloc(p1, p2) glibtop_calloc__r(glibtop_global_server, p1, p2)
#define glibtop_realloc(p1, p2) glibtop_realloc__r(glibtop_global_server, p1, p2)
#define glibtop_free(p1) glibtop_free__r(glibtop_global_server, p1)
#define glibtop_malloc(p1) glibtop_malloc_r(glibtop_global_server, p1)
#define glibtop_calloc(p1, p2) glibtop_calloc_r(glibtop_global_server, p1, p2)
#define glibtop_realloc(p1, p2) glibtop_realloc_r(glibtop_global_server, p1, p2)
#define glibtop_free(p1) glibtop_free_r(glibtop_global_server, p1)
extern void *glibtop_malloc__r __P((glibtop *, size_t));
extern void *glibtop_calloc__r __P((glibtop *, size_t, size_t));
extern void *glibtop_realloc__r __P((glibtop *, void *, size_t));
extern void glibtop_free__r __P((glibtop *, void *));
extern void *glibtop_malloc_r __P((glibtop *, size_t));
extern void *glibtop_calloc_r __P((glibtop *, size_t, size_t));
extern void *glibtop_realloc_r __P((glibtop *, void *, size_t));
extern void glibtop_free_r __P((glibtop *, void *));
__END_DECLS

View File

@@ -24,7 +24,7 @@
/* Closes pipe to gtop server. */
void
glibtop_close (glibtop *server)
glibtop_close_r (glibtop *server)
{
kill (server->pid, SIGKILL);
close (server->input [0]);

View File

@@ -27,28 +27,28 @@
#include <glibtop/xmalloc.h>
void *
glibtop_call__l (glibtop *server, unsigned command, size_t send_size, void *send_buf,
glibtop_call_l (glibtop *server, unsigned command, size_t send_size, void *send_buf,
size_t recv_size, void *recv_buf)
{
glibtop_command *cmnd;
void *ptr;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
cmnd = glibtop_calloc__r (server, 1, sizeof (glibtop_command));
cmnd = glibtop_calloc_r (server, 1, sizeof (glibtop_command));
memcpy (&cmnd->server, server, sizeof (glibtop));
cmnd->command = command;
cmnd->size = send_size;
glibtop_write__l (server, sizeof (glibtop_command), cmnd);
glibtop_write__l (server, send_size, send_buf);
glibtop_read__l (server, recv_size, recv_buf);
glibtop_write_l (server, sizeof (glibtop_command), cmnd);
glibtop_write_l (server, send_size, send_buf);
glibtop_read_l (server, recv_size, recv_buf);
ptr = glibtop_read_data__l (server);
ptr = glibtop_read_data_l (server);
glibtop_free__r (server, cmnd);
glibtop_free_r (server, cmnd);
return ptr;
}

View File

@@ -26,14 +26,14 @@
/* Provides information about cpu usage. */
void
glibtop_get_cpu__l (glibtop *server, glibtop_cpu *buf)
glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_CPU, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_CPU, 0);
if (server->features & GLIBTOP_SYSDEPS_CPU) {
glibtop_call__l (server, GLIBTOP_CMND_CPU, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_CPU, 0, NULL,
sizeof (glibtop_cpu), buf);
} else {
glibtop_get_cpu__r (server, buf);
glibtop_get_cpu_r (server, buf);
}
}

View File

@@ -26,7 +26,7 @@ static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = NULL;
glibtop *
glibtop_init__r (glibtop **server, const unsigned long features,
glibtop_init_r (glibtop **server, const unsigned long features,
const unsigned flags)
{
if (*server != NULL)
@@ -34,7 +34,7 @@ glibtop_init__r (glibtop **server, const unsigned long features,
if (glibtop_global_server == NULL) {
glibtop_global_server = &_glibtop_global_server;
glibtop_open__l (glibtop_global_server, "glibtop",
glibtop_open_l (glibtop_global_server, "glibtop",
features, flags);
}

View File

@@ -26,14 +26,14 @@
/* Provides load averange. */
void
glibtop_get_loadavg__l (glibtop *server, glibtop_loadavg *buf)
glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
if (server->features & GLIBTOP_SYSDEPS_LOADAVG) {
glibtop_call__l (server, GLIBTOP_CMND_LOADAVG, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_LOADAVG, 0, NULL,
sizeof (glibtop_loadavg), buf);
} else {
glibtop_get_loadavg__r (server, buf);
glibtop_get_loadavg_r (server, buf);
}
}

View File

@@ -25,14 +25,14 @@
/* Provides information about memory usage. */
void
glibtop_get_mem__l (glibtop *server, glibtop_mem *buf)
glibtop_get_mem_l (glibtop *server, glibtop_mem *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_MEM, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_MEM, 0);
if (server->features & GLIBTOP_SYSDEPS_MEM) {
glibtop_call__l (server, GLIBTOP_CMND_MEM, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_MEM, 0, NULL,
sizeof (glibtop_mem), buf);
} else {
glibtop_get_mem__r (server, buf);
glibtop_get_mem_r (server, buf);
}
}

View File

@@ -25,14 +25,14 @@
/* Provides information about sysv ipc limits. */
void
glibtop_get_msg_limits__l (glibtop *server, glibtop_msg_limits *buf)
glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
if (server->features & GLIBTOP_SYSDEPS_MSG_LIMITS) {
glibtop_call__l (server, GLIBTOP_CMND_MSG_LIMITS, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_MSG_LIMITS, 0, NULL,
sizeof (glibtop_msg_limits), buf);
} else {
glibtop_get_msg_limits__r (server, buf);
glibtop_get_msg_limits_r (server, buf);
}
}

View File

@@ -28,7 +28,7 @@
/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */
void
glibtop_open__l (glibtop *server, const char *program_name,
glibtop_open_l (glibtop *server, const char *program_name,
const unsigned long features, const unsigned flags)
{
char version [BUFSIZ], buffer [BUFSIZ];
@@ -49,14 +49,14 @@ glibtop_open__l (glibtop *server, const char *program_name,
temp = getenv ("LIBGTOP_SERVER") ?
getenv ("LIBGTOP_SERVER") : GTOP_SERVER;
server_command = glibtop_malloc__r (server, strlen (temp) + 1);
server_command = glibtop_malloc_r (server, strlen (temp) + 1);
strcpy (server_command, temp);
temp = getenv ("LIBGTOP_RSH") ?
getenv ("LIBGTOP_RSH") : "rsh";
server_rsh = glibtop_malloc__r (server, strlen (temp) + 1);
server_rsh = glibtop_malloc_r (server, strlen (temp) + 1);
strcpy (server_rsh, temp);
@@ -103,13 +103,13 @@ glibtop_open__l (glibtop *server, const char *program_name,
/* Fork and exec server. */
if (pipe (server->input) || pipe (server->output))
glibtop_error__r (server, _("cannot make a pipe: %s\n"),
glibtop_error_r (server, _("cannot make a pipe: %s\n"),
strerror (errno));
server->pid = fork ();
if (server->pid < 0) {
glibtop_error__r (server, _("%s: fork failed: %s\n"),
glibtop_error_r (server, _("%s: fork failed: %s\n"),
strerror (errno));
} else if (server->pid == 0) {
close (0); close (1); /* close (2); */
@@ -140,14 +140,14 @@ glibtop_open__l (glibtop *server, const char *program_name,
sprintf (version, "%s server %s ready.\n", PACKAGE, VERSION);
glibtop_read__l (server, strlen (version), buffer);
glibtop_read_l (server, strlen (version), buffer);
if (memcmp (version, buffer, strlen (version)))
glibtop_error__r (server, _("server version is not %s"), VERSION);
glibtop_error_r (server, _("server version is not %s"), VERSION);
fprintf (stderr, "Calling GLITOP_CMND_SYSDEPS ...\n");
glibtop_call__l (server, GLIBTOP_CMND_SYSDEPS, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_SYSDEPS, 0, NULL,
sizeof (glibtop_sysdeps), &sysdeps);
server->features = sysdeps.features;

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_kernel__l (glibtop *server, glibtop_proc_kernel *buf,
glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_KERNEL) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_KERNEL, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_KERNEL, sizeof (pid_t),
&pid, sizeof (glibtop_proc_kernel), buf);
} else {
glibtop_get_proc_kernel__r (server, buf, pid);
glibtop_get_proc_kernel_r (server, buf, pid);
}
}

View File

@@ -25,14 +25,14 @@
/* Fetch list of currently running processes. */
unsigned *
glibtop_get_proclist__l (glibtop *server, glibtop_proclist *buf)
glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROCLIST, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROCLIST, 0);
if (server->features & GLIBTOP_SYSDEPS_PROCLIST) {
return glibtop_call__l (server, GLIBTOP_CMND_PROCLIST, 0, NULL,
return glibtop_call_l (server, GLIBTOP_CMND_PROCLIST, 0, NULL,
sizeof (glibtop_proclist), buf);
} else {
return glibtop_get_proclist__r (server, buf);
return glibtop_get_proclist_r (server, buf);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_mem__l (glibtop *server, glibtop_proc_mem *buf,
glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_MEM, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_MEM, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_MEM) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_MEM, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_MEM, sizeof (pid_t),
&pid, sizeof (glibtop_proc_mem), buf);
} else {
glibtop_get_proc_mem__r (server, buf, pid);
glibtop_get_proc_mem_r (server, buf, pid);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_segment__l (glibtop *server, glibtop_proc_segment *buf,
glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_SEGMENT) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_SEGMENT, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_SEGMENT, sizeof (pid_t),
&pid, sizeof (glibtop_proc_segment), buf);
} else {
glibtop_get_proc_segment__r (server, buf, pid);
glibtop_get_proc_segment_r (server, buf, pid);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_signal__l (glibtop *server, glibtop_proc_signal *buf,
glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_SIGNAL) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_SIGNAL, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_SIGNAL, sizeof (pid_t),
&pid, sizeof (glibtop_proc_signal), buf);
} else {
glibtop_get_proc_signal__r (server, buf, pid);
glibtop_get_proc_signal_r (server, buf, pid);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_state__l (glibtop *server, glibtop_proc_state *buf,
glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_STATE) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_STATE, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_STATE, sizeof (pid_t),
&pid, sizeof (glibtop_proc_state), buf);
} else {
glibtop_get_proc_state__r (server, buf, pid);
glibtop_get_proc_state_r (server, buf, pid);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_time__l (glibtop *server, glibtop_proc_time *buf,
glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_TIME) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_TIME, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_TIME, sizeof (pid_t),
&pid, sizeof (glibtop_proc_time), buf);
} else {
glibtop_get_proc_time__r (server, buf, pid);
glibtop_get_proc_time_r (server, buf, pid);
}
}

View File

@@ -26,15 +26,15 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_uid__l (glibtop *server, glibtop_proc_uid *buf,
glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf,
pid_t pid)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_PROC_UID, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROC_UID, 0);
if (server->features & GLIBTOP_SYSDEPS_PROC_UID) {
glibtop_call__l (server, GLIBTOP_CMND_PROC_UID, sizeof (pid_t),
glibtop_call_l (server, GLIBTOP_CMND_PROC_UID, sizeof (pid_t),
&pid, sizeof (glibtop_proc_uid), buf);
} else {
glibtop_get_proc_uid__r (server, buf, pid);
glibtop_get_proc_uid_r (server, buf, pid);
}
}

View File

@@ -24,18 +24,18 @@
/* Reads some data from server. */
void
glibtop_read__l (glibtop *server, size_t size, void *buf)
glibtop_read_l (glibtop *server, size_t size, void *buf)
{
size_t ssize;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
if (read (server->input [0], &ssize, sizeof (size_t)) < 0)
glibtop_error__r (server, _("read size: %s"), strerror (errno));
glibtop_error_r (server, _("read size: %s"), strerror (errno));
if (size != ssize)
glibtop_error__r (server, _("got %d bytes but requested %d"), ssize, size);
glibtop_error_r (server, _("got %d bytes but requested %d"), ssize, size);
if (read (server->input [0], buf, size) < 0)
glibtop_error__r (server, _("read %d bytes: %s"), size, strerror (errno));
glibtop_error_r (server, _("read %d bytes: %s"), size, strerror (errno));
}

View File

@@ -25,23 +25,23 @@
/* Reads some data from server. */
void *
glibtop_read_data__l (glibtop *server)
glibtop_read_data_l (glibtop *server)
{
size_t size;
void *ptr;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
if (read (server->input [0], &size, sizeof (size_t)) < 0)
glibtop_error__r (server, _("read data size: %s"),
glibtop_error_r (server, _("read data size: %s"),
strerror (errno));
if (!size) return NULL;
ptr = glibtop_malloc__r (server, size);
ptr = glibtop_malloc_r (server, size);
if (read (server->input [0], ptr, size) < 0)
glibtop_error__r (server, _("read data %d bytes: %s"),
glibtop_error_r (server, _("read data %d bytes: %s"),
size, strerror (errno));
return ptr;

View File

@@ -25,14 +25,14 @@
/* Provides information about sysv ipc limits. */
void
glibtop_get_sem_limits__l (glibtop *server, glibtop_sem_limits *buf)
glibtop_get_sem_limits_l (glibtop *server, glibtop_sem_limits *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
if (server->features & GLIBTOP_SYSDEPS_SEM_LIMITS) {
glibtop_call__l (server, GLIBTOP_CMND_SEM_LIMITS, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_SEM_LIMITS, 0, NULL,
sizeof (glibtop_sem_limits), buf);
} else {
glibtop_get_sem_limits__r (server, buf);
glibtop_get_sem_limits_r (server, buf);
}
}

View File

@@ -25,14 +25,14 @@
/* Provides information about sysv ipc limits. */
void
glibtop_get_shm_limits__l (glibtop *server, glibtop_shm_limits *buf)
glibtop_get_shm_limits_l (glibtop *server, glibtop_shm_limits *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
if (server->features & GLIBTOP_SYSDEPS_SHM_LIMITS) {
glibtop_call__l (server, GLIBTOP_CMND_SHM_LIMITS, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_SHM_LIMITS, 0, NULL,
sizeof (glibtop_shm_limits), buf);
} else {
glibtop_get_shm_limits__r (server, buf);
glibtop_get_shm_limits_r (server, buf);
}
}

View File

@@ -25,14 +25,14 @@
/* Provides information about swap usage. */
void
glibtop_get_swap__l (glibtop *server, glibtop_swap *buf)
glibtop_get_swap_l (glibtop *server, glibtop_swap *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_SWAP, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_SWAP, 0);
if (server->features & GLIBTOP_SYSDEPS_SWAP) {
glibtop_call__l (server, GLIBTOP_CMND_SWAP, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_SWAP, 0, NULL,
sizeof (glibtop_swap), buf);
} else {
glibtop_get_swap__r (server, buf);
glibtop_get_swap_r (server, buf);
}
}

View File

@@ -26,14 +26,14 @@
/* Provides uptime and idle time. */
void
glibtop_get_uptime__l (glibtop *server, glibtop_uptime *buf)
glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf)
{
glibtop_init__r (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
glibtop_init_r (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
if (server->features & GLIBTOP_SYSDEPS_UPTIME) {
glibtop_call__l (server, GLIBTOP_CMND_UPTIME, 0, NULL,
glibtop_call_l (server, GLIBTOP_CMND_UPTIME, 0, NULL,
sizeof (glibtop_uptime), buf);
} else {
glibtop_get_uptime__r (server, buf);
glibtop_get_uptime_r (server, buf);
}
}

View File

@@ -24,15 +24,15 @@
/* Writes some data to server. */
void
glibtop_write__l (glibtop *server, size_t size, void *buf)
glibtop_write_l (glibtop *server, size_t size, void *buf)
{
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
if (write (server->output [1], &size, sizeof (size_t)) < 0)
glibtop_error__r (server, _("write size: %s"), strerror (errno));
glibtop_error_r (server, _("write size: %s"), strerror (errno));
if (!size) return;
if (write (server->output [1], buf, size) < 0)
glibtop_error__r (server, _("write %d bytes: %s"), size, strerror (errno));
glibtop_error_r (server, _("write %d bytes: %s"), size, strerror (errno));
}

View File

@@ -55,7 +55,7 @@ main(int argc, char *argv[])
glibtop_version ();
glibtop_open__l (&server, argv [0], 0, GLIBTOP_OPEN_NO_OVERRIDE);
glibtop_open_l (&server, argv [0], 0, GLIBTOP_OPEN_NO_OVERRIDE);
/* close all file descriptors except ones used by the pipes (0 and 1). */
max_fd = GET_MAX_FDS();
@@ -122,58 +122,58 @@ main(int argc, char *argv[])
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_CPU:
glibtop_get_cpu__l (&server, &data.cpu);
glibtop_get_cpu_l (&server, &data.cpu);
glibtop_output (sizeof (glibtop_cpu), &data.cpu);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_MEM:
glibtop_get_mem__l (&server, &data.mem);
glibtop_get_mem_l (&server, &data.mem);
glibtop_output (sizeof (glibtop_mem), &data.mem);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SWAP:
glibtop_get_swap__l (&server, &data.swap);
glibtop_get_swap_l (&server, &data.swap);
glibtop_output (sizeof (glibtop_swap), &data.swap);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_UPTIME:
glibtop_get_uptime__l (&server, &data.uptime);
glibtop_get_uptime_l (&server, &data.uptime);
glibtop_output (sizeof (glibtop_uptime), &data.uptime);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_LOADAVG:
glibtop_get_loadavg__l (&server, &data.loadavg);
glibtop_get_loadavg_l (&server, &data.loadavg);
glibtop_output (sizeof (glibtop_loadavg), &data.loadavg);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SHM_LIMITS:
glibtop_get_shm_limits__l (&server, &data.shm_limits);
glibtop_get_shm_limits_l (&server, &data.shm_limits);
glibtop_output (sizeof (glibtop_shm_limits),
&data.shm_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_MSG_LIMITS:
glibtop_get_msg_limits__l (&server, &data.msg_limits);
glibtop_get_msg_limits_l (&server, &data.msg_limits);
glibtop_output (sizeof (glibtop_msg_limits),
&data.msg_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SEM_LIMITS:
glibtop_get_sem_limits__l (&server, &data.sem_limits);
glibtop_get_sem_limits_l (&server, &data.sem_limits);
glibtop_output (sizeof (glibtop_sem_limits),
&data.sem_limits);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_PROCLIST:
ptr = glibtop_get_proclist__l (&server, &data.proclist);
ptr = glibtop_get_proclist_l (&server, &data.proclist);
glibtop_output (sizeof (glibtop_proclist),
&data.proclist);
glibtop_output (data.proclist.total, ptr);
glibtop_free__r (&server, ptr);
glibtop_free_r (&server, ptr);
break;
case GLIBTOP_CMND_PROC_STATE:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_state__l
glibtop_get_proc_state_l
(&server, &data.proc_state, pid);
glibtop_output (sizeof (glibtop_proc_state),
&data.proc_state);
@@ -181,7 +181,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_UID:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_uid__l
glibtop_get_proc_uid_l
(&server, &data.proc_uid, pid);
glibtop_output (sizeof (glibtop_proc_uid),
&data.proc_uid);
@@ -189,7 +189,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_MEM:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_mem__l
glibtop_get_proc_mem_l
(&server, &data.proc_mem, pid);
glibtop_output (sizeof (glibtop_proc_mem),
&data.proc_mem);
@@ -197,7 +197,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_TIME:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_time__l
glibtop_get_proc_time_l
(&server, &data.proc_time, pid);
glibtop_output (sizeof (glibtop_proc_time),
&data.proc_time);
@@ -205,7 +205,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_SIGNAL:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_signal__l
glibtop_get_proc_signal_l
(&server, &data.proc_signal, pid);
glibtop_output (sizeof (glibtop_proc_signal),
&data.proc_signal);
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_KERNEL:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_kernel__l
glibtop_get_proc_kernel_l
(&server, &data.proc_kernel, pid);
glibtop_output (sizeof (glibtop_proc_kernel),
&data.proc_kernel);
@@ -221,7 +221,7 @@ main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROC_SEGMENT:
memcpy (&pid, parameter, sizeof (pid_t));
glibtop_get_proc_segment__l
glibtop_get_proc_segment_l
(&server, &data.proc_segment, pid);
glibtop_output (sizeof (glibtop_proc_segment),
&data.proc_segment);

View File

@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
setreuid (uid, euid); setregid (gid, egid);
glibtop_open__r (&server, argv [0], 0, 0);
glibtop_open_r (&server, argv [0], 0, 0);
if (setreuid (euid, uid)) _exit (1);
@@ -148,42 +148,42 @@ int main(int argc, char *argv[])
break;
case GLIBTOP_CMND_CPU:
#if GLIBTOP_SUID_CPU
glibtop_get_cpu__p (&server, &data.cpu);
glibtop_get_cpu_p (&server, &data.cpu);
#endif
glibtop_output (sizeof (glibtop_cpu), &data.cpu);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_MEM:
#if GLIBTOP_SUID_MEM
glibtop_get_mem__p (&server, &data.mem);
glibtop_get_mem_p (&server, &data.mem);
#endif
glibtop_output (sizeof (glibtop_mem), &data.mem);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SWAP:
#if GLIBTOP_SUID_SWAP
glibtop_get_swap__p (&server, &data.swap);
glibtop_get_swap_p (&server, &data.swap);
#endif
glibtop_output (sizeof (glibtop_swap), &data.swap);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_UPTIME:
#if GLIBTOP_SUID_UPTIME
glibtop_get_uptime__p (&server, &data.uptime);
glibtop_get_uptime_p (&server, &data.uptime);
#endif
glibtop_output (sizeof (glibtop_uptime), &data.uptime);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_LOADAVG:
#if GLIBTOP_SUID_LOADAVG
glibtop_get_loadavg__p (&server, &data.loadavg);
glibtop_get_loadavg_p (&server, &data.loadavg);
#endif
glibtop_output (sizeof (glibtop_loadavg), &data.loadavg);
glibtop_output (0, NULL);
break;
case GLIBTOP_CMND_SHM_LIMITS:
#if GLIBTOP_SUID_SHM_LIMITS
glibtop_get_shm_limits__p (&server, &data.shm_limits);
glibtop_get_shm_limits_p (&server, &data.shm_limits);
#endif
glibtop_output (sizeof (glibtop_shm_limits),
&data.shm_limits);
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
break;
case GLIBTOP_CMND_MSG_LIMITS:
#if GLIBTOP_SUID_MSG_LIMITS
glibtop_get_msg_limits__p (&server, &data.msg_limits);
glibtop_get_msg_limits_p (&server, &data.msg_limits);
#endif
glibtop_output (sizeof (glibtop_msg_limits),
&data.msg_limits);
@@ -199,7 +199,7 @@ int main(int argc, char *argv[])
break;
case GLIBTOP_CMND_SEM_LIMITS:
#if GLIBTOP_SUID_SEM_LIMITS
glibtop_get_sem_limits__p (&server, &data.sem_limits);
glibtop_get_sem_limits_p (&server, &data.sem_limits);
#endif
glibtop_output (sizeof (glibtop_sem_limits),
&data.sem_limits);
@@ -207,19 +207,19 @@ int main(int argc, char *argv[])
break;
case GLIBTOP_CMND_PROCLIST:
#if GLIBTOP_SUID_PROCLIST
ptr = glibtop_get_proclist__p (&server, &data.proclist);
ptr = glibtop_get_proclist_p (&server, &data.proclist);
#else
ptr = NULL;
#endif
glibtop_output (sizeof (glibtop_proclist),
&data.proclist);
glibtop_output (data.proclist.total, ptr);
glibtop_free__r (&server, ptr);
glibtop_free_r (&server, ptr);
break;
case GLIBTOP_CMND_PROC_STATE:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_STATE
glibtop_get_proc_state__p
glibtop_get_proc_state_p
(&server, &data.proc_state, pid);
#endif
glibtop_output (sizeof (glibtop_proc_state),
@@ -229,7 +229,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_UID:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_UID
glibtop_get_proc_uid__p
glibtop_get_proc_uid_p
(&server, &data.proc_uid, pid);
#endif
glibtop_output (sizeof (glibtop_proc_uid),
@@ -239,7 +239,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_MEM:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_MEM
glibtop_get_proc_mem__p
glibtop_get_proc_mem_p
(&server, &data.proc_mem, pid);
#endif
glibtop_output (sizeof (glibtop_proc_mem),
@@ -249,7 +249,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_TIME:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_TIME
glibtop_get_proc_time__p
glibtop_get_proc_time_p
(&server, &data.proc_time, pid);
#endif
glibtop_output (sizeof (glibtop_proc_time),
@@ -259,7 +259,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_SIGNAL:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_SIGNAL
glibtop_get_proc_signal__p
glibtop_get_proc_signal_p
(&server, &data.proc_signal, pid);
#endif
glibtop_output (sizeof (glibtop_proc_signal),
@@ -269,7 +269,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_KERNEL:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_KERNEL
glibtop_get_proc_kernel__p
glibtop_get_proc_kernel_p
(&server, &data.proc_kernel, pid);
#endif
glibtop_output (sizeof (glibtop_proc_kernel),
@@ -279,7 +279,7 @@ int main(int argc, char *argv[])
case GLIBTOP_CMND_PROC_SEGMENT:
memcpy (&pid, parameter, sizeof (pid_t));
#if GLIBTOP_SUID_PROC_SEGMENT
glibtop_get_proc_segment__p
glibtop_get_proc_segment_p
(&server, &data.proc_segment, pid);
#endif
glibtop_output (sizeof (glibtop_proc_segment),

View File

@@ -24,7 +24,7 @@
/* Prints error message and exits. */
void
glibtop_error__r (glibtop *server, char *format, ...)
glibtop_error_r (glibtop *server, char *format, ...)
{
va_list ap;

View File

@@ -44,7 +44,7 @@ BIT_MASK(GLIBTOP_SUID_PROC_SEGMENT);
/* Checks which features are implemented. */
void
glibtop_get_sysdeps__r (glibtop *server, glibtop_sysdeps *buf)
glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf)
{
glibtop_union data;
@@ -55,48 +55,48 @@ glibtop_get_sysdeps__r (glibtop *server, glibtop_sysdeps *buf)
/* Call all system dependent functions to check which values
* they return. */
glibtop_get_cpu__r (server, &data.cpu);
glibtop_get_cpu_r (server, &data.cpu);
buf->cpu = data.cpu.flags;
glibtop_get_mem__r (server, &data.mem);
glibtop_get_mem_r (server, &data.mem);
buf->mem = data.mem.flags;
glibtop_get_swap__r (server, &data.swap);
glibtop_get_swap_r (server, &data.swap);
buf->swap = data.swap.flags;
glibtop_get_uptime__r (server, &data.uptime);
glibtop_get_uptime_r (server, &data.uptime);
buf->uptime = data.uptime.flags;
glibtop_get_loadavg__r (server, &data.loadavg);
glibtop_get_loadavg_r (server, &data.loadavg);
buf->loadavg = data.loadavg.flags;
glibtop_get_shm_limits__r (server, &data.shm_limits);
glibtop_get_shm_limits_r (server, &data.shm_limits);
buf->shm_limits = data.shm_limits.flags;
glibtop_get_msg_limits__r (server, &data.msg_limits);
glibtop_get_msg_limits_r (server, &data.msg_limits);
buf->msg_limits = data.msg_limits.flags;
glibtop_get_sem_limits__r (server, &data.sem_limits);
glibtop_get_sem_limits_r (server, &data.sem_limits);
buf->sem_limits = data.sem_limits.flags;
glibtop_get_proclist__r (server, &data.proclist);
glibtop_get_proclist_r (server, &data.proclist);
buf->proclist = data.proclist.flags;
glibtop_get_proc_state__r (server, &data.proc_state, 0);
glibtop_get_proc_state_r (server, &data.proc_state, 0);
buf->proc_state = data.proc_state.flags;
glibtop_get_proc_uid__r (server, &data.proc_uid, 0);
glibtop_get_proc_uid_r (server, &data.proc_uid, 0);
buf->proc_uid = data.proc_uid.flags;
glibtop_get_proc_mem__r (server, &data.proc_mem, 0);
glibtop_get_proc_mem_r (server, &data.proc_mem, 0);
buf->proc_mem = data.proc_mem.flags;
glibtop_get_proc_time__r (server, &data.proc_time, 0);
glibtop_get_proc_time_r (server, &data.proc_time, 0);
buf->proc_time = data.proc_time.flags;
glibtop_get_proc_kernel__r (server, &data.proc_kernel, 0);
glibtop_get_proc_kernel_r (server, &data.proc_kernel, 0);
buf->proc_kernel = data.proc_kernel.flags;
glibtop_get_proc_segment__r (server, &data.proc_segment, 0);
glibtop_get_proc_segment_r (server, &data.proc_segment, 0);
buf->proc_segment = data.proc_segment.flags;
}

View File

@@ -24,43 +24,43 @@
/* Wrappers to malloc, calloc, realloc ... */
void *
glibtop_malloc__r (glibtop *server, size_t size)
glibtop_malloc_r (glibtop *server, size_t size)
{
void *buf = malloc (size);
if (!buf)
glibtop_error__r (server, _("malloc %d bytes: %s"),
glibtop_error_r (server, _("malloc %d bytes: %s"),
size, strerror (errno));
return buf;
}
void *
glibtop_calloc__r (glibtop *server, size_t nmemb, size_t size)
glibtop_calloc_r (glibtop *server, size_t nmemb, size_t size)
{
void *buf = calloc (nmemb, size);
if (!buf)
glibtop_error__r (server, _("calloc %d block (%d bytes each): %s"),
glibtop_error_r (server, _("calloc %d block (%d bytes each): %s"),
nmemb, size, strerror (errno));
return buf;
}
void *
glibtop_realloc__r (glibtop *server, void *ptr, size_t size)
glibtop_realloc_r (glibtop *server, void *ptr, size_t size)
{
void *buf = realloc (ptr, size);
if (!buf)
glibtop_error__r (server, _("realloc %d bytes: %s"),
glibtop_error_r (server, _("realloc %d bytes: %s"),
size, strerror (errno));
return buf;
}
void
glibtop_free__r (glibtop *server, void *ptr)
glibtop_free_r (glibtop *server, void *ptr)
{
if (ptr) free (ptr);
}

View File

@@ -24,5 +24,5 @@
/* Closes pipe to gtop server. */
void
glibtop_close (glibtop *server)
glibtop_close_l (glibtop *server)
{ }

View File

@@ -30,11 +30,11 @@ static const unsigned long _glibtop_sysdeps_cpu =
/* Provides information about cpu usage. */
void
glibtop_get_cpu__s (glibtop *server, glibtop_cpu *buf)
glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
{
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_cpu));

View File

@@ -26,15 +26,17 @@ static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = NULL;
glibtop *
glibtop_init__r (glibtop **server, const unsigned long features,
glibtop_init_r (glibtop **server, const unsigned long features,
const unsigned flags)
{
if (*server != NULL)
return *server;
fprintf (stderr, "DEBUG: %s (%d)\n", __FILE__, __LINE__);
if (glibtop_global_server == NULL) {
glibtop_global_server = &_glibtop_global_server;
glibtop_open__r (glibtop_global_server, "glibtop",
glibtop_open_r (glibtop_global_server, "glibtop",
features, flags);
}

View File

@@ -28,11 +28,11 @@ static const unsigned long _glibtop_sysdeps_loadavg =
/* Provides load load averange. */
void
glibtop_get_loadavg__s (glibtop *server, glibtop_loadavg *buf)
glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
{
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_loadavg));

View File

@@ -31,11 +31,11 @@ static const unsigned long _glibtop_sysdeps_mem =
/* Provides information about memory usage. */
void
glibtop_get_mem__s (glibtop *server, glibtop_mem *buf)
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_mem));

View File

@@ -33,11 +33,11 @@ static const unsigned long _glibtop_sysdeps_msg_limits =
/* Provides information about sysv ipc limits. */
void
glibtop_get_msg_limits__s (glibtop *server, glibtop_msg_limits *buf)
glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
{
struct msginfo msginfo;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_msg_limits));

View File

@@ -51,7 +51,7 @@ static void set_linux_version(void) {
/* Opens pipe to gtop server. Returns 0 on success and -1 on error. */
void
glibtop_open__r (glibtop *server, const char *program_name,
glibtop_open_r (glibtop *server, const char *program_name,
const unsigned long features, const unsigned flags)
{
memset (server, 0, sizeof (glibtop));

View File

@@ -78,14 +78,14 @@ BIT_SHIFT(GLIBTOP_PROCDATA_WCHAN);
/* Provides detailed information about a process. */
void
glibtop_get_procdata__s (glibtop *server, glibtop_procdata *buf, pid_t pid)
glibtop_get_procdata_s (glibtop *server, glibtop_procdata *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
struct stat statb;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_procdata));

View File

@@ -31,13 +31,13 @@ static const unsigned long _glibtop_sysdeps_proc_kernel =
/* Provides detailed information about a process. */
void
glibtop_get_proc_kernel__s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_kernel));

View File

@@ -49,7 +49,7 @@ static const unsigned long _glibtop_sysdeps_proclist =
* On error, NULL is returned and buf->flags is zero. */
unsigned *
glibtop_get_proclist__s (glibtop *server, glibtop_proclist *buf)
glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf)
{
DIR *proc;
struct dirent *entry;
@@ -60,7 +60,7 @@ glibtop_get_proclist__s (glibtop *server, glibtop_proclist *buf)
struct stat statb;
int len, i, ok;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proclist));
@@ -101,7 +101,7 @@ glibtop_get_proclist__s (glibtop *server, glibtop_proclist *buf)
new_size = pids_size + BLOCK_SIZE;
pids_chain = glibtop_realloc__r (server, pids_chain, new_size);
pids_chain = glibtop_realloc_r (server, pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, BLOCK_SIZE);
@@ -133,7 +133,7 @@ glibtop_get_proclist__s (glibtop *server, glibtop_proclist *buf)
new_size = pids_size + count * sizeof (unsigned);
pids_chain = glibtop_realloc__r (server, pids_chain, new_size);
pids_chain = glibtop_realloc_r (server, pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned));

View File

@@ -30,13 +30,13 @@ static const unsigned long _glibtop_sysdeps_proc_mem =
/* Provides detailed information about a process. */
void
glibtop_get_proc_mem__s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_mem));

View File

@@ -31,14 +31,14 @@ static const unsigned long _glibtop_sysdeps_proc_segment =
/* Provides detailed information about a process. */
void
glibtop_get_proc_segment__s (glibtop *server, glibtop_proc_segment *buf,
glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_segment));

View File

@@ -29,13 +29,13 @@ static const unsigned long _glibtop_sysdeps_proc_signal =
/* Provides detailed information about a process. */
void
glibtop_get_proc_signal__s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_signal));

View File

@@ -31,14 +31,14 @@ static const unsigned long _glibtop_sysdeps_proc_state =
/* Provides detailed information about a process. */
void
glibtop_get_proc_state__s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
struct stat statb;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_state));

View File

@@ -31,13 +31,13 @@ static const unsigned long _glibtop_sysdeps_proc_time =
/* Provides detailed information about a process. */
void
glibtop_get_proc_time__s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_time));

View File

@@ -35,13 +35,13 @@ static const unsigned long _glibtop_sysdeps_proc_uid =
/* Provides detailed information about a process. */
void
glibtop_get_proc_uid__s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
{
char input [BUFSIZ], *tmp;
int nread;
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_proc_uid));

View File

@@ -34,12 +34,12 @@ static unsigned long _glibtop_sysdeps_sem_limits =
/* Provides information about sysv ipc limits. */
void
glibtop_get_sem_limits__s (glibtop *server, glibtop_sem_limits *buf)
glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
{
struct seminfo seminfo;
union semun arg;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_sem_limits));

View File

@@ -32,11 +32,11 @@ static unsigned long _glibtop_sysdeps_shm_limits =
/* Provides information about sysv ipc limits. */
void
glibtop_get_shm_limits__s (glibtop *server, glibtop_shm_limits *buf)
glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
{
struct shminfo shminfo;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_shm_limits));

View File

@@ -29,11 +29,11 @@ static unsigned long _glibtop_sysdeps_swap =
/* Provides information about swap usage. */
void
glibtop_get_swap__s (glibtop *server, glibtop_swap *buf)
glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
{
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_swap));

View File

@@ -28,11 +28,11 @@ static unsigned long _glibtop_sysdeps_uptime =
/* Provides uptime and idle time. */
void
glibtop_get_uptime__s (glibtop *server, glibtop_uptime *buf)
glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
{
FILE *f;
glibtop_init__r (&server, 0, 0);
glibtop_init_r (&server, 0, 0);
memset (buf, 0, sizeof (glibtop_uptime));

View File

@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_cpu =
/* Provides information about cpu usage. */
void
glibtop_get_cpu__s (glibtop *server, glibtop_cpu *buf)
glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
{
struct tbl_sysinfo sysinfo;
int ret;

View File

@@ -26,7 +26,7 @@ static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = NULL;
glibtop *
glibtop_init__r (glibtop **server)
glibtop_init_r (glibtop **server)
{
if (*server != NULL)
return *server;

View File

@@ -29,7 +29,7 @@ static const unsigned long _glibtop_sysdeps_loadavg =
/* Provides load averange. */
void
glibtop_get_loadavg__s (glibtop *server, glibtop_loadavg *buf)
glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
{
struct tbl_loadavg loadavg;
int ret;

View File

@@ -36,7 +36,7 @@ static const unsigned long _glibtop_sysdeps_mem =
/* Provides information about memory usage. */
void
glibtop_get_mem__s (glibtop *server, glibtop_mem *buf)
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{
vm_statistics_data_t vmstats;

View File

@@ -31,7 +31,7 @@ static const unsigned long _glibtop_sysdeps_msg_limits =
/* Provides information about sysv ipc limits. */
void
glibtop_get_msg_limits__s (glibtop *server, glibtop_msg_limits *buf)
glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
{
int ret, value;

View File

@@ -53,7 +53,7 @@ BIT_SHIFT(GLIBTOP_PROCDATA_NICE);
static const unsigned long _glibtop_sysdeps_procdata_1 = 0;
void
glibtop_get_procdata__r (glibtop *server, glibtop_procdata *buf, pid_t pid)
glibtop_get_procdata_r (glibtop *server, glibtop_procdata *buf, pid_t pid)
{
struct tbl_procinfo procinfo;
task_basic_info_data_t taskinfo;

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_kernel__r (glibtop *server, glibtop_proc_kernel *buf,
glibtop_get_proc_kernel_r (glibtop *server, glibtop_proc_kernel *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_kernel));

View File

@@ -54,7 +54,7 @@ static const unsigned long _glibtop_sysdeps_proclist =
/* !!! THIS FUNCTION RUNS SUID ROOT - CHANGE WITH CAUTION !!! */
unsigned *
glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
glibtop_get_proclist_r (glibtop *server, glibtop_proclist *buf)
{
unsigned count = 0, total = 0;
unsigned pids [BLOCK_COUNT], *pids_chain = NULL;
@@ -103,7 +103,7 @@ glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
new_size = pids_size + BLOCK_SIZE;
pids_chain = glibtop_realloc__r (server, pids_chain, new_size);
pids_chain = glibtop_realloc_r (server, pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, BLOCK_SIZE);
@@ -133,7 +133,7 @@ glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
new_size = pids_size + count * sizeof (unsigned);
pids_chain = glibtop_realloc__r (server, pids_chain, new_size);
pids_chain = glibtop_realloc_r (server, pids_chain, new_size);
memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned));

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_mem__r (glibtop *server, glibtop_proc_mem *buf,
glibtop_get_proc_mem_r (glibtop *server, glibtop_proc_mem *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_mem));

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_segment__r (glibtop *server, glibtop_proc_segment *buf,
glibtop_get_proc_segment_r (glibtop *server, glibtop_proc_segment *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_segment));

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_signal__r (glibtop *server, glibtop_proc_signal *buf,
glibtop_get_proc_signal_r (glibtop *server, glibtop_proc_signal *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_signal));

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_state__r (glibtop *server, glibtop_proc_state *buf,
glibtop_get_proc_state_r (glibtop *server, glibtop_proc_state *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_state));

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_time__r (glibtop *server, glibtop_proc_time *buf,
glibtop_get_proc_time_r (glibtop *server, glibtop_proc_time *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_time));

View File

@@ -39,7 +39,7 @@ static const unsigned long _glibtop_sysdeps_proc_uid =
(1 << GLIBTOP_PROC_UID_TTY) + (1 << GLIBTOP_PROC_UID_TPGID);
void
glibtop_get_proc_uid__r (glibtop *server, glibtop_proc_uid *buf,
glibtop_get_proc_uid_r (glibtop *server, glibtop_proc_uid *buf,
pid_t pid)
{
struct tbl_procinfo procinfo;

View File

@@ -31,7 +31,7 @@ static unsigned long _glibtop_sysdeps_sem_limits =
/* Provides information about sysv sem limits. */
void
glibtop_get_sem_limits__s (glibtop *server, glibtop_sem_limits *buf)
glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
{
int ret, value;

View File

@@ -30,7 +30,7 @@ static unsigned long _glibtop_sysdeps_shm_limits =
/* Provides information about sysv ipc limits. */
void
glibtop_get_shm_limits__s (glibtop *server, glibtop_shm_limits *buf)
glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
{
int ret, value;

View File

@@ -30,7 +30,7 @@ static unsigned long _glibtop_sysdeps_swap =
/* Provides information about swap usage. */
void
glibtop_get_swap__s (glibtop *server, glibtop_swap *buf)
glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
{
struct tbl_swapinfo swapinfo;
int i;

View File

@@ -31,7 +31,7 @@ static unsigned long _glibtop_sysdeps_uptime =
/* Provides uptime and idle time. */
void
glibtop_get_uptime__s (glibtop *server, glibtop_uptime *buf)
glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
{
struct tbl_sysinfo sysinfo;
int ret;

View File

@@ -25,7 +25,7 @@
/* Provides information about cpu usage. */
void
glibtop_get_cpu__r (glibtop *server, glibtop_cpu *buf)
glibtop_get_cpu_r (glibtop *server, glibtop_cpu *buf)
{
memset (buf, 0, sizeof (glibtop_cpu));
}

View File

@@ -26,7 +26,7 @@ static glibtop _glibtop_global_server;
glibtop *glibtop_global_server = NULL;
glibtop *
glibtop_init__r (glibtop **server)
glibtop_init_r (glibtop **server)
{
if (*server != NULL)
return *server;

View File

@@ -25,7 +25,7 @@
/* Provides load averange. */
void
glibtop_get_loadavg__r (glibtop *server, glibtop_loadavg *buf)
glibtop_get_loadavg_r (glibtop *server, glibtop_loadavg *buf)
{
memset (buf, 0, sizeof (glibtop_loadavg));
}

View File

@@ -25,7 +25,7 @@
/* Provides information about memory usage. */
void
glibtop_get_mem__r (glibtop *server, glibtop_mem *buf)
glibtop_get_mem_r (glibtop *server, glibtop_mem *buf)
{
memset (buf, 0, sizeof (glibtop_mem));
}

View File

@@ -24,7 +24,7 @@
/* Provides information about sysv ipc limits. */
void
glibtop_get_msg_limits__r (glibtop *server, glibtop_msg_limits *buf)
glibtop_get_msg_limits_r (glibtop *server, glibtop_msg_limits *buf)
{
memset (buf, 0, sizeof (glibtop_msg_limits));
}

View File

@@ -25,7 +25,7 @@
/* Provides detailed information about a process. */
void
glibtop_get_proc_kernel__r (glibtop *server, glibtop_proc_kernel *buf,
glibtop_get_proc_kernel_r (glibtop *server, glibtop_proc_kernel *buf,
pid_t pid)
{
memset (buf, 0, sizeof (glibtop_proc_kernel));

View File

@@ -32,7 +32,7 @@
* each buf->size big. The total size is stored in buf->total. */
unsigned *
glibtop_get_proclist__r (glibtop *server, glibtop_proclist *buf)
glibtop_get_proclist_r (glibtop *server, glibtop_proclist *buf)
{
memset (buf, 0, sizeof (glibtop_proclist));
return NULL;

Some files were not shown because too many files have changed in this diff Show More