diff options
author | Martin Baulig <martin@home-of-linux.org> | 1998-06-14 00:57:03 +0000 |
---|---|---|
committer | Martin Baulig <martin@src.gnome.org> | 1998-06-14 00:57:03 +0000 |
commit | 13148c632fb5a4cb52e6135d4d295cf94baf878f (patch) | |
tree | d610ff42bd0a504c239e4504f3f950f2233e9487 | |
parent | 6fd3c113ec11a47acf0d7c6bf11c48c418d5760e (diff) | |
download | libgtop-13148c632fb5a4cb52e6135d4d295cf94baf878f.tar.gz |
New file. Creates `gulie.c' depending upon `features.def'.
1998-06-14 Martin Baulig <martin@home-of-linux.org>
* sysdeps/guile/guile.awk: New file.
Creates `gulie.c' depending upon `features.def'.
* sysdeps/guile/*.c: Removed.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | features.def | 33 | ||||
-rw-r--r-- | sysdeps/guile/Makefile.am | 12 | ||||
-rw-r--r-- | sysdeps/guile/boot.c | 66 | ||||
-rw-r--r-- | sysdeps/guile/cpu.c | 41 | ||||
-rw-r--r-- | sysdeps/guile/guile.awk | 87 | ||||
-rw-r--r-- | sysdeps/guile/loadavg.c | 38 | ||||
-rw-r--r-- | sysdeps/guile/mem.c | 43 | ||||
-rw-r--r-- | sysdeps/guile/msg_limits.c | 42 | ||||
-rw-r--r-- | sysdeps/guile/names/Makefile.am | 2 | ||||
-rw-r--r-- | sysdeps/guile/names/guile-names.awk | 28 | ||||
-rw-r--r-- | sysdeps/guile/prockernel.c | 44 | ||||
-rw-r--r-- | sysdeps/guile/proclist.c | 55 | ||||
-rw-r--r-- | sysdeps/guile/procmem.c | 42 | ||||
-rw-r--r-- | sysdeps/guile/procsegment.c | 43 | ||||
-rw-r--r-- | sysdeps/guile/procsignal.c | 40 | ||||
-rw-r--r-- | sysdeps/guile/procstate.c | 40 | ||||
-rw-r--r-- | sysdeps/guile/proctime.c | 43 | ||||
-rw-r--r-- | sysdeps/guile/procuid.c | 48 | ||||
-rw-r--r-- | sysdeps/guile/sem_limits.c | 45 | ||||
-rw-r--r-- | sysdeps/guile/shm_limits.c | 40 | ||||
-rw-r--r-- | sysdeps/guile/swap.c | 38 | ||||
-rw-r--r-- | sysdeps/guile/sysdeps.c | 51 | ||||
-rw-r--r-- | sysdeps/guile/uptime.c | 37 |
24 files changed, 138 insertions, 827 deletions
@@ -1,3 +1,10 @@ +1998-06-14 Martin Baulig <martin@home-of-linux.org> + + * sysdeps/guile/guile.awk: New file. + Creates `gulie.c' depending upon `features.def'. + + * sysdeps/guile/*.c: Removed. + 1998-06-13 Martin Baulig <martin@home-of-linux.org> * features.def: List of features for `guile-names.awk'. diff --git a/features.def b/features.def index dc17abb0..d4de80a1 100644 --- a/features.def +++ b/features.def @@ -1,17 +1,16 @@ -cpu -mem -swap -uptime -loadavg -shm_limits -msg_limits -sem_limits -proclist -proc_state -proc_uid -proc_mem -proc_time -proc_signal -proc_kernel -proc_segment -sysdeps +cpu ulong(total,user,nice,sys,idle,frequency) +mem ulong(total,used,free,shared,buffer,cached,user,locked) +swap ulong(total,used,free) +uptime double(uptime,idletime) +loadavg double(loadavg[0],loadavg[1],loadavg[2]) +shm_limits ulong(shmmax,shmmin,shmmni,shmseg,shmall) +msg_limits ulong(msgpool,msgmap,msgmax,msgmnb,msgmni,msgssz,msgtql) +sem_limits ulong(semmap,semmni,semmns,semmnu,semmsl,semopm,semume,semusz,semvmx,semaem) +proclist ulong(number,size,total) +proc_state str(cmd):char(state):ulong(uid,gid) +proc_uid long(uid,euid,gid,egid,pid,ppid,pgrp,session,tty,tpgid,priority,nice) +proc_mem long(size,vsize,resident,share,rss,rss_rlim) +proc_time long(start_time,utime,stime,cutime,cstime,timeout,it_real_value) +proc_signal long(signal,blocked,sigignore,sigcatch) +proc_kernel ulong(k_flags,min_flt,maj_flt,cmin_flt,cmaj_flt,kstk_esp,kstk_eip,wchan) +proc_segment long(trs,lrs,drs,dt):ulong(start_code,end_code,start_stack) diff --git a/sysdeps/guile/Makefile.am b/sysdeps/guile/Makefile.am index 19bd1d1d..50372156 100644 --- a/sysdeps/guile/Makefile.am +++ b/sysdeps/guile/Makefile.am @@ -19,3 +19,15 @@ libgtop_guile_la_SOURCES = boot.c sysdeps.c cpu.c mem.c swap.c uptime.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c + +libgtop_guile_la_SOURCES = guile.c + +BUILT_SOURCES = guile.c + +guile.c: guile.awk $(top_builddir)/config.h $(top_builddir)/features.def + $(AWK) -f $(srcdir)/guile.awk < $(top_builddir)/features.def > gnc-t + mv gnc-t guile.c + +EXTRA_DIST = guile.awk + +CLEANFILES = guile.c diff --git a/sysdeps/guile/boot.c b/sysdeps/guile/boot.c deleted file mode 100644 index fbd86941..00000000 --- a/sysdeps/guile/boot.c +++ /dev/null @@ -1,66 +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/sysdeps.h> - -#include <guile/gh.h> - -void -glibtop_boot_guile (void) -{ - gh_new_procedure0_0 - ("glibtop-get-cpu", glibtop_guile_get_cpu); - gh_new_procedure0_0 - ("glibtop-get-mem", glibtop_guile_get_mem); - gh_new_procedure0_0 - ("glibtop-get-swap", glibtop_guile_get_swap); - gh_new_procedure0_0 - ("glibtop-get-uptime", glibtop_guile_get_uptime); - gh_new_procedure0_0 - ("glibtop-get-loadavg", glibtop_guile_get_loadavg); - gh_new_procedure0_0 - ("glibtop-get-shm_limits",glibtop_guile_get_shm_limits); - gh_new_procedure0_0 - ("glibtop-get-msg_limits", glibtop_guile_get_msg_limits); - gh_new_procedure0_0 - ("glibtop-get-sem_limits", glibtop_guile_get_sem_limits); - gh_new_procedure0_0 - ("glibtop-get-sysdeps", glibtop_guile_get_sysdeps); - gh_new_procedure0_0 - ("glibtop-get-proclist", glibtop_guile_get_proclist); - - gh_new_procedure1_0 - ("glibtop-get-proc_state", glibtop_guile_get_proc_state); - gh_new_procedure1_0 - ("glibtop-get-proc_uid", glibtop_guile_get_proc_uid); - gh_new_procedure1_0 - ("glibtop-get-proc_mem", glibtop_guile_get_proc_mem); - gh_new_procedure1_0 - ("glibtop-get-proc_time", glibtop_guile_get_proc_time); - gh_new_procedure1_0 - ("glibtop-get-proc_signal", glibtop_guile_get_proc_signal); - gh_new_procedure1_0 - ("glibtop-get-proc_kernel", glibtop_guile_get_proc_kernel); - gh_new_procedure1_0 - ("glibtop-get-proc_segment", glibtop_guile_get_proc_segment); - -} diff --git a/sysdeps/guile/cpu.c b/sysdeps/guile/cpu.c deleted file mode 100644 index 707b4af7..00000000 --- a/sysdeps/guile/cpu.c +++ /dev/null @@ -1,41 +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 <guile/gh.h> - -SCM glibtop_guile_get_cpu (void) -{ - glibtop_cpu cpu; - - glibtop_get_cpu (&cpu); - - return gh_list (gh_ulong2scm (cpu.flags), - gh_ulong2scm (cpu.total), - gh_ulong2scm (cpu.user), - gh_ulong2scm (cpu.nice), - gh_ulong2scm (cpu.sys), - gh_ulong2scm (cpu.idle), - gh_ulong2scm (cpu.frequency), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/guile.awk b/sysdeps/guile/guile.awk new file mode 100644 index 00000000..25d293f0 --- /dev/null +++ b/sysdeps/guile/guile.awk @@ -0,0 +1,87 @@ +BEGIN { + print "/* guile.c */"; + print "/* This is a generated file. Please modify `guile.awk' */"; + print ""; + + print "#include <glibtop.h>"; + print "#include <glibtop/xmalloc.h>"; + print "#include <glibtop/sysdeps.h>"; + print ""; + print "#include <guile/gh.h>"; + + print ""; + + convert["long"] = "gh_long2scm "; + convert["ulong"] = "gh_ulong2scm "; + convert["double"] = "gh_double2scm"; + convert["str"] = "gh_str02scm "; + convert["char"] = "gh_char2scm "; +} + +/^(\w+)/ { + features[$1] = $1; + if ($1 ~ /^proclist$/) { + output = "SCM\nglibtop_guile_get_proclist (void)\n{\n"; + output = output"\tglibtop_proclist proclist;\n\tunsigned i, *ptr;\n"; + output = output"\tSCM list;\n\n\tptr = glibtop_get_proclist (&proclist);\n\n"; + output = output"\tlist = gh_list (gh_ulong2scm ("$1".flags),\n\t\t\t"; + } else { + if ($1 ~ /^proc_/) { + output = "SCM\nglibtop_guile_get_"$1" (SCM pid)\n{\n"; + output = output"\tglibtop_"$1" "$1";\n\n"; + output = output"\tglibtop_get_"$1" (&"$1", (pid_t) gh_scm2long (pid));\n\n"; + } else { + output = "SCM\nglibtop_guile_get_"$1" (void)\n{\n"; + output = output"\tglibtop_"$1" "$1";\n\n"; + output = output"\tglibtop_get_"$1" (&"$1");\n\n"; + } + output = output"\treturn gh_list (gh_ulong2scm ("$1".flags),\n\t\t\t"; + } + nr_elements = split ($2, elements, /:/); + for (element = 1; element <= nr_elements; element++) { + list = elements[element]; + type = elements[element]; + sub(/\(.*/, "", type); + sub(/^\w+\(/, "", list); sub(/\)$/, "", list); + count = split (list, fields, /,/); + for (field = 1; field <= count; field++) { + output = output""convert[type]" ("$1"."fields[field]"),\n\t\t\t"; + } + } + output = output"SCM_UNDEFINED);"; + print output; + + if ($1 ~ /^proclist$/) { + print ""; + print "\tif (ptr) {"; + print "\t\tfor (i = 0; i < proclist.number; i++)"; + print "\t\t\tlist = gh_append"; + print "\t\t\t\t(gh_list (list,"; + print "\t\t\t\t\t gh_list (gh_ulong2scm ((unsigned long) ptr [i])),"; + print "\t\t\t\t\t SCM_UNDEFINED));"; + print "\t}"; + print ""; + print "\tglibtop_free (ptr);"; + print ""; + print "\treturn list;"; + } + print "}"; + print ""; +} + +END { + print "void"; + print "glibtop_boot_guile (void)"; + print "{"; + + for (feature in features) { + if (feature ~ /^proc_/) { + print "\tgh_new_procedure1_0"; + } else { + print "\tgh_new_procedure0_0"; + } + print "\t\t(\"glibtop-get-"feature"\", glibtop_guile_get_"feature");"; + } + print "}"; +} + diff --git a/sysdeps/guile/loadavg.c b/sysdeps/guile/loadavg.c deleted file mode 100644 index 1ace95ff..00000000 --- a/sysdeps/guile/loadavg.c +++ /dev/null @@ -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.h> -#include <glibtop/loadavg.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_loadavg (void) -{ - glibtop_loadavg loadavg; - - glibtop_get_loadavg (&loadavg); - - return gh_list (gh_ulong2scm (loadavg.flags), - gh_double2scm (loadavg.loadavg [0]), - gh_double2scm (loadavg.loadavg [1]), - gh_double2scm (loadavg.loadavg [2]), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/mem.c b/sysdeps/guile/mem.c deleted file mode 100644 index 38618dc0..00000000 --- a/sysdeps/guile/mem.c +++ /dev/null @@ -1,43 +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/mem.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_mem (void) -{ - glibtop_mem mem; - - glibtop_get_mem (&mem); - - return gh_list (gh_ulong2scm (mem.flags), - gh_ulong2scm (mem.total), - gh_ulong2scm (mem.used), - gh_ulong2scm (mem.free), - gh_ulong2scm (mem.shared), - gh_ulong2scm (mem.buffer), - gh_ulong2scm (mem.cached), - gh_ulong2scm (mem.user), - gh_ulong2scm (mem.locked), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/msg_limits.c b/sysdeps/guile/msg_limits.c deleted file mode 100644 index 35e88593..00000000 --- a/sysdeps/guile/msg_limits.c +++ /dev/null @@ -1,42 +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/msg_limits.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_msg_limits (void) -{ - glibtop_msg_limits msg_limits; - - glibtop_get_msg_limits (&msg_limits); - - return gh_list (gh_ulong2scm (msg_limits.flags), - gh_ulong2scm (msg_limits.msgpool), - gh_ulong2scm (msg_limits.msgmap), - gh_ulong2scm (msg_limits.msgmax), - gh_ulong2scm (msg_limits.msgmnb), - gh_ulong2scm (msg_limits.msgmni), - gh_ulong2scm (msg_limits.msgssz), - gh_ulong2scm (msg_limits.msgtql), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/names/Makefile.am b/sysdeps/guile/names/Makefile.am index 07c4bba4..cd86bc57 100644 --- a/sysdeps/guile/names/Makefile.am +++ b/sysdeps/guile/names/Makefile.am @@ -18,3 +18,5 @@ guile-names.c: guile-names.awk $(top_builddir)/config.h $(top_builddir)/features EXTRA_DIST = guile-names.awk +CLEANFILES = guile-names.c + diff --git a/sysdeps/guile/names/guile-names.awk b/sysdeps/guile/names/guile-names.awk index 54ecb6e8..11693343 100644 --- a/sysdeps/guile/names/guile-names.awk +++ b/sysdeps/guile/names/guile-names.awk @@ -12,19 +12,19 @@ BEGIN { } -output ($feature) { +function output(feature) { print "SCM"; - print "glibtop_guile_names_"$feature" (void)"; + print "glibtop_guile_names_"feature" (void)"; print "{"; print "\tint i;"; print "\tSCM list;"; print ""; print "\tlist = gh_list (SCM_UNDEFINED);"; print ""; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper($feature)"; i++)"; + print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; print "\t\tlist = gh_append"; print "\t\t\t(gh_list (list,"; - print "\t\t\t\t gh_list (gh_str02scm ((char *) glibtop_names_"$feature" [i])),"; + print "\t\t\t\t gh_list (gh_str02scm ((char *) glibtop_names_"feature" [i])),"; print "\t\t\t\t SCM_UNDEFINED));"; print ""; print "\treturn list;"; @@ -33,17 +33,17 @@ output ($feature) { print ""; print "SCM"; - print "glibtop_guile_types_"$feature" (void)"; + print "glibtop_guile_types_"feature" (void)"; print "{"; print "\tint i;"; print "\tSCM list;"; print ""; print "\tlist = gh_list (SCM_UNDEFINED);"; print ""; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper($feature)"; i++)"; + print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; print "\t\tlist = gh_append"; print "\t\t\t(gh_list (list,"; - print "\t\t\t\t gh_list (gh_ulong2scm (glibtop_types_"$feature" [i])),"; + print "\t\t\t\t gh_list (gh_ulong2scm (glibtop_types_"feature" [i])),"; print "\t\t\t\t SCM_UNDEFINED));"; print ""; print "\treturn list;"; @@ -52,18 +52,18 @@ output ($feature) { print ""; print "SCM"; - print "glibtop_guile_labels_"$feature" (void)"; + print "glibtop_guile_labels_"feature" (void)"; print "{"; print "\tint i;"; print "\tSCM list;"; print ""; print "\tlist = gh_list (SCM_UNDEFINED);"; print ""; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper($feature)"; i++)"; + print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; print "\t\tlist = gh_append"; print "\t\t\t(gh_list (list,"; print "\t\t\t\t gh_list (gh_str02scm (gettext"; - print "\t\t\t\t\t\t\t(glibtop_labels_"$feature" [i]))),"; + print "\t\t\t\t\t\t\t(glibtop_labels_"feature" [i]))),"; print "\t\t\t\t SCM_UNDEFINED));"; print ""; print "\treturn list;"; @@ -72,18 +72,18 @@ output ($feature) { print ""; print "SCM"; - print "glibtop_guile_descriptions_"$feature" (void)"; + print "glibtop_guile_descriptions_"feature" (void)"; print "{"; print "\tint i;"; print "\tSCM list;"; print ""; print "\tlist = gh_list (SCM_UNDEFINED);"; print ""; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper($feature)"; i++)"; + print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; print "\t\tlist = gh_append"; print "\t\t\t(gh_list (list,"; print "\t\t\t\t gh_list (gh_str02scm (gettext"; - print "\t\t\t\t\t\t\t(glibtop_descriptions_"$feature" [i]))),"; + print "\t\t\t\t\t\t\t(glibtop_descriptions_"feature" [i]))),"; print "\t\t\t\t SCM_UNDEFINED));"; print ""; print "\treturn list;"; @@ -96,7 +96,7 @@ output ($feature) { END { for (feature in features) { - output (feature); + output(feature); } print "void"; diff --git a/sysdeps/guile/prockernel.c b/sysdeps/guile/prockernel.c deleted file mode 100644 index 6702467c..00000000 --- a/sysdeps/guile/prockernel.c +++ /dev/null @@ -1,44 +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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_kernel (SCM pid) -{ - glibtop_proc_kernel p; - - glibtop_get_proc_kernel (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_ulong2scm (p.k_flags), - gh_ulong2scm (p.min_flt), - gh_ulong2scm (p.maj_flt), - gh_ulong2scm (p.cmin_flt), - gh_ulong2scm (p.cmaj_flt), - gh_ulong2scm (p.kstk_esp), - gh_ulong2scm (p.kstk_eip), - gh_ulong2scm (p.wchan), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/proclist.c b/sysdeps/guile/proclist.c deleted file mode 100644 index 7491805f..00000000 --- a/sysdeps/guile/proclist.c +++ /dev/null @@ -1,55 +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/xmalloc.h> -#include <glibtop/proclist.h> - -#include <guile/gh.h> - -SCM -glibtop_guile_get_proclist (void) -{ - glibtop_proclist proclist; - unsigned *ptr; - unsigned i; - SCM list; - - ptr = glibtop_get_proclist (&proclist); - - list = gh_list (gh_ulong2scm (proclist.flags), - gh_ulong2scm (proclist.number), - gh_ulong2scm (proclist.size), - gh_ulong2scm (proclist.total), - SCM_UNDEFINED); - - if (ptr) { - for (i = 0; i < proclist.number; i++) - list = gh_append - (gh_list (list, - gh_list (gh_ulong2scm ((unsigned long) ptr [i])), - SCM_UNDEFINED)); - } - - glibtop_free (ptr); - - return list; -} diff --git a/sysdeps/guile/procmem.c b/sysdeps/guile/procmem.c deleted file mode 100644 index e1862c3b..00000000 --- a/sysdeps/guile/procmem.c +++ /dev/null @@ -1,42 +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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_mem (SCM pid) -{ - glibtop_proc_mem p; - - glibtop_get_proc_mem (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_long2scm (p.size), - gh_long2scm (p.vsize), - gh_long2scm (p.resident), - gh_long2scm (p.share), - gh_long2scm (p.rss), - gh_long2scm (p.rss_rlim), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/procsegment.c b/sysdeps/guile/procsegment.c deleted file mode 100644 index dbc49915..00000000 --- a/sysdeps/guile/procsegment.c +++ /dev/null @@ -1,43 +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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_segment (SCM pid) -{ - glibtop_proc_segment p; - - glibtop_get_proc_segment (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_long2scm (p.trs), - gh_long2scm (p.lrs), - gh_long2scm (p.drs), - gh_long2scm (p.dt), - gh_ulong2scm (p.start_code), - gh_ulong2scm (p.end_code), - gh_ulong2scm (p.start_stack), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/procsignal.c b/sysdeps/guile/procsignal.c deleted file mode 100644 index 9b580c5b..00000000 --- a/sysdeps/guile/procsignal.c +++ /dev/null @@ -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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_signal (SCM pid) -{ - glibtop_proc_signal p; - - glibtop_get_proc_signal (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_long2scm (p.signal), - gh_long2scm (p.blocked), - gh_long2scm (p.sigignore), - gh_long2scm (p.sigcatch), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/procstate.c b/sysdeps/guile/procstate.c deleted file mode 100644 index 1b51f2ed..00000000 --- a/sysdeps/guile/procstate.c +++ /dev/null @@ -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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_state (SCM pid) -{ - glibtop_proc_state p; - - glibtop_get_proc_state (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_str02scm (p.cmd), - gh_char2scm (p.state), - gh_ulong2scm (p.uid), - gh_ulong2scm (p.gid), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/proctime.c b/sysdeps/guile/proctime.c deleted file mode 100644 index 52a6bfcd..00000000 --- a/sysdeps/guile/proctime.c +++ /dev/null @@ -1,43 +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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_time (SCM pid) -{ - glibtop_proc_time p; - - glibtop_get_proc_time (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_long2scm (p.start_time), - gh_long2scm (p.utime), - gh_long2scm (p.stime), - gh_long2scm (p.cutime), - gh_long2scm (p.cstime), - gh_long2scm (p.timeout), - gh_long2scm (p.it_real_value), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/procuid.c b/sysdeps/guile/procuid.c deleted file mode 100644 index 96c7033c..00000000 --- a/sysdeps/guile/procuid.c +++ /dev/null @@ -1,48 +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 <guile/gh.h> - -SCM -glibtop_guile_get_proc_uid (SCM pid) -{ - glibtop_proc_uid p; - - glibtop_get_proc_uid (&p, (pid_t) gh_scm2long (pid)); - - return gh_list (gh_ulong2scm (p.flags), - gh_long2scm (p.uid), - gh_long2scm (p.euid), - gh_long2scm (p.gid), - gh_long2scm (p.egid), - gh_long2scm (p.pid), - gh_long2scm (p.ppid), - gh_long2scm (p.pgrp), - gh_long2scm (p.session), - gh_long2scm (p.tty), - gh_long2scm (p.tpgid), - gh_long2scm (p.priority), - gh_long2scm (p.nice), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/sem_limits.c b/sysdeps/guile/sem_limits.c deleted file mode 100644 index ca2b10af..00000000 --- a/sysdeps/guile/sem_limits.c +++ /dev/null @@ -1,45 +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/sem_limits.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_sem_limits (void) -{ - glibtop_sem_limits sem_limits; - - glibtop_get_sem_limits (&sem_limits); - - return gh_list (gh_ulong2scm (sem_limits.flags), - gh_ulong2scm (sem_limits.semmap), - gh_ulong2scm (sem_limits.semmni), - gh_ulong2scm (sem_limits.semmns), - gh_ulong2scm (sem_limits.semmnu), - gh_ulong2scm (sem_limits.semmsl), - gh_ulong2scm (sem_limits.semopm), - gh_ulong2scm (sem_limits.semume), - gh_ulong2scm (sem_limits.semusz), - gh_ulong2scm (sem_limits.semvmx), - gh_ulong2scm (sem_limits.semaem), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/shm_limits.c b/sysdeps/guile/shm_limits.c deleted file mode 100644 index e0efd174..00000000 --- a/sysdeps/guile/shm_limits.c +++ /dev/null @@ -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/shm_limits.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_shm_limits (void) -{ - glibtop_shm_limits shm_limits; - - glibtop_get_shm_limits (&shm_limits); - - return gh_list (gh_ulong2scm (shm_limits.flags), - gh_ulong2scm (shm_limits.shmmax), - gh_ulong2scm (shm_limits.shmmin), - gh_ulong2scm (shm_limits.shmmni), - gh_ulong2scm (shm_limits.shmseg), - gh_ulong2scm (shm_limits.shmall), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/swap.c b/sysdeps/guile/swap.c deleted file mode 100644 index 4ab39ab8..00000000 --- a/sysdeps/guile/swap.c +++ /dev/null @@ -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.h> -#include <glibtop/swap.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_swap (void) -{ - glibtop_swap swap; - - glibtop_get_swap (&swap); - - return gh_list (gh_ulong2scm (swap.flags), - gh_ulong2scm (swap.total), - gh_ulong2scm (swap.used), - gh_ulong2scm (swap.free), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/sysdeps.c b/sysdeps/guile/sysdeps.c deleted file mode 100644 index 90a4b04d..00000000 --- a/sysdeps/guile/sysdeps.c +++ /dev/null @@ -1,51 +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/sysdeps.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_sysdeps (void) -{ - glibtop_sysdeps sysdeps; - - glibtop_get_sysdeps (&sysdeps); - - return gh_list (gh_ulong2scm (sysdeps.flags), - gh_ulong2scm (sysdeps.cpu), - gh_ulong2scm (sysdeps.mem), - gh_ulong2scm (sysdeps.swap), - gh_ulong2scm (sysdeps.uptime), - gh_ulong2scm (sysdeps.loadavg), - gh_ulong2scm (sysdeps.shm_limits), - gh_ulong2scm (sysdeps.msg_limits), - gh_ulong2scm (sysdeps.sem_limits), - gh_ulong2scm (sysdeps.proclist), - gh_ulong2scm (sysdeps.proc_state), - gh_ulong2scm (sysdeps.proc_uid), - gh_ulong2scm (sysdeps.proc_mem), - gh_ulong2scm (sysdeps.proc_time), - gh_ulong2scm (sysdeps.proc_signal), - gh_ulong2scm (sysdeps.proc_kernel), - gh_ulong2scm (sysdeps.proc_segment), - SCM_UNDEFINED); -} diff --git a/sysdeps/guile/uptime.c b/sysdeps/guile/uptime.c deleted file mode 100644 index 2425c751..00000000 --- a/sysdeps/guile/uptime.c +++ /dev/null @@ -1,37 +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/uptime.h> - -#include <guile/gh.h> - -SCM glibtop_guile_get_uptime (void) -{ - glibtop_uptime uptime; - - glibtop_get_uptime (&uptime); - - return gh_list (gh_ulong2scm (uptime.flags), - gh_double2scm (uptime.uptime), - gh_double2scm (uptime.idletime), - SCM_UNDEFINED); -} |