New file. Creates lib.c' depending upon
features.def'.
1998-06-14 Martin Baulig <martin@home-of-linux.org> * lib/lib.awk: New file. Creates `lib.c' depending upon `features.def'. * lib/<feature>.c: Removed.
This commit is contained in:
committed by
Martin Baulig
parent
44dcb69c41
commit
6130f0a4f9
@@ -8,10 +8,14 @@ CFLAGS = -Wall -W @CFLAGS@ -DGTOP_SERVER=\""@LIBGTOP_SERVER@"\"
|
||||
|
||||
lib_LTLIBRARIES = libgtop.la
|
||||
|
||||
libgtop_la_SOURCES = init.c open.c close.c read.c read_data.c \
|
||||
write.c command.c cpu.c mem.c swap.c uptime.c \
|
||||
loadavg.c shm_limits.c msg_limits.c \
|
||||
sem_limits.c proclist.c procstate.c procuid.c \
|
||||
proctime.c procmem.c procsignal.c prockernel.c \
|
||||
procsegment.c
|
||||
libgtop_la_SOURCES = init.c open.c close.c command.c read.c read_data.c write.c lib.c
|
||||
|
||||
BUILT_SOURCES = lib.c
|
||||
|
||||
lib.c: lib.awk $(top_builddir)/config.h $(top_builddir)/features.def
|
||||
$(AWK) -f $(srcdir)/lib.awk < $(top_builddir)/features.def > lib-t
|
||||
mv lib-t lib.c
|
||||
|
||||
EXTRA_DIST = lib.awk
|
||||
|
||||
CLEANFILES = lib.c
|
||||
|
39
lib/cpu.c
39
lib/cpu.c
@@ -1,39 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/cpu.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about cpu usage. */
|
||||
|
||||
void
|
||||
glibtop_get_cpu_l (glibtop *server, glibtop_cpu *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_CPU) {
|
||||
glibtop_call_l (server, GLIBTOP_CMND_CPU, 0, NULL,
|
||||
sizeof (glibtop_cpu), buf);
|
||||
} else {
|
||||
glibtop_get_cpu_r (server, buf);
|
||||
}
|
||||
}
|
52
lib/lib.awk
Normal file
52
lib/lib.awk
Normal file
@@ -0,0 +1,52 @@
|
||||
BEGIN {
|
||||
print "/* lib.c */";
|
||||
print "/* This is a generated file. Please modify `lib.awk' */";
|
||||
print "";
|
||||
|
||||
print "#include <glibtop.h>";
|
||||
print "#include <glibtop/sysdeps.h>";
|
||||
print "#include <glibtop/command.h>";
|
||||
|
||||
print "";
|
||||
|
||||
}
|
||||
|
||||
function output(feature) {
|
||||
if (feature ~ /^proclist$/) {
|
||||
print "unsigned *";
|
||||
prefix = "return ";
|
||||
} else {
|
||||
prefix = "";
|
||||
print "void";
|
||||
}
|
||||
if (feature ~ /^proc_/) {
|
||||
param = ", pid_t pid";
|
||||
} else {
|
||||
param = "";
|
||||
}
|
||||
|
||||
print "glibtop_get_"feature"_l (glibtop *server, glibtop_"feature" *buf"param")";
|
||||
print "{";
|
||||
print "\tglibtop_init_r (&server, GLIBTOP_SYSDEPS_"toupper(feature)", 0);";
|
||||
print "";
|
||||
print "\tif (server->features & GLIBTOP_SYSDEPS_"toupper(feature)") {";
|
||||
|
||||
if (feature ~ /^proc_/) {
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", sizeof (pid_t),";
|
||||
print "\t\t\t\t&pid, sizeof (glibtop_"feature"), buf);";
|
||||
print "\t} else {";
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf, pid);";
|
||||
} else {
|
||||
print "\t\t"prefix"glibtop_call_l (server, GLIBTOP_CMND_"toupper(feature)", 0, NULL,";
|
||||
print "\t\t\t sizeof (glibtop_"feature"), buf);";
|
||||
print "\t} else {";
|
||||
print "\t\t"prefix"glibtop_get_"feature"_r (server, buf);";
|
||||
}
|
||||
print "\t}";
|
||||
print "}";
|
||||
print "";
|
||||
}
|
||||
|
||||
/^(\w+)/ { output($1) }
|
||||
|
||||
|
@@ -1,39 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <config.h>
|
||||
#include <glibtop/loadavg.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides load averange. */
|
||||
|
||||
void
|
||||
glibtop_get_loadavg_l (glibtop *server, glibtop_loadavg *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_LOADAVG) {
|
||||
glibtop_call_l (server, GLIBTOP_CMND_LOADAVG, 0, NULL,
|
||||
sizeof (glibtop_loadavg), buf);
|
||||
} else {
|
||||
glibtop_get_loadavg_r (server, buf);
|
||||
}
|
||||
}
|
38
lib/mem.c
38
lib/mem.c
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/mem.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about memory usage. */
|
||||
|
||||
void
|
||||
glibtop_get_mem_l (glibtop *server, glibtop_mem *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_MEM, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_MEM) {
|
||||
glibtop_call_l (server, GLIBTOP_CMND_MEM, 0, NULL,
|
||||
sizeof (glibtop_mem), buf);
|
||||
} else {
|
||||
glibtop_get_mem_r (server, buf);
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/msg_limits.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
glibtop_get_msg_limits_l (glibtop *server, glibtop_msg_limits *buf)
|
||||
{
|
||||
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,
|
||||
sizeof (glibtop_msg_limits), buf);
|
||||
} else {
|
||||
glibtop_get_msg_limits_r (server, buf);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/prockernel.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_kernel_l (glibtop *server, glibtop_proc_kernel *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_kernel), buf);
|
||||
} else {
|
||||
glibtop_get_proc_kernel_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/proclist.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Fetch list of currently running processes. */
|
||||
|
||||
unsigned *
|
||||
glibtop_get_proclist_l (glibtop *server, glibtop_proclist *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_PROCLIST, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_PROCLIST) {
|
||||
return glibtop_call_l (server, GLIBTOP_CMND_PROCLIST, 0, NULL,
|
||||
sizeof (glibtop_proclist), buf);
|
||||
} else {
|
||||
return glibtop_get_proclist_r (server, buf);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procmem.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_mem_l (glibtop *server, glibtop_proc_mem *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_mem), buf);
|
||||
} else {
|
||||
glibtop_get_proc_mem_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procsegment.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_segment_l (glibtop *server, glibtop_proc_segment *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_segment), buf);
|
||||
} else {
|
||||
glibtop_get_proc_segment_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procsignal.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_signal_l (glibtop *server, glibtop_proc_signal *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_signal), buf);
|
||||
} else {
|
||||
glibtop_get_proc_signal_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procstate.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_state_l (glibtop *server, glibtop_proc_state *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_state), buf);
|
||||
} else {
|
||||
glibtop_get_proc_state_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/proctime.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_time_l (glibtop *server, glibtop_proc_time *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_time), buf);
|
||||
} else {
|
||||
glibtop_get_proc_time_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/procuid.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides detailed information about a process. */
|
||||
|
||||
void
|
||||
glibtop_get_proc_uid_l (glibtop *server, glibtop_proc_uid *buf,
|
||||
pid_t pid)
|
||||
{
|
||||
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),
|
||||
&pid, sizeof (glibtop_proc_uid), buf);
|
||||
} else {
|
||||
glibtop_get_proc_uid_r (server, buf, pid);
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/sem_limits.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
glibtop_get_sem_limits_l (glibtop *server, glibtop_sem_limits *buf)
|
||||
{
|
||||
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,
|
||||
sizeof (glibtop_sem_limits), buf);
|
||||
} else {
|
||||
glibtop_get_sem_limits_r (server, buf);
|
||||
}
|
||||
}
|
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/shm_limits.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about sysv ipc limits. */
|
||||
|
||||
void
|
||||
glibtop_get_shm_limits_l (glibtop *server, glibtop_shm_limits *buf)
|
||||
{
|
||||
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,
|
||||
sizeof (glibtop_shm_limits), buf);
|
||||
} else {
|
||||
glibtop_get_shm_limits_r (server, buf);
|
||||
}
|
||||
}
|
38
lib/swap.c
38
lib/swap.c
@@ -1,38 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <glibtop/swap.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides information about swap usage. */
|
||||
|
||||
void
|
||||
glibtop_get_swap_l (glibtop *server, glibtop_swap *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_SWAP, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_SWAP) {
|
||||
glibtop_call_l (server, GLIBTOP_CMND_SWAP, 0, NULL,
|
||||
sizeof (glibtop_swap), buf);
|
||||
} else {
|
||||
glibtop_get_swap_r (server, buf);
|
||||
}
|
||||
}
|
39
lib/uptime.c
39
lib/uptime.c
@@ -1,39 +0,0 @@
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the Gnome Top Library.
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
The Gnome Top Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The Gnome Top Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <config.h>
|
||||
#include <glibtop/uptime.h>
|
||||
#include <glibtop/command.h>
|
||||
|
||||
/* Provides uptime and idle time. */
|
||||
|
||||
void
|
||||
glibtop_get_uptime_l (glibtop *server, glibtop_uptime *buf)
|
||||
{
|
||||
glibtop_init_r (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
|
||||
|
||||
if (server->features & GLIBTOP_SYSDEPS_UPTIME) {
|
||||
glibtop_call_l (server, GLIBTOP_CMND_UPTIME, 0, NULL,
|
||||
sizeof (glibtop_uptime), buf);
|
||||
} else {
|
||||
glibtop_get_uptime_r (server, buf);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user