Initial version of the "glibtop-backend-sysdeps" backend.

2000-01-01  Martin Baulig  <martin@home-of-linux.org>

	Initial version of the "glibtop-backend-sysdeps" backend.

	* backend-sysdeps.c: New file.
	* glibtop-backend-private.h: New file.
This commit is contained in:
Martin Baulig
2000-01-01 20:55:05 +00:00
committed by Martin Baulig
parent a567f1a8d1
commit 8797d18587
6 changed files with 288 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.lo
*.la

View File

@@ -0,0 +1,7 @@
2000-01-01 Martin Baulig <martin@home-of-linux.org>
Initial version of the "glibtop-backend-sysdeps" backend.
* backend-sysdeps.c: New file.
* glibtop-backend-private.h: New file.

View File

@@ -0,0 +1,17 @@
LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@
INCLUDES = @INCLUDES@
noinst_HEADERS = \
glibtop-backend-private.h
lib_LTLIBRARIES = \
libgtop_backend_sysdeps.la
libgtop_backend_sysdeps_la_SOURCES = \
backend-sysdeps.c \
call-vector.c
libgtop_backend_sysdeps_la_LDFLAGS = \
$(LT_VERSION_INFO)

View File

@@ -0,0 +1,77 @@
/* -*- 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 1.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.
*/
#include <glibtop.h>
#include <glibtop/global.h>
#include <glibtop/xmalloc.h>
#include <glibtop/open.h>
#include <glibtop/backend.h>
#include <glibtop-backend-private.h>
static int
_open_sysdeps (glibtop *, glibtop_backend *, u_int64_t, const char **);
static int
_close_sysdeps (glibtop *, glibtop_backend *);
extern glibtop_call_vector glibtop_backend_sysdeps_call_vector;
glibtop_backend_info glibtop_backend_sysdeps = {
"glibtop-backend-sysdeps", _open_sysdeps, _close_sysdeps,
&glibtop_backend_sysdeps_call_vector
};
static int
_open_sysdeps (glibtop *server, glibtop_backend *backend,
u_int64_t features, const char **backend_args)
{
glibtop_init_func_t *init_fkt;
backend->_priv = glibtop_calloc_r
(server, 1, sizeof (glibtop_backend_private));
/* Do the initialization, but only if not already initialized. */
if ((server->flags & _GLIBTOP_INIT_STATE_SYSDEPS) == 0) {
glibtop_open_s (server, "glibtop", features, 0);
for (init_fkt = _glibtop_init_hook_s; *init_fkt; init_fkt++)
(*init_fkt) (server);
server->sysdeps.pointer_size = sizeof (void*)*8;
server->flags |= _GLIBTOP_INIT_STATE_SYSDEPS;
}
return 0;
}
static int
_close_sysdeps (glibtop *server, glibtop_backend *backend)
{
return -1;
}

View File

@@ -0,0 +1,147 @@
/* -*- 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 1.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.
*/
#include <glibtop.h>
#include <glibtop/global.h>
#include <glibtop/xmalloc.h>
#include <glibtop/open.h>
#include <glibtop/union.h>
#include <glibtop/backend.h>
glibtop_call_vector glibtop_backend_sysdeps_call_vector = {
#if GLIBTOP_SUID_CPU
NULL,
#else
glibtop_get_cpu_s,
#endif
#if GLIBTOP_SUID_MEM
NULL,
#else
glibtop_get_mem_s,
#endif
#if GLIBTOP_SUID_SWAP
NULL,
#else
glibtop_get_swap_s,
#endif
#if GLIBTOP_SUID_UPTIME
NULL,
#else
glibtop_get_uptime_s,
#endif
#if GLIBTOP_SUID_LOADAVG
NULL,
#else
glibtop_get_loadavg_s,
#endif
#if GLIBTOP_SUID_SHM_LIMITS
NULL,
#else
glibtop_get_shm_limits_s,
#endif
#if GLIBTOP_SUID_MSG_LIMITS
NULL,
#else
glibtop_get_msg_limits_s,
#endif
#if GLIBTOP_SUID_SEM_LIMITS
NULL,
#else
glibtop_get_sem_limits_s,
#endif
#if GLIBTOP_SUID_PROCLIST
NULL,
#else
glibtop_get_proclist_s,
#endif
#if GLIBTOP_SUID_PROC_STATE
NULL,
#else
glibtop_get_proc_state_s,
#endif
#if GLIBTOP_SUID_PROC_UID
NULL,
#else
glibtop_get_proc_uid_s,
#endif
#if GLIBTOP_SUID_PROC_MEM
NULL,
#else
glibtop_get_proc_mem_s,
#endif
#if GLIBTOP_SUID_PROC_TIME
NULL,
#else
glibtop_get_proc_time_s,
#endif
#if GLIBTOP_SUID_PROC_SIGNAL
NULL,
#else
glibtop_get_proc_signal_s,
#endif
#if GLIBTOP_SUID_PROC_KERNEL
NULL,
#else
glibtop_get_proc_kernel_s,
#endif
#if GLIBTOP_SUID_PROC_SEGMENT
NULL,
#else
glibtop_get_proc_segment_s,
#endif
#if GLIBTOP_SUID_PROC_ARGS
NULL,
#else
glibtop_get_proc_args_s,
#endif
#if GLIBTOP_SUID_PROC_MAP
NULL,
#else
glibtop_get_proc_map_s,
#endif
glibtop_get_mountlist_s,
glibtop_get_fsusage_s,
#if GLIBTOP_SUID_INTERFACE_NAMES
NULL,
#else
glibtop_get_interface_names_s,
#endif
#if GLIBTOP_SUID_NETINFO
NULL,
#else
glibtop_get_netinfo_s,
#endif
#if GLIBTOP_SUID_NETLOAD
NULL,
#else
glibtop_get_netload_s,
#endif
#if GLIBTOP_SUID_PPP
NULL
#else
glibtop_get_ppp_s
#endif
};

View File

@@ -0,0 +1,34 @@
/* -*- 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 1.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_BACKEND_PRIVATE_H__
#define __GLIBTOP_BACKEND_PRIVATE_H__
struct _glibtop_backend_private
{
u_int64_t flags;
};
#endif