Started with the big rewrite for GNOME 2.0:
2000-11-20 Martin Baulig <baulig@suse.de> Started with the big rewrite for GNOME 2.0: - split the `glibtop' structure into `glibtop_server' and `glibtop_client' and make `glibtop_client' a GObject. - cleanly separate the library and the backends. This stuff currently does not compile. * glibtop.h (glibtop_server_private, glibtop_server_info): Removed typedefs. (struct _glibtop, struct _glibtop_server_info): Removed. (glibtop_global_server, glibtop_server_features): Removed. (glibtop_server_ref, glibtop_server_unref): Removed. * glibtop.h (glibtop_init_s): First argument is now a `glibtop_server *'. * include/glibtop/*.h: Removed all #defines with the glibtop_global_server. (glibtop_get_*_l): First argument is now a `glibtop_client *'. (glibtop_get_*_s, glibtop_init_*_s): First argument is now a `glibtop_server *'. * lib/glibtop-client.c: New file. * sysdeps/common/xmalloc.c: Moved to lib/. * sysdeps/common/error.c: Moved to lib/. * lib/xmalloc.c: Moved here from sysdeps/common/. * lib/error.c: Moved here from sysdeps/common/. * include/glibtop/backend.h (glibtop_backend_open_func_t, glibtop_backend_close_func_t): First argument is now a `glibtop_server *'. (glibtop_backend_info): Added `glibtop_server *server'. (glibtop_open_backend_l): Returns `glibtop_backend *', first argument is `glibtop_client *' and added `GError **'. * include/glibtop/close.h (glibtop_close_s, glibtop_close_p): First argument is now a `glibtop_server *'. * include/glibtop/error.h (*): First argument is now a `glibtop_server *'. * include/glibtop/errors.h: Switched this to use GError.
This commit is contained in:
committed by
Martin Baulig
parent
c15ff3f342
commit
752d5b47d2
@@ -6,10 +6,11 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
||||
procmem.h procuid.h swap.h error.h open.h \
|
||||
procsegment.h sysdeps.h xmalloc.h global.h \
|
||||
procsignal.h union.h types.h proccwd.h \
|
||||
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
||||
mountlist.h fsusage.h procmap.h signal.h \
|
||||
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
|
||||
netinfo.h interfaces.h limits.h array.h compat_10.h \
|
||||
errors.h glib-arrays.h backend.h call-vector.h
|
||||
glib-arrays.h backend.h call-vector.h \
|
||||
glibtop-client.h glibtop-server.h
|
||||
|
||||
BUILT_SOURCES = call-vector.h
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <glibtop/glibtop-client.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
@@ -42,9 +42,9 @@ typedef struct _glibtop_backend glibtop_backend;
|
||||
|
||||
#include <glibtop/call-vector.h>
|
||||
|
||||
typedef int (*glibtop_backend_open_func_t) (glibtop *, glibtop_backend *,
|
||||
typedef int (*glibtop_backend_open_func_t) (glibtop_server *, glibtop_backend *,
|
||||
u_int64_t, const char **);
|
||||
typedef int (*glibtop_backend_close_func_t) (glibtop *, glibtop_backend *);
|
||||
typedef int (*glibtop_backend_close_func_t) (glibtop_server *, glibtop_backend *);
|
||||
|
||||
struct _glibtop_backend_info
|
||||
{
|
||||
@@ -88,6 +88,8 @@ struct _glibtop_backend
|
||||
{
|
||||
const glibtop_backend_info *info;
|
||||
|
||||
glibtop_server *server;
|
||||
|
||||
/* private pointers */
|
||||
glibtop_backend_private *_priv;
|
||||
glibtop_backend_module *_priv_module;
|
||||
@@ -108,9 +110,10 @@ glibtop_backend_by_name (const char *backend_name);
|
||||
void
|
||||
glibtop_init_backends (void);
|
||||
|
||||
int
|
||||
glibtop_open_backend_l (glibtop *server, const char *backend_name,
|
||||
u_int64_t features, const char **backend_args);
|
||||
glibtop_backend *
|
||||
glibtop_open_backend_l (glibtop_client *client, const char *backend_name,
|
||||
u_int64_t features, const char **backend_args,
|
||||
GError **error);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -82,16 +82,16 @@ sub parse_features_def {
|
||||
|
||||
if ($line_fields[3] eq '') {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop *, glibtop_backend *%s);\n], $retval, $feature, $param_decl);
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *%s);\n], $retval, $feature, $param_decl);
|
||||
} elsif ($line_fields[3] eq 'array') {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop *, glibtop_backend *, glibtop_array *%s);\n], $retval, $feature, $param_decl);
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, glibtop_array *%s);\n], $retval, $feature, $param_decl);
|
||||
} elsif ($line_fields[3] =~ /^array/) {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop *, glibtop_backend *, glibtop_array *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, glibtop_array *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
} else {
|
||||
$func_decl_code .= sprintf
|
||||
(qq[\t%s (*%s) (glibtop *, glibtop_backend *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
(qq[\t%s (*%s) (glibtop_server *, glibtop_backend *, %s *%s);\n], $retval, $feature, 'glibtop_'.$feature, $param_decl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ BEGIN_LIBGTOP_DECLS
|
||||
|
||||
void glibtop_close_r (glibtop *server);
|
||||
|
||||
void glibtop_close_s (glibtop *server);
|
||||
void glibtop_close_p (glibtop *server);
|
||||
void glibtop_close_s (glibtop_server *server);
|
||||
void glibtop_close_p (glibtop_server *server);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -66,22 +66,20 @@ struct _glibtop_cpu
|
||||
xcpu_flags; /* GLIBTOP_CPU_XCPU_FLAGS */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_cpu_r glibtop_get_cpu_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf);
|
||||
int glibtop_get_cpu_l (glibtop_client *client, glibtop_cpu *buf);
|
||||
|
||||
#if GLIBTOP_SUID_CPU
|
||||
int glibtop_init_cpu_p (glibtop *server);
|
||||
int glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf);
|
||||
#else
|
||||
int glibtop_init_cpu_s (glibtop *server);
|
||||
int glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf);
|
||||
int glibtop_init_cpu_s (glibtop_server *server);
|
||||
int glibtop_get_cpu_s (glibtop_server *server, glibtop_cpu *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -30,42 +30,16 @@
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#ifndef G_GNUC_UNUSED
|
||||
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
|
||||
#define G_GNUC_UNUSED \
|
||||
__attribute__((unused))
|
||||
#else /* !__GNUC__ */
|
||||
#define G_GNUC_UNUSED
|
||||
#endif /* !__GNUC__ */
|
||||
#endif /* defined G_GNUC_UNUSED */
|
||||
void glibtop_error_vr (glibtop_server *server, char *format, va_list args);
|
||||
void glibtop_warn_vr (glibtop_server *server, char *format, va_list args);
|
||||
|
||||
void glibtop_error_vr (glibtop *server, char *format, va_list args);
|
||||
void glibtop_warn_vr (glibtop *server, char *format, va_list args);
|
||||
void glibtop_error_io_vr (glibtop_server *server, char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop_server *server, char *format, int, va_list args);
|
||||
|
||||
void glibtop_error_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
void glibtop_warn_io_vr (glibtop *server, char *format, int, va_list args);
|
||||
|
||||
void glibtop_error_r (glibtop *server, char *format, ...);
|
||||
void glibtop_warn_r (glibtop *server, char *format, ...);
|
||||
void glibtop_error_io_r (glibtop *server, char *format, ...);
|
||||
void glibtop_warn_io_r (glibtop *server, char *format, ...);
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
#define glibtop_error(p1, args...) glibtop_error_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn(p1, args...) glibtop_warn_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#define glibtop_error_io(p1, args...) glibtop_error_io_r(glibtop_global_server , p1 , ## args)
|
||||
#define glibtop_warn_io(p1, args...) glibtop_warn_io_r(glibtop_global_server , p1 , ## args)
|
||||
|
||||
#else /* no __GNUC__ */
|
||||
|
||||
void glibtop_error (char *format, ...);
|
||||
void glibtop_warn (char *format, ...);
|
||||
void glibtop_error_io (char *format, ...);
|
||||
void glibtop_warn_io (char *format, ...);
|
||||
|
||||
#endif /* no __GNUC__ */
|
||||
void glibtop_error_r (glibtop_server *server, char *format, ...);
|
||||
void glibtop_warn_r (glibtop_server *server, char *format, ...);
|
||||
void glibtop_error_io_r (glibtop_server *server, char *format, ...);
|
||||
void glibtop_warn_io_r (glibtop_server *server, char *format, ...);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -28,38 +28,67 @@
|
||||
|
||||
#include <glibtop.h>
|
||||
|
||||
#include <gerror.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_ERROR_NO_ERROR 0
|
||||
#define GLIBTOP_ERROR_UNKNOWN 1
|
||||
#define GLIBTOP_ERROR_INVALID_ARGUMENT 2
|
||||
#define GLIBTOP_ERROR_NO_SUCH_PARAMETER 3
|
||||
#define GLIBTOP_ERROR_READONLY_VALUE 4
|
||||
#define GLIBTOP_ERROR_SIZE_MISMATCH 5
|
||||
#define GLIBTOP_ERROR glibtop_error_quark ()
|
||||
|
||||
#define GLIBTOP_ERROR_SERVER_COMM_FAILURE 6
|
||||
GQuark glibtop_error_quark (void) G_GNUC_CONST;
|
||||
|
||||
#define GLIBTOP_ERROR_NO_SUCH_PROCESS 7
|
||||
typedef enum {
|
||||
GLIBTOP_ERROR_NO_ERROR = 0,
|
||||
GLIBTOP_ERROR_UNKNOWN,
|
||||
GLIBTOP_ERROR_INVALID_ARGUMENT,
|
||||
GLIBTOP_ERROR_NO_SUCH_PARAMETER,
|
||||
GLIBTOP_ERROR_READONLY_VALUE,
|
||||
GLIBTOP_ERROR_SIZE_MISMATCH,
|
||||
|
||||
#define GLIBTOP_ERROR_NO_KERNEL_SUPPORT 8
|
||||
#define GLIBTOP_ERROR_INCOMPATIBLE_KERNEL 9
|
||||
GLIBTOP_ERROR_SERVER_COMM_FAILURE,
|
||||
|
||||
#define GLIBTOP_ERROR_NO_SUCH_BACKEND 10
|
||||
#define GLIBTOP_ERROR_NOT_IMPLEMENTED 11
|
||||
#define GLIBTOP_ERROR_NO_BACKEND_OPENED 12
|
||||
GLIBTOP_ERROR_NO_SUCH_PROCESS,
|
||||
|
||||
#define GLIBTOP_ERROR_DEMARSHAL_ERROR 13
|
||||
GLIBTOP_ERROR_NO_KERNEL_SUPPORT,
|
||||
GLIBTOP_ERROR_INCOMPATIBLE_KERNEL,
|
||||
|
||||
#define GLIBTOP_MAX_ERROR 14
|
||||
GLIBTOP_ERROR_NO_SUCH_BACKEND,
|
||||
GLIBTOP_ERROR_NOT_IMPLEMENTED,
|
||||
GLIBTOP_ERROR_NO_BACKEND_OPENED,
|
||||
|
||||
char *
|
||||
glibtop_get_error_string_l (glibtop *server, unsigned error_number);
|
||||
GLIBTOP_ERROR_DEMARSHAL_ERROR
|
||||
} glibtop_error;
|
||||
|
||||
unsigned
|
||||
glibtop_get_errno_l (glibtop *server);
|
||||
void
|
||||
glibtop_error_vl (glibtop_client *client, glibtop_error code,
|
||||
const char *format, va_list args);
|
||||
|
||||
unsigned
|
||||
glibtop_clear_errno_l (glibtop *server);
|
||||
void
|
||||
glibtop_error_io_vl (glibtop_client *client, glibtop_error code,
|
||||
int io_errno, const char *format, va_list args);
|
||||
|
||||
void
|
||||
glibtop_warn_vl (glibtop_client *client, glibtop_error code,
|
||||
const char *format, va_list args);
|
||||
|
||||
void
|
||||
glibtop_warn_io_vl (glibtop_client *client, glibtop_error code,
|
||||
int io_errno, const char *format, va_list args);
|
||||
|
||||
void
|
||||
glibtop_error_l (glibtop_client *client, glibtop_error code,
|
||||
char *format, ...);
|
||||
|
||||
void
|
||||
glibtop_warn_l (glibtop_client *client, glibtop_error code,
|
||||
char *format, ...);
|
||||
|
||||
void
|
||||
glibtop_error_io_l (glibtop_client *client, glibtop_error code,
|
||||
char *format, ...);
|
||||
|
||||
void
|
||||
glibtop_warn_io_l (glibtop_client *client, glibtop_error code,
|
||||
char *format, ...);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -51,12 +51,8 @@ struct _glibtop_fsusage
|
||||
ffree; /* Free file nodes. */
|
||||
};
|
||||
|
||||
#define glibtop_get_fsusage(fsusage,disk) glibtop_get_fsusage_l(glibtop_global_server, fsusage, disk)
|
||||
|
||||
#define glibtop_get_fsusage_r glibtop_get_fsusage_s
|
||||
|
||||
int glibtop_get_fsusage_l (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
int glibtop_get_fsusage_s (glibtop *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
int glibtop_get_fsusage_l (glibtop_client *client, glibtop_fsusage *buf, const char *mount_dir);
|
||||
int glibtop_get_fsusage_s (glibtop_server *server, glibtop_fsusage *buf, const char *mount_dir);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
|
||||
@@ -29,31 +29,22 @@
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/array.h>
|
||||
#include <glibtop/global.h>
|
||||
#include <glibtop/xmalloc.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define glibtop_get_proc_args_as_array(pid) glibtop_get_proc_args_as_array_l(glibtop_global_server, pid)
|
||||
|
||||
GPtrArray *
|
||||
glibtop_get_proc_args_as_array_l (glibtop *server, pid_t pid);
|
||||
|
||||
#define glibtop_get_proclist_as_array(which,arg) glibtop_get_proclist_as_array_l(glibtop_global_server, which, arg)
|
||||
glibtop_get_proc_args_as_array_l (glibtop_client *client, pid_t pid);
|
||||
|
||||
GArray *
|
||||
glibtop_get_proclist_as_array_l (glibtop *server, int64_t which, int64_t arg);
|
||||
|
||||
#define glibtop_get_proc_map_as_array(pid) glibtop_get_proc_map_as_array_l(glibtop_global_server, pid)
|
||||
glibtop_get_proclist_as_array_l (glibtop_client *client, int64_t which, int64_t arg);
|
||||
|
||||
GPtrArray *
|
||||
glibtop_get_proc_map_as_array_l (glibtop *server, pid_t pid);
|
||||
|
||||
#define glibtop_get_mountlist_as_array(all_fs) glibtop_get_mountlist_as_array_l(glibtop_global_server, all_fs)
|
||||
glibtop_get_proc_map_as_array_l (glibtop_client *client, pid_t pid);
|
||||
|
||||
GPtrArray *
|
||||
glibtop_get_mountlist_as_array_l (glibtop *server, int all_fs);
|
||||
glibtop_get_mountlist_as_array_l (glibtop_client *client, int all_fs);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
#endif
|
||||
|
||||
79
include/glibtop/glibtop-client.h
Normal file
79
include/glibtop/glibtop-client.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 2.0.
|
||||
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
LibGTop 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LibGTop; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_CLIENT_H__
|
||||
#define __GLIBTOP_CLIENT_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <gobject/gobject.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_TYPE_CLIENT (glibtop_client_get_type ())
|
||||
#define GLIBTOP_CLIENT(client) (G_TYPE_CHECK_INSTANCE_CAST ((client), GLIBTOP_TYPE_CLIENT, glibtop_client))
|
||||
#define GLIBTOP_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GLIBTOP_TYPE_CLIENT, glibtop_client_class))
|
||||
#define GLIBTOP_IS_CLIENT(client) (G_TYPE_CHECK_INSTANCE_TYPE ((client), GLIBTOP_TYPE_CLIENT))
|
||||
#define GLIBTOP_IS_CLIENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIBTOP_TYPE_CLIENT))
|
||||
#define GLIBTOP_CLIENT_GET_CLASS(client)(G_TYPE_INSTANCE_GET_CLASS ((client), GLIBTOP_TYPE_CLIENT, glibtop_client_class))
|
||||
|
||||
#define GLIBTOP_CLIENT_TYPE(client) (G_TYPE_FROM_INSTANCE (client))
|
||||
#define GLIBTOP_CLIENT_TYPE_NAME(client)(g_type_name (GLIBTOP_CLIENT_TYPE (client)))
|
||||
|
||||
/* --- typedefs & structures --- */
|
||||
typedef struct _glibtop_client glibtop_client;
|
||||
typedef struct _glibtop_client_class glibtop_client_class;
|
||||
typedef struct _glibtop_client_private glibtop_client_private;
|
||||
|
||||
struct _glibtop_client
|
||||
{
|
||||
GObject object;
|
||||
|
||||
/* <public> */
|
||||
GError *error;
|
||||
|
||||
/* <private> */
|
||||
glibtop_client_private *_priv;
|
||||
};
|
||||
|
||||
struct _glibtop_client_class
|
||||
{
|
||||
GObjectClass parent_class;;
|
||||
};
|
||||
|
||||
GType
|
||||
glibtop_client_get_type (void);
|
||||
|
||||
glibtop_client *
|
||||
glibtop_client_new (void);
|
||||
|
||||
void
|
||||
glibtop_client_propagate_error (glibtop_client *client, GError *error);
|
||||
|
||||
void
|
||||
glibtop_client_propagate_warning (glibtop_client *client, GError *error);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
#endif
|
||||
74
include/glibtop/glibtop-server.h
Normal file
74
include/glibtop/glibtop-server.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 2.0.
|
||||
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
LibGTop 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 General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LibGTop; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_SERVER_H__
|
||||
#define __GLIBTOP_SERVER_H__
|
||||
|
||||
#include <glibtop/global.h>
|
||||
#include <glibtop/sysdeps.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
typedef struct _glibtop_server glibtop_server;
|
||||
typedef struct _glibtop_server_info glibtop_server_info;
|
||||
typedef struct _glibtop_server_private glibtop_server_private;
|
||||
|
||||
typedef int (*glibtop_init_func_t) (glibtop_server *);
|
||||
|
||||
extern glibtop_init_func_t _glibtop_init_hook_s [];
|
||||
extern glibtop_init_func_t _glibtop_init_hook_p [];
|
||||
|
||||
struct _glibtop_server_info
|
||||
{
|
||||
int ncpu; /* Number of CPUs, zero if single-processor */
|
||||
unsigned long features; /* Server is required for this features */
|
||||
glibtop_sysdeps sysdeps; /* Detailed feature list */
|
||||
glibtop_sysdeps required; /* Required feature list */
|
||||
glibtop_sysdeps wanted; /* We only want this features */
|
||||
};
|
||||
|
||||
struct _glibtop_server
|
||||
{
|
||||
glibtop_server_info *info;
|
||||
|
||||
int refcount;
|
||||
unsigned flags;
|
||||
const char *name;
|
||||
|
||||
glibtop_server_private *_priv;
|
||||
};
|
||||
|
||||
glibtop_server *
|
||||
glibtop_server_new (void);
|
||||
|
||||
void
|
||||
glibtop_server_ref (glibtop_server *server);
|
||||
|
||||
void
|
||||
glibtop_server_unref (glibtop_server *server);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
#endif
|
||||
@@ -49,20 +49,16 @@ struct _glibtop_inodedb
|
||||
GDBM_FILE system_dbf, user_dbf;
|
||||
};
|
||||
|
||||
#define glibtop_inodedb_open(p1,p2) glibtop_inodedb_open_s(glibtop_global_server, p1, p2)
|
||||
#define glibtop_inodedb_lookup(p1,p2,p3) glibtop_inodedb_lookup_s(glibtop_global_server, p1, p2, p3)
|
||||
#define glibtop_inodedb_close(p1) glibtop_inodedb_close_s(glibtop_global_server)
|
||||
|
||||
glibtop_inodedb *
|
||||
glibtop_inodedb_open_s (glibtop *server, unsigned databases, unsigned long cache_size);
|
||||
glibtop_inodedb_open_s (glibtop_server *server, unsigned databases, unsigned long cache_size);
|
||||
|
||||
const char *
|
||||
glibtop_inodedb_lookup_s (glibtop *server,
|
||||
glibtop_inodedb_lookup_s (glibtop_server *server,
|
||||
glibtop_inodedb *inodedb,
|
||||
u_int64_t device, u_int64_t inode);
|
||||
|
||||
void
|
||||
glibtop_inodedb_close_s (glibtop *server, glibtop_inodedb *inodedb);
|
||||
glibtop_inodedb_close_s (glibtop_server *server, glibtop_inodedb *inodedb);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -171,22 +171,20 @@ struct _glibtop_interface
|
||||
char name [GLIBTOP_INTERFACE_LEN];
|
||||
};
|
||||
|
||||
#define glibtop_get_interface_names(array,interface,number,instance,strategy) glibtop_get_interface_names_l (glibtop_global_server, array, interface, number, instance, strategy)
|
||||
|
||||
#if GLIBTOP_SUID_INTERFACE_NAMES
|
||||
#define glibtop_get_interface_names_r glibtop_get_interface_names_p
|
||||
#else
|
||||
#define glibtop_get_interface_names_r glibtop_get_interface_names_s
|
||||
#endif
|
||||
|
||||
glibtop_interface *glibtop_get_interface_names_l (glibtop *server, glibtop_array *array, u_int64_t interface, u_int64_t number, u_int64_t instance, u_int64_t strategy);
|
||||
glibtop_interface *glibtop_get_interface_names_l (glibtop_client *client, glibtop_array *array, u_int64_t interface, u_int64_t number, u_int64_t instance, u_int64_t strategy);
|
||||
|
||||
#if GLIBTOP_SUID_INTERFACE_NAMES
|
||||
int glibtop_init_interface_names_p (glibtop *server);
|
||||
glibtop_interface *glibtop_get_interface_names_p (glibtop *server, glibtop_array *array, u_int64_t interface, u_int64_t number, u_int64_t instance, u_int64_t strategy);
|
||||
#else
|
||||
int glibtop_init_interface_names_s (glibtop *server);
|
||||
glibtop_interface *glibtop_get_interface_names_s (glibtop *server, glibtop_array *array, u_int64_t interface, u_int64_t number, u_int64_t instance, u_int64_t strategy);
|
||||
int glibtop_init_interface_names_s (glibtop_server *server);
|
||||
glibtop_interface *glibtop_get_interface_names_s (glibtop_server *server, glibtop_array *array, u_int64_t interface, u_int64_t number, u_int64_t instance, u_int64_t strategy);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -49,22 +49,20 @@ struct _glibtop_loadavg
|
||||
last_pid; /* GLIBTOP_LOADAVG_LAST_PID */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_loadavg_r glibtop_get_loadavg_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf);
|
||||
int glibtop_get_loadavg_l (glibtop_client *client, glibtop_loadavg *buf);
|
||||
|
||||
#if GLIBTOP_SUID_LOADAVG
|
||||
int glibtop_init_loadavg_p (glibtop *server);
|
||||
int glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf);
|
||||
#else
|
||||
int glibtop_init_loadavg_s (glibtop *server);
|
||||
int glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf);
|
||||
int glibtop_init_loadavg_s (glibtop_server *server);
|
||||
int glibtop_get_loadavg_s (glibtop_server *server, glibtop_loadavg *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -57,22 +57,20 @@ struct _glibtop_mem
|
||||
locked; /* GLIBTOP_MEM_LOCKED */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_mem_r glibtop_get_mem_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_mem_l (glibtop *server, glibtop_mem *buf);
|
||||
int glibtop_get_mem_l (glibtop_client *client, glibtop_mem *buf);
|
||||
|
||||
#if GLIBTOP_SUID_MEM
|
||||
int glibtop_init_mem_p (glibtop *server);
|
||||
int glibtop_get_mem_p (glibtop *server, glibtop_mem *buf);
|
||||
#else
|
||||
int glibtop_init_mem_s (glibtop *server);
|
||||
int glibtop_get_mem_s (glibtop *server, glibtop_mem *buf);
|
||||
int glibtop_init_mem_s (glibtop_server *server);
|
||||
int glibtop_get_mem_s (glibtop_server *server, glibtop_mem *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -44,15 +44,13 @@ struct _glibtop_mountentry
|
||||
char type [GLIBTOP_MOUNTENTRY_LEN+1];
|
||||
};
|
||||
|
||||
#define glibtop_get_mountlist(array,all_fs) glibtop_get_mountlist_l(glibtop_global_server, array, all_fs)
|
||||
|
||||
#define glibtop_get_mountlist_r glibtop_get_mountlist_s
|
||||
|
||||
glibtop_mountentry *
|
||||
glibtop_get_mountlist_l (glibtop *server, glibtop_array *array, int all_fs);
|
||||
glibtop_get_mountlist_l (glibtop_client *client, glibtop_array *array, int all_fs);
|
||||
|
||||
glibtop_mountentry *
|
||||
glibtop_get_mountlist_s (glibtop *server, glibtop_array *array, int all_fs);
|
||||
glibtop_get_mountlist_s (glibtop_server *server, glibtop_array *array, int all_fs);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
|
||||
@@ -55,22 +55,20 @@ struct _glibtop_msg_limits
|
||||
msgtql; /* GLIBTOP_MSG_LIMITS_MSGTQL */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_msg_limits_r glibtop_get_msg_limits_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf);
|
||||
int glibtop_get_msg_limits_l (glibtop_client *client, glibtop_msg_limits *buf);
|
||||
|
||||
#if GLIBTOP_SUID_MSG_LIMITS
|
||||
int glibtop_init_msg_limits_p (glibtop *server);
|
||||
int glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf);
|
||||
#else
|
||||
int glibtop_init_msg_limits_s (glibtop *server);
|
||||
int glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf);
|
||||
int glibtop_init_msg_limits_s (glibtop_server *server);
|
||||
int glibtop_get_msg_limits_s (glibtop_server *server, glibtop_msg_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -51,22 +51,20 @@ struct _glibtop_netinfo
|
||||
mtu; /* GLIBTOP_NETINFO_MTU */
|
||||
};
|
||||
|
||||
#define glibtop_get_netinfo(array,netinfo,interface,transport) glibtop_get_netinfo_l(glibtop_global_server, array, netinfo, interface, transport)
|
||||
|
||||
#if GLIBTOP_SUID_NETINFO
|
||||
#define glibtop_get_netinfo_r glibtop_get_netinfo_p
|
||||
#else
|
||||
#define glibtop_get_netinfo_r glibtop_get_netinfo_s
|
||||
#endif
|
||||
|
||||
glibtop_ifaddr *glibtop_get_netinfo_l (glibtop *server, glibtop_array *array, glibtop_netinfo *buf, const char *interface, u_int64_t transport);
|
||||
glibtop_ifaddr *glibtop_get_netinfo_l (glibtop_client *client, glibtop_array *array, glibtop_netinfo *buf, const char *interface, u_int64_t transport);
|
||||
|
||||
#if GLIBTOP_SUID_NETINFO
|
||||
int glibtop_init_netinfo_p (glibtop *server);
|
||||
glibtop_ifaddr *glibtop_get_netinfo_p (glibtop *server, glibtop_array *array, glibtop_netinfo *buf, const char *interface, u_int64_t transport);
|
||||
#else
|
||||
int glibtop_init_netinfo_s (glibtop *server);
|
||||
glibtop_ifaddr *glibtop_get_netinfo_s (glibtop *server, glibtop_array *array, glibtop_netinfo *buf, const char *interface, u_int64_t transport);
|
||||
int glibtop_init_netinfo_s (glibtop_server *server);
|
||||
glibtop_ifaddr *glibtop_get_netinfo_s (glibtop_server *server, glibtop_array *array, glibtop_netinfo *buf, const char *interface, u_int64_t transport);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -63,22 +63,20 @@ struct _glibtop_netload
|
||||
collisions; /* GLIBTOP_NETLOAD_COLLISIONS */
|
||||
};
|
||||
|
||||
#define glibtop_get_netload(netload,interface,transport,protocol) glibtop_get_netload_l(glibtop_global_server, netload, interface, transport, protocol)
|
||||
|
||||
#if GLIBTOP_SUID_NETLOAD
|
||||
#define glibtop_get_netload_r glibtop_get_netload_p
|
||||
#else
|
||||
#define glibtop_get_netload_r glibtop_get_netload_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_netload_l (glibtop *server, glibtop_netload *buf, const char *interface, unsigned transport, unsigned protocol);
|
||||
int glibtop_get_netload_l (glibtop_client *client, glibtop_netload *buf, const char *interface, unsigned transport, unsigned protocol);
|
||||
|
||||
#if GLIBTOP_SUID_NETLOAD
|
||||
int glibtop_init_netload_p (glibtop *server);
|
||||
int glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, const char *interface, unsigned transport, unsigned protocol);
|
||||
#else
|
||||
int glibtop_init_netload_s (glibtop *server);
|
||||
int glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface, unsigned transport, unsigned protocol);
|
||||
int glibtop_init_netload_s (glibtop_server *server);
|
||||
int glibtop_get_netload_s (glibtop_server *server, glibtop_netload *buf, const char *interface, unsigned transport, unsigned protocol);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define __GLIBTOP_OPEN_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/error.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
@@ -53,7 +52,7 @@ BEGIN_LIBGTOP_DECLS
|
||||
#define GLIBTOP_ERROR_METHOD_DEFAULT GLIBTOP_ERROR_METHOD_WARN_ONCE
|
||||
|
||||
void
|
||||
glibtop_open_l (glibtop *server, const char *backend_name,
|
||||
glibtop_open_l (glibtop_client *client, const char *backend_name,
|
||||
const unsigned long features, const unsigned flags);
|
||||
|
||||
void
|
||||
@@ -61,11 +60,11 @@ glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
const unsigned flags);
|
||||
|
||||
void
|
||||
glibtop_open_p (glibtop *server, const char *program_name,
|
||||
glibtop_open_p (glibtop_server *server, const char *program_name,
|
||||
const unsigned long features, const unsigned flags);
|
||||
|
||||
void
|
||||
glibtop_open_s (glibtop *server, const char *program_name,
|
||||
glibtop_open_s (glibtop_server *server, const char *program_name,
|
||||
const unsigned long features, const unsigned flags);
|
||||
|
||||
#ifdef _IN_LIBGTOP
|
||||
|
||||
@@ -53,22 +53,20 @@ struct _glibtop_ppp
|
||||
bytes_out; /* GLIBTOP_PPP_BYTES_OUT */
|
||||
};
|
||||
|
||||
#define glibtop_get_ppp(ppp,device,use_isdn) glibtop_get_ppp_l(glibtop_global_server, ppp, device, use_isdn)
|
||||
|
||||
#if GLIBTOP_SUID_PPP
|
||||
#define glibtop_get_ppp_r glibtop_get_ppp_p
|
||||
#else
|
||||
#define glibtop_get_ppp_r glibtop_get_ppp_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_ppp_l (glibtop *server, glibtop_ppp *buf, unsigned short device, unsigned short use_isdn);
|
||||
int glibtop_get_ppp_l (glibtop_client *client, glibtop_ppp *buf, unsigned short device, unsigned short use_isdn);
|
||||
|
||||
#if GLIBTOP_SUID_PPP
|
||||
int glibtop_init_ppp_p (glibtop *server);
|
||||
int glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device, unsigned short use_isdn);
|
||||
#else
|
||||
int glibtop_init_ppp_s (glibtop *server);
|
||||
int glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device, unsigned short use_isdn);
|
||||
int glibtop_init_ppp_s (glibtop_server *server);
|
||||
int glibtop_get_ppp_s (glibtop_server *server, glibtop_ppp *buf, unsigned short device, unsigned short use_isdn);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define glibtop_get_proc_args(array,pid) glibtop_get_proc_args_l(glibtop_global_server, array, pid)
|
||||
|
||||
#if GLIBTOP_SUID_PROC_ARGS
|
||||
#define glibtop_get_proc_args_r glibtop_get_proc_args_p
|
||||
#else
|
||||
@@ -43,7 +41,7 @@ BEGIN_LIBGTOP_DECLS
|
||||
#endif
|
||||
|
||||
char **
|
||||
glibtop_get_proc_args_l (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
glibtop_get_proc_args_l (glibtop_client *client, glibtop_array *array, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_ARGS
|
||||
int glibtop_init_proc_args_p (glibtop *server);
|
||||
@@ -51,10 +49,10 @@ int glibtop_init_proc_args_p (glibtop *server);
|
||||
char **
|
||||
glibtop_get_proc_args_p (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_args_s (glibtop *server);
|
||||
int glibtop_init_proc_args_s (glibtop_server *server);
|
||||
|
||||
char **
|
||||
glibtop_get_proc_args_s (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
glibtop_get_proc_args_s (glibtop_server *server, glibtop_array *array, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -51,22 +51,20 @@ struct _glibtop_proc_cwd
|
||||
inode;
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_cwd(p1, p2) glibtop_get_proc_cwd_l(glibtop_global_server, p1, p2)
|
||||
|
||||
#if GLIBTOP_SUID_PROC_CWD
|
||||
#define glibtop_get_proc_cwd_r glibtop_get_proc_cwd_p
|
||||
#else
|
||||
#define glibtop_get_proc_cwd_r glibtop_get_proc_cwd_s
|
||||
#endif
|
||||
|
||||
char *glibtop_get_proc_cwd_l (glibtop *server, glibtop_proc_cwd *buf, pid_t pid);
|
||||
char *glibtop_get_proc_cwd_l (glibtop_client *client, glibtop_proc_cwd *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_CWD
|
||||
int glibtop_init_proc_cwd_p (glibtop *server);
|
||||
char *glibtop_get_proc_cwd_p (glibtop *server, glibtop_proc_cwd *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_cwd_s (glibtop *server);
|
||||
char *glibtop_get_proc_cwd_s (glibtop *server, glibtop_proc_cwd *buf, pid_t pid);
|
||||
int glibtop_init_proc_cwd_s (glibtop_server *server);
|
||||
char *glibtop_get_proc_cwd_s (glibtop_server *server, glibtop_proc_cwd *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -77,22 +77,20 @@ struct _glibtop_proc_kernel
|
||||
char wchan [40];
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_kernel_r glibtop_get_proc_kernel_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
|
||||
int glibtop_get_proc_kernel_l (glibtop_client *client, glibtop_proc_kernel *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_KERNEL
|
||||
int glibtop_init_proc_kernel_p (glibtop *server);
|
||||
int glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_kernel_s (glibtop *server);
|
||||
int glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid);
|
||||
int glibtop_init_proc_kernel_s (glibtop_server *server);
|
||||
int glibtop_get_proc_kernel_s (glibtop_server *server, glibtop_proc_kernel *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -52,8 +52,6 @@ BEGIN_LIBGTOP_DECLS
|
||||
#define GLIBTOP_EXCLUDE_SYSTEM 0x2000
|
||||
#define GLIBTOP_EXCLUDE_NOTTY 0x4000
|
||||
|
||||
#define glibtop_get_proclist(array,which,arg) glibtop_get_proclist_l(glibtop_global_server, array, which, arg)
|
||||
|
||||
#if GLIBTOP_SUID_PROCLIST
|
||||
#define glibtop_get_proclist_r glibtop_get_proclist_p
|
||||
#else
|
||||
@@ -61,7 +59,7 @@ BEGIN_LIBGTOP_DECLS
|
||||
#endif
|
||||
|
||||
unsigned *
|
||||
glibtop_get_proclist_l (glibtop *server, glibtop_array *array,
|
||||
glibtop_get_proclist_l (glibtop_client *client, glibtop_array *array,
|
||||
int64_t which, int64_t arg);
|
||||
|
||||
#if GLIBTOP_SUID_PROCLIST
|
||||
@@ -71,10 +69,10 @@ unsigned *
|
||||
glibtop_get_proclist_p (glibtop *server, glibtop_array *array,
|
||||
int64_t which, int64_t arg);
|
||||
#else
|
||||
int glibtop_init_proclist_s (glibtop *server);
|
||||
int glibtop_init_proclist_s (glibtop_server *server);
|
||||
|
||||
unsigned *
|
||||
glibtop_get_proclist_s (glibtop *server, glibtop_array *array,
|
||||
glibtop_get_proclist_s (glibtop_server *server, glibtop_array *array,
|
||||
int64_t which, int64_t arg);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -60,8 +60,6 @@ struct _glibtop_map_entry
|
||||
char filename [GLIBTOP_MAP_FILENAME_LEN+1];
|
||||
};
|
||||
|
||||
#define glibtop_get_proc_map(array,pid) glibtop_get_proc_map_l(glibtop_global_server, array, pid)
|
||||
|
||||
#if GLIBTOP_SUID_PROC_MAP
|
||||
#define glibtop_get_proc_map_r glibtop_get_proc_map_p
|
||||
#else
|
||||
@@ -69,7 +67,7 @@ struct _glibtop_map_entry
|
||||
#endif
|
||||
|
||||
glibtop_map_entry *
|
||||
glibtop_get_proc_map_l (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
glibtop_get_proc_map_l (glibtop_client *client, glibtop_array *array, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_MAP
|
||||
int glibtop_init_proc_map_p (glibtop *server);
|
||||
@@ -77,10 +75,10 @@ int glibtop_init_proc_map_p (glibtop *server);
|
||||
glibtop_map_entry *
|
||||
glibtop_get_proc_map_p (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_map_s (glibtop *server);
|
||||
int glibtop_init_proc_map_s (glibtop_server *server);
|
||||
|
||||
glibtop_map_entry *
|
||||
glibtop_get_proc_map_s (glibtop *server, glibtop_array *array, pid_t pid);
|
||||
glibtop_get_proc_map_s (glibtop_server *server, glibtop_array *array, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -57,22 +57,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)
|
||||
|
||||
#if GLIBTOP_SUID_PROC_MEM
|
||||
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_p
|
||||
#else
|
||||
#define glibtop_get_proc_mem_r glibtop_get_proc_mem_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
|
||||
int glibtop_get_proc_mem_l (glibtop_client *client, glibtop_proc_mem *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_MEM
|
||||
int glibtop_init_proc_mem_p (glibtop *server);
|
||||
int glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_mem_s (glibtop *server);
|
||||
int glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid);
|
||||
int glibtop_init_proc_mem_s (glibtop_server *server);
|
||||
int glibtop_get_proc_mem_s (glibtop_server *server, glibtop_proc_mem *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -77,22 +77,20 @@ struct _glibtop_proc_segment
|
||||
env_end;
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_segment_r glibtop_get_proc_segment_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
|
||||
int glibtop_get_proc_segment_l (glibtop_client *client, glibtop_proc_segment *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_SEGMENT
|
||||
int glibtop_init_proc_segment_p (glibtop *server);
|
||||
int glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_segment_s (glibtop *server);
|
||||
int glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid);
|
||||
int glibtop_init_proc_segment_s (glibtop_server *server);
|
||||
int glibtop_get_proc_segment_s (glibtop_server *server, glibtop_proc_segment *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -51,22 +51,20 @@ struct _glibtop_proc_signal
|
||||
sigcatch [2]; /* mask of caught signals */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_signal_r glibtop_get_proc_signal_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
|
||||
int glibtop_get_proc_signal_l (glibtop_client *client, glibtop_proc_signal *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_SIGNAL
|
||||
int glibtop_init_proc_signal_p (glibtop *server);
|
||||
int glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_signal_s (glibtop *server);
|
||||
int glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid);
|
||||
int glibtop_init_proc_signal_s (glibtop_server *server);
|
||||
int glibtop_get_proc_signal_s (glibtop_server *server, glibtop_proc_signal *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -77,22 +77,20 @@ struct _glibtop_proc_state
|
||||
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_state_r glibtop_get_proc_state_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf, pid_t pid);
|
||||
int glibtop_get_proc_state_l (glibtop_client *client, glibtop_proc_state *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_STATE
|
||||
int glibtop_init_proc_state_p (glibtop *server);
|
||||
int glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_state_s (glibtop *server);
|
||||
int glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid);
|
||||
int glibtop_init_proc_state_s (glibtop_server *server);
|
||||
int glibtop_get_proc_state_s (glibtop_server *server, glibtop_proc_state *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -74,22 +74,20 @@ struct _glibtop_proc_time
|
||||
xcpu_flags;
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_time_r glibtop_get_proc_time_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf, pid_t pid);
|
||||
int glibtop_get_proc_time_l (glibtop_client *client, glibtop_proc_time *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_TIME
|
||||
int glibtop_init_proc_time_p (glibtop *server);
|
||||
int glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_time_s (glibtop *server);
|
||||
int glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid);
|
||||
int glibtop_init_proc_time_s (glibtop_server *server);
|
||||
int glibtop_get_proc_time_s (glibtop_server *server, glibtop_proc_time *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -79,22 +79,20 @@ struct _glibtop_proc_uid
|
||||
groups [GLIBTOP_MAX_GROUPS]; /* additional prcess groups */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_proc_uid_r glibtop_get_proc_uid_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
|
||||
int glibtop_get_proc_uid_l (glibtop_client *client, glibtop_proc_uid *buf, pid_t pid);
|
||||
|
||||
#if GLIBTOP_SUID_PROC_UID
|
||||
int glibtop_init_proc_uid_p (glibtop *server);
|
||||
int glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
|
||||
#else
|
||||
int glibtop_init_proc_uid_s (glibtop *server);
|
||||
int glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid);
|
||||
int glibtop_init_proc_uid_s (glibtop_server *server);
|
||||
int glibtop_get_proc_uid_s (glibtop_server *server, glibtop_proc_uid *buf, pid_t pid);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -61,22 +61,20 @@ struct _glibtop_sem_limits
|
||||
semaem; /* GLIBTOP_SEM_LIMITS_SEMAEM */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_sem_limits_r glibtop_get_sem_limits_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_sem_limits_l (glibtop *server, glibtop_sem_limits *buf);
|
||||
int glibtop_get_sem_limits_l (glibtop_client *client, glibtop_sem_limits *buf);
|
||||
|
||||
#if GLIBTOP_SUID_SEM_LIMITS
|
||||
int glibtop_init_sem_limits_p (glibtop *server);
|
||||
int glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf);
|
||||
#else
|
||||
int glibtop_init_sem_limits_s (glibtop *server);
|
||||
int glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf);
|
||||
int glibtop_init_sem_limits_s (glibtop_server *server);
|
||||
int glibtop_get_sem_limits_s (glibtop_server *server, glibtop_sem_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -51,22 +51,20 @@ struct _glibtop_shm_limits
|
||||
shmall; /* GLIBTOP_SHM_LIMITS_SHMALL */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_shm_limits_r glibtop_get_shm_limits_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_shm_limits_l (glibtop *server, glibtop_shm_limits *buf);
|
||||
int glibtop_get_shm_limits_l (glibtop_client *client, glibtop_shm_limits *buf);
|
||||
|
||||
#if GLIBTOP_SUID_SHM_LIMITS
|
||||
int glibtop_init_shm_limits_p (glibtop *server);
|
||||
int glibtop_get_shm_limits_p (glibtop *, glibtop_shm_limits *buf);
|
||||
#else
|
||||
int glibtop_init_shm_limits_s (glibtop *server);
|
||||
int glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf);
|
||||
int glibtop_init_shm_limits_s (glibtop_server *server);
|
||||
int glibtop_get_shm_limits_s (glibtop_server *server, glibtop_shm_limits *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -51,22 +51,20 @@ struct _glibtop_swap
|
||||
pageout; /* GLIBTOP_SWAP_PAGEOUT */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_swap_r glibtop_get_swap_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_swap_l (glibtop *server, glibtop_swap *buf);
|
||||
int glibtop_get_swap_l (glibtop_client *client, glibtop_swap *buf);
|
||||
|
||||
#if GLIBTOP_SUID_SWAP
|
||||
int glibtop_init_swap_p (glibtop *server);
|
||||
int glibtop_get_swap_p (glibtop *server, glibtop_swap *buf);
|
||||
#else
|
||||
int glibtop_init_swap_s (glibtop *server);
|
||||
int glibtop_get_swap_s (glibtop *server, glibtop_swap *buf);
|
||||
int glibtop_init_swap_s (glibtop_server *server);
|
||||
int glibtop_get_swap_s (glibtop_server *server, glibtop_swap *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -60,10 +60,6 @@ BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||
|
||||
typedef int (*glibtop_init_func_t) (glibtop *);
|
||||
extern glibtop_init_func_t _glibtop_init_hook_s [];
|
||||
extern glibtop_init_func_t _glibtop_init_hook_p [];
|
||||
|
||||
typedef struct _glibtop_sysdeps glibtop_sysdeps;
|
||||
|
||||
struct _glibtop_sysdeps
|
||||
@@ -98,8 +94,6 @@ struct _glibtop_sysdeps
|
||||
ppp; /* glibtop_ppp */
|
||||
};
|
||||
|
||||
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
|
||||
|
||||
void glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf);
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -55,11 +55,9 @@ struct _glibtop_sysinfo
|
||||
glibtop_entry cpuinfo [GLIBTOP_NCPU];
|
||||
};
|
||||
|
||||
#define glibtop_get_sysinfo() glibtop_get_sysinfo_s(glibtop_global_server)
|
||||
|
||||
#define glibtop_get_sysinfo_r glibtop_get_sysinfo_s
|
||||
|
||||
glibtop_sysinfo *glibtop_get_sysinfo_s (glibtop *server);
|
||||
glibtop_sysinfo *glibtop_get_sysinfo_s (glibtop_server *server);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
@@ -47,22 +47,20 @@ struct _glibtop_uptime
|
||||
u_int64_t boot_time; /* GLIBTOP_UPTIME_BOOT_TIME */
|
||||
};
|
||||
|
||||
#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
|
||||
#else
|
||||
#define glibtop_get_uptime_r glibtop_get_uptime_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf);
|
||||
int glibtop_get_uptime_l (glibtop_client *client, glibtop_uptime *buf);
|
||||
|
||||
#if GLIBTOP_SUID_UPTIME
|
||||
int glibtop_init_uptime_p (glibtop *server);
|
||||
int glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf);
|
||||
#else
|
||||
int glibtop_init_uptime_s (glibtop *server);
|
||||
int glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf);
|
||||
int glibtop_init_uptime_s (glibtop_server *server);
|
||||
int glibtop_get_uptime_s (glibtop_server *server, glibtop_uptime *buf);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
@@ -31,17 +31,11 @@
|
||||
|
||||
BEGIN_LIBGTOP_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_strdup(p1) glibtop_strdup_r(glibtop_global_server, p1)
|
||||
#define glibtop_free(p1) glibtop_free_r(glibtop_global_server, p1)
|
||||
|
||||
void *glibtop_malloc_r (glibtop *server, size_t size);
|
||||
void *glibtop_calloc_r (glibtop *server, size_t nmemb, size_t size);
|
||||
void *glibtop_realloc_r (glibtop *server, void *ptr, size_t size);
|
||||
char *glibtop_strdup_r (glibtop *server, const char *string);
|
||||
void glibtop_free_r (glibtop *server, const void *ptr);
|
||||
void *glibtop_malloc_r (glibtop_server *server, size_t size);
|
||||
void *glibtop_calloc_r (glibtop_server *server, size_t nmemb, size_t size);
|
||||
void *glibtop_realloc_r (glibtop_server *server, void *ptr, size_t size);
|
||||
char *glibtop_strdup_r (glibtop_server *server, const char *string);
|
||||
void glibtop_free_r (glibtop_server *server, const void *ptr);
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user