From 70bbae9b75ae13cf8fc906e19149a9f219f31149 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 11 Oct 1998 09:59:16 +0000 Subject: [PATCH] Removed everything in this subdirectory. This was only experimental. The 1998-10-11 Martin Baulig * perl: Removed everything in this subdirectory. This was only experimental. The real perl bindings for LibGTop are in the libgtop-bindings module. --- ChangeLog | 6 ++ Makefile.am | 4 -- perl/.cvsignore | 4 -- perl/AUTHORS | 0 perl/Automakefile.am | 33 ---------- perl/ChangeLog | 20 ------ perl/Libgtop.pm | 31 --------- perl/MANIFEST | 31 --------- perl/MANIFEST.SKIP | 22 ------- perl/Makefile.PL.in | 13 ---- perl/NEWS | 0 perl/NO-AUTO-GEN | 0 perl/Names/.cvsignore | 1 - perl/Names/MANIFEST | 10 --- perl/Names/Makefile.PL.in | 10 --- perl/Names/Names.pm | 24 ------- perl/Names/names.awk | 88 ------------------------- perl/Names/test.pl | 20 ------ perl/README | 15 ----- perl/acconfig.h | 33 ---------- perl/autogen.sh | 91 ------------------------- perl/configure.in | 24 ------- perl/new.pl | 16 ----- perl/perl.awk | 135 -------------------------------------- perl/stamp-h.in | 1 - perl/test.pl | 20 ------ perl/typemap | 22 ------- 27 files changed, 6 insertions(+), 668 deletions(-) delete mode 100644 perl/.cvsignore delete mode 100644 perl/AUTHORS delete mode 100644 perl/Automakefile.am delete mode 100644 perl/ChangeLog delete mode 100644 perl/Libgtop.pm delete mode 100644 perl/MANIFEST delete mode 100644 perl/MANIFEST.SKIP delete mode 100644 perl/Makefile.PL.in delete mode 100644 perl/NEWS delete mode 100644 perl/NO-AUTO-GEN delete mode 100644 perl/Names/.cvsignore delete mode 100644 perl/Names/MANIFEST delete mode 100644 perl/Names/Makefile.PL.in delete mode 100644 perl/Names/Names.pm delete mode 100644 perl/Names/names.awk delete mode 100644 perl/Names/test.pl delete mode 100644 perl/README delete mode 100644 perl/acconfig.h delete mode 100755 perl/autogen.sh delete mode 100644 perl/configure.in delete mode 100755 perl/new.pl delete mode 100644 perl/perl.awk delete mode 100644 perl/stamp-h.in delete mode 100644 perl/test.pl delete mode 100644 perl/typemap diff --git a/ChangeLog b/ChangeLog index ea80ca2d..569c18be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1998-10-11 Martin Baulig + + * perl: Removed everything in this subdirectory. This was + only experimental. The real perl bindings for LibGTop are + in the libgtop-bindings module. + 1998-10-11 Martin Baulig * src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm diff --git a/Makefile.am b/Makefile.am index a4d080d2..6555bb62 100644 --- a/Makefile.am +++ b/Makefile.am @@ -33,8 +33,6 @@ confexec_DATA = $(top_builddir)/libgtopConf.sh bin_SCRIPTS = $(top_builddir)/libgtop-config -noinst_DATA = $(top_builddir)/perl/features.def - ## to automatically rebuild aclocal.m4 if any of the macros in ## `macros/' change @MAINT@include macros/macros.dep @@ -80,5 +78,3 @@ libgtop-config: libgtop-config.in Makefile && mv libgtop-config.tmp libgtop-config && \ chmod 755 libgtop-config -perl/features.def: features.def - cd perl && @LN_S@ $(srcdir)/features.def diff --git a/perl/.cvsignore b/perl/.cvsignore deleted file mode 100644 index c4c7bbf6..00000000 --- a/perl/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -Automakefile Automakefile.in -configure config.h Makefile.PL blib Libgtop.xs -Makefile pm_to_blib Libgtop.c -stamp.h.in features.def Libgtop.bs diff --git a/perl/AUTHORS b/perl/AUTHORS deleted file mode 100644 index e69de29b..00000000 diff --git a/perl/Automakefile.am b/perl/Automakefile.am deleted file mode 100644 index 45eec654..00000000 --- a/perl/Automakefile.am +++ /dev/null @@ -1,33 +0,0 @@ -## Process this file with automake to produce Makefile.in. - -EXTRA_DIST = Makefile.PL.in perl.awk Names/Makefile.PL.in Names/names.awk - -noinst_DATA = $(top_builddir)/Libgtop.xs \ - $(top_builddir)/Names/Names.xs - -Libgtop.xs: perl.awk $(top_builddir)/config.h $(top_builddir)/features.def - $(AWK) -f $(top_srcdir)/perl.awk < $(top_builddir)/features.def > lgt-t - mv lgt-t Libgtop.xs - -Names/Names.xs: Names/names.awk $(top_builddir)/config.h $(top_builddir)/features.def - $(AWK) -f $(top_srcdir)/Names/names.awk < $(top_builddir)/features.def > Names/lgtn-t - mv Names/lgtn-t Names/Names.xs - -Makefile Names/Makefile: Libgtop.xs Names/Names.xs Makefile.PL Names/Makefile.PL - perl $(top_builddir)/Makefile.PL - -all: Makefile Names/Makefile - $(MAKE) -f Makefile - -clean-local: - (cd Names && rm -rf Names.c blib Makefile.aperl perlmain.c mon.out \ - core so_locations pm_to_blib *~ */*~ */*/*~ *.o *.a perl.exe \ - Names.bs Names.bso Names.def Names.exp Makefile.old ) - rm -rf Libgtop.c ./blib Makefile.aperl perlmain.c mon.out core \ - so_locations pm_to_blib *~ */*~ */*/*~ *.o *.a perl.exe \ - Libgtop.bs Libgtop.bso Libgtop.def Libgtop.exp Makefile.old - -distclean-local: - (cd Names && rm -rf Makefile Makefile.PL Names.xs ) - rm -rf Makefile Makefile.PL Libgtop.xs - diff --git a/perl/ChangeLog b/perl/ChangeLog deleted file mode 100644 index cf07c681..00000000 --- a/perl/ChangeLog +++ /dev/null @@ -1,20 +0,0 @@ -1998-10-11 Martin Baulig - - * configure.in, automake.sh, Automakefile.am: New files. - This is now a package of its own. - -1998-10-10 Martin Baulig - - * Names: New directory. Defines `Libgtop::Names' module with - is the Perl interface of the LibGTop names library. - -1998-10-10 Martin Baulig - - * typemap: New file. - - * perl.awk: Make it work with the new format of `features.def'. - - * Makefile.PL.in: Added typemap. - - * Libgtop.pm (new): New function. - diff --git a/perl/Libgtop.pm b/perl/Libgtop.pm deleted file mode 100644 index 25055539..00000000 --- a/perl/Libgtop.pm +++ /dev/null @@ -1,31 +0,0 @@ -package Libgtop; - -use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); - -require Exporter; -require DynaLoader; -require AutoLoader; - -@ISA = qw(Exporter DynaLoader); -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -@EXPORT = qw[]; -$VERSION = '0.01'; - -bootstrap Libgtop $VERSION; - -# Preloaded methods go here. - -sub new { - my $proto = shift; - my $class = ref($proto) || $proto; - my $self = Libgtop::init ($class); - return $self; -} - -# Autoload methods go after __END__, and are processed by the autosplit program. - -1; -__END__ diff --git a/perl/MANIFEST b/perl/MANIFEST deleted file mode 100644 index 8af0f1eb..00000000 --- a/perl/MANIFEST +++ /dev/null @@ -1,31 +0,0 @@ -.cvsignore -AUTHORS -Automakefile.am -COPYING -ChangeLog -INSTALL -Libgtop.pm -Libgtop.xs -MANIFEST -MANIFEST.SKIP -Makefile.PL -Makefile.PL.in -NEWS -NO-AUTO-GEN -Names/.cvsignore -Names/MANIFEST -Names/Makefile.PL -Names/Makefile.PL.in -Names/Names.pm -Names/Names.xs -Names/names.awk -Names/test.pl -README -acconfig.h -autogen.sh -configure.in -features.def -new.pl -perl.awk -test.pl -typemap diff --git a/perl/MANIFEST.SKIP b/perl/MANIFEST.SKIP deleted file mode 100644 index ecd3e672..00000000 --- a/perl/MANIFEST.SKIP +++ /dev/null @@ -1,22 +0,0 @@ -\bblib\b -~$ -\.swp$ -\bstamp -^Libgtop- -^Automakefile$ -^Automakefile\.in$ -\bCVS\b -\.bs$ -\.o$ -\.bak$ -^config\.cache$ -^config\.status$ -^configure$ -^config\.log$ -^config\.h -\bMakefile\.old$ -^Libgtop\.c$ -\bMakefile$ -^aclocal\.m4$ -^Names/Names\.c$ -\bpm_to_blib\b diff --git a/perl/Makefile.PL.in b/perl/Makefile.PL.in deleted file mode 100644 index 87e0ff96..00000000 --- a/perl/Makefile.PL.in +++ /dev/null @@ -1,13 +0,0 @@ -# -*-cperl-*- -use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile('NAME' => 'Libgtop', - 'DIR' => ['Names'], - 'VERSION_FROM' => '@srcdir@/Libgtop.pm', - 'TYPEMAPS' => ['@srcdir@/typemap' ], - 'LIBS' => ['@LIBGTOP_GUILE_LIBS@ @LIBGTOP_EXTRA_LIBS@'], - 'DEFINE' => '', - 'INC' => '@LIBGTOP_GUILE_INCS@', - ); - diff --git a/perl/NEWS b/perl/NEWS deleted file mode 100644 index e69de29b..00000000 diff --git a/perl/NO-AUTO-GEN b/perl/NO-AUTO-GEN deleted file mode 100644 index e69de29b..00000000 diff --git a/perl/Names/.cvsignore b/perl/Names/.cvsignore deleted file mode 100644 index 77b6e8b1..00000000 --- a/perl/Names/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -Names.xs Makefile blib pm_to_blib Names.c Names.bs Makefile.PL diff --git a/perl/Names/MANIFEST b/perl/Names/MANIFEST deleted file mode 100644 index 8169db62..00000000 --- a/perl/Names/MANIFEST +++ /dev/null @@ -1,10 +0,0 @@ -MANIFEST -Makefile.PL.in -Names.pm -names.awk -test.pl -Names.pm -Names.xs -names.awk -test.pl -.cvsignore diff --git a/perl/Names/Makefile.PL.in b/perl/Names/Makefile.PL.in deleted file mode 100644 index 0b8132c9..00000000 --- a/perl/Names/Makefile.PL.in +++ /dev/null @@ -1,10 +0,0 @@ -# -*-cperl-*- -use ExtUtils::MakeMaker; -# See lib/ExtUtils/MakeMaker.pm for details of how to influence -# the contents of the Makefile that is written. -WriteMakefile('NAME' => 'Libgtop::Names', - 'VERSION_FROM' => '@srcdir@/Names.pm', - 'LIBS' => ['@LIBGTOP_NAMES_LIBS@ @LIBGTOP_EXTRA_LIBS@'], - 'DEFINE' => '', - 'INC' => '@LIBGTOP_NAMES_INCS@', - ); diff --git a/perl/Names/Names.pm b/perl/Names/Names.pm deleted file mode 100644 index 7bc15410..00000000 --- a/perl/Names/Names.pm +++ /dev/null @@ -1,24 +0,0 @@ -package Libgtop::Names; - -use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); - -require Exporter; -require DynaLoader; -require AutoLoader; - -@ISA = qw(Exporter AutoLoader DynaLoader); -# Items to export into callers namespace by default. Note: do not export -# names by default without a very good reason. Use EXPORT_OK instead. -# Do not simply export all your public functions/methods/constants. -@EXPORT_OK = qw[%names %labels %types %descriptions]; -$VERSION = '0.01'; - -bootstrap Libgtop::Names $VERSION; - -# Preloaded methods go here. - -# Autoload methods go after __END__, and are processed by the autosplit program. - -1; -__END__ diff --git a/perl/Names/names.awk b/perl/Names/names.awk deleted file mode 100644 index 5ca734f9..00000000 --- a/perl/Names/names.awk +++ /dev/null @@ -1,88 +0,0 @@ -BEGIN { - print "/* Names.xs */"; - print "/* This is a generated file. Please modify `names.awk' */"; - print ""; - - print "#ifdef __cplusplus"; - print "extern \"C\" {"; - print "#endif"; - print "#include \"EXTERN.h\""; - print "#include \"perl.h\""; - print "#include \"XSUB.h\""; - print "#ifdef __cplusplus"; - print "}"; - print "#endif"; - print ""; - print "#undef PACKAGE"; - print ""; - print "#include "; - print "#include "; - print "#include "; - print ""; - print "MODULE = Libgtop::Names\t\tPACKAGE = Libgtop::Names"; - print ""; - print "PROTOTYPES: ENABLE"; - print ""; -} - -function output(line) { - split (line, line_fields, /\|/); - retval = line_fields[1]; - feature = line_fields[2]; - element_def = line_fields[3]; - param_def = line_fields[4]; - - orig = feature; sub(/^@/,"",feature); - space = feature; gsub(/./," ",space); - - features[feature] = feature; -} - -/^[^#]/ { output($0) } - -END { - print "BOOT:"; - print "{"; - print "\tHV *names = perl_get_hv (\"Libgtop::Names::names\", TRUE);"; - print "\tHV *labels = perl_get_hv (\"Libgtop::Names::labels\", TRUE);"; - print "\tHV *types = perl_get_hv (\"Libgtop::Names::types\", TRUE);"; - print "\tHV *descriptions = perl_get_hv (\"Libgtop::Names::descriptions\", TRUE);"; - print "\tAV *array;"; - print "\tSV *ref;"; - print "\tint i;"; - - for (feature in features) { - print "\tarray = newAV ();"; - print "\tref = newRV_inc ((SV*)array);"; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; - print "\t{"; - print "\t\tav_push (array, newSVpv ((char*)glibtop_names_"feature" [i], 0));"; - print "\t}"; - print "\thv_store (names, \""feature"\", "length(feature)+1", ref, 0);"; - print "\tarray = newAV ();"; - print "\tref = newRV_inc ((SV*)array);"; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; - print "\t{"; - print "\t\tav_push (array, newSVpv ((char*)_(glibtop_labels_"feature" [i]), 0));"; - print "\t}"; - print "\thv_store (labels, \""feature"\", "length(feature)+1", ref, 0);"; - print "\tarray = newAV ();"; - print "\tref = newRV_inc ((SV*)array);"; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; - print "\t{"; - print "\t\tav_push (array, newSViv (glibtop_types_"feature" [i]));"; - print "\t}"; - print "\thv_store (types, \""feature"\", "length(feature)+1", ref, 0);"; - - print "\tarray = newAV ();"; - print "\tref = newRV_inc ((SV*)array);"; - print "\tfor (i = 0; i < GLIBTOP_MAX_"toupper(feature)"; i++)"; - print "\t{"; - print "\t\tav_push (array, newSVpv ((char*)_(glibtop_descriptions_"feature" [i]), 0));"; - print "\t}"; - print "\thv_store (descriptions, \""feature"\", "length(feature)+1", ref, 0);"; - } - - print "}"; - print ""; -} diff --git a/perl/Names/test.pl b/perl/Names/test.pl deleted file mode 100644 index 644643dd..00000000 --- a/perl/Names/test.pl +++ /dev/null @@ -1,20 +0,0 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' - -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) - -BEGIN { $| = 1; print "1..1\n"; } -END {print "not ok 1\n" unless $loaded;} -use Libgtop::Names; -$loaded = 1; -print "ok 1\n"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): - diff --git a/perl/README b/perl/README deleted file mode 100644 index f8cfc4f2..00000000 --- a/perl/README +++ /dev/null @@ -1,15 +0,0 @@ -This is the new (still experimental) Perl interface to LibGTop. - -How to build it: - -* first compile and install LibGTop - -* run the autogen.sh script in this directory - (it should also work with a separate builddir) - -* run a `make -f Automakefile' - -* run a `make install' - -Martin - diff --git a/perl/acconfig.h b/perl/acconfig.h deleted file mode 100644 index 1f9c1265..00000000 --- a/perl/acconfig.h +++ /dev/null @@ -1,33 +0,0 @@ -#undef HAVE_LC_MESSAGES -#undef HAVE_STPCPY -#undef PACKAGE -#undef VERSION -#undef ENABLE_NLS -#undef HAVE_LC_MESSAGES -#undef HAVE_CATGETS -#undef HAVE_GETTEXT -#undef HAVE_LIBSM -#undef HAVE_PROGRAM_INVOCATION_NAME -#undef HAVE_PROGRAM_INVOCATION_SHORT_NAME - -#undef HAVE_LIBGTOP -#undef NEED_LIBGTOP - -/* Define if LibGTop has support for multiple processors. */ -#undef HAVE_LIBGTOP_SMP - -/* Define if there is no `u_int64_t' and `int64_t'. */ -#undef u_int64_t -#undef int64_t - -/* LibGTop major, minor and micro version. */ -#undef LIBGTOP_MAJOR_VERSION -#undef LIBGTOP_MINOR_VERSION -#undef LIBGTOP_MICRO_VERSION - -/* LibGTop version and numerical version code ("1.234.567" -> 1234567). */ -#undef LIBGTOP_VERSION -#undef LIBGTOP_VERSION_CODE - -/* LibGTop server version, increased each time the protocol changes. */ -#undef LIBGTOP_SERVER_VERSION diff --git a/perl/autogen.sh b/perl/autogen.sh deleted file mode 100755 index a3a21ff4..00000000 --- a/perl/autogen.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -PKG_NAME="LibGTop Perl Interface" - -(test -f $srcdir/configure.in \ - && test -f $srcdir/Libgtop.pm ) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} - -DIE=0 - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have "\`autoconf\'" installed to compile Gnome." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have "\`automake\'" installed to compile Gnome." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - NO_AUTOMAKE=yes -} - -# if no automake, don't bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing "\`aclocal\'". The version of "\`automake\' - echo "installed doesn't appear recent enough." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "**Warning**: I am going to run "\`configure\'" with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo \`$0\'" command line." - echo -fi - -case $CC in -xlc ) - am_opt=--include-deps;; -esac - -for j in $srcdir -do - i=`dirname $j` - if test -f $i/REAL-NO-AUTO-GEN; then - echo skipping $i -- flagged as no auto-gen - else - macrodirs=$srcdir'/../macros' - echo processing $i - ## debug - test -n "$macrodirs" && echo \`aclocal\' will also look in \`$macrodirs\' - (cd $i; \ - aclocalinclude="$ACLOCAL_FLAGS"; \ - for k in $macrodirs; do \ - if test -d $k; then aclocalinclude="$aclocalinclude -I $k"; \ - else echo "**Warning**: No such directory \`$k'. Ignored."; fi; \ - done; \ - libtoolize --copy --force; \ - aclocal $aclocalinclude; \ - autoheader; automake --add-missing --gnu $am_opt Automakefile; \ - autoheader; autoconf) - fi -done - -if test x$NOCONFIGURE = x; then -conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c -echo running $srcdir/configure $conf_flags "$@" -$srcdir/configure $conf_flags "$@" \ -&& echo Now type \`make -f Automakefile\' to compile $PKG_NAME -else -echo Skipping configure process. -fi diff --git a/perl/configure.in b/perl/configure.in deleted file mode 100644 index 5b810804..00000000 --- a/perl/configure.in +++ /dev/null @@ -1,24 +0,0 @@ - -AC_INIT(Libgtop.pm) - -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(Libgtop, 0.29) - -AM_MAINTAINER_MODE - -dnl We don't use `AC_PROG_AWK' since it checks for mawk first which -dnl does not work for libgtop. -AC_CHECK_PROGS(AWK, gawk awk, ) -test -z "$AWK" && AC_MSG_ERROR([Sorry, you need a working awk interpreter.]) - -dnl Check for libgtop -GNOME_INIT_LIBGTOP(0.25, fail) - -dnl utility conditional -AM_CONDITIONAL(FALSE, test "x" = "y") - -AC_OUTPUT([ -Automakefile -Makefile.PL -Names/Makefile.PL -stamp.h],[]) diff --git a/perl/new.pl b/perl/new.pl deleted file mode 100755 index 734ec202..00000000 --- a/perl/new.pl +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/perl -w - -require 5.004; - -use blib; -use strict; -use Libgtop; - -my $server = Libgtop->new; - -print "CPU Usage: ".join (' ', $server->cpu)."\n"; -print "Memory Usage: ".join (' ', $server->mem)."\n"; -print "Swap Usage: ".join (' ', $server->swap)."\n"; - -print "Process List: ".join (' ', $server->proclist (0,0))."\n"; - diff --git a/perl/perl.awk b/perl/perl.awk deleted file mode 100644 index 18285d87..00000000 --- a/perl/perl.awk +++ /dev/null @@ -1,135 +0,0 @@ -BEGIN { - print "/* Libgtop.xs */"; - print "/* This is a generated file. Please modify `perl.awk' */"; - print ""; - - print "#ifdef __cplusplus"; - print "extern \"C\" {"; - print "#endif"; - print "#include \"EXTERN.h\""; - print "#include \"perl.h\""; - print "#include \"XSUB.h\""; - print "#ifdef __cplusplus"; - print "}"; - print "#endif"; - print ""; - print "#undef PACKAGE"; - print ""; - print "#include "; - print "#include "; - print "#include "; - print ""; - print "MODULE = Libgtop\t\tPACKAGE = Libgtop"; - print ""; - print "PROTOTYPES: ENABLE"; - print ""; - print "glibtop *"; - print "init (CLASS)"; - print "\tchar *CLASS;"; - print "CODE:"; - print "\tRETVAL = glibtop_calloc (1, sizeof (glibtop));"; - print "\tglibtop_init_s (&RETVAL, 0, 0);"; - print "OUTPUT:"; - print "\tRETVAL"; - print ""; - - type_convert["long"] = "int64_t"; - type_convert["ulong"] = "u_int64_t"; - type_convert["pid_t"] = "pid_t"; - type_convert["int"] = "int"; - - convert["long"] = "newSViv"; - convert["ulong"] = "newSViv"; - convert["double"] = "newSVnv"; -} - -function output(line) { - split (line, line_fields, /\|/); - retval = line_fields[1]; - feature = line_fields[2]; - element_def = line_fields[3]; - param_def = line_fields[4]; - - orig = feature; sub(/^@/,"",feature); - space = feature; gsub(/./," ",space); - - if (feature ~ /^proc_map/) - return; - else if (feature ~ /^mountlist/) - return; - else if (feature ~ /^fsusage/) - return; - - if (param_def == "string") { - call_param = line_fields[5]; - param_decl = "\tconst char *"line_fields[5]";\n"; - } else { - call_param = ""; - param_decl = ""; - nr_params = split (param_def, params, /:/); - for (param = 1; param <= nr_params; param++) { - list = params[param]; - type = params[param]; - sub(/\(.*/, "", type); - sub(/^.*\(/, "", list); sub(/\)$/, "", list); - count = split (list, fields, /,/); - for (field = 1; field <= count; field++) { - param_decl = param_decl"\t"; - call_param = call_param", "; - param_decl = param_decl""type_convert[type]" "fields[field]";\n"; - call_param = call_param""fields[field]; - } - } - } - - print "void"; - print feature" (server"call_param")"; - print "\tglibtop *server;"; - print param_decl"PREINIT:"; - print "\tglibtop_"feature" "feature";"; - - if (feature ~ /^proclist/) { - print "\tunsigned i, *ptr;"; - print "PPCODE:"; - print "\tptr = glibtop_get_proclist (&proclist, which, arg);"; - print ""; - print "\tif (ptr) {"; - print "\t\tfor (i = 0; i < proclist.number; i++)"; - print "\t\t\tXPUSHs (sv_2mortal (newSViv (ptr [i])));"; - print "\t}"; - print ""; - print "\tglibtop_free (ptr);"; - } else { - print "PPCODE:"; - if (call_param != "") - print "\tglibtop_get_"feature"_l (server, &"feature""call_param");"; - else - print "\tglibtop_get_"feature"_l (server, &"feature");"; - print ""; - - nr_elements = split (element_def, elements, /:/); - for (element = 1; element <= nr_elements; element++) { - list = elements[element]; - type = elements[element]; - sub(/\(.*/, "", type); - sub(/^.*\(/, "", list); sub(/\)$/, "", list); - count = split (list, fields, /,/); - for (field = 1; field <= count; field++) { - if (type ~ /^str$/) { - print "\tXPUSHs (sv_2mortal (newSVpv ("feature"."fields[field]", 0)));"; - } else { - if (type ~ /^char$/) { - print "\tXPUSHs (sv_2mortal (newSVpv (&"feature"."fields[field]", 1)));"; - } else { - print "\tXPUSHs (sv_2mortal ("convert[type]" ("feature"."fields[field]")));"; - } - } - } - } - } - - print ""; -} - -/^[^#]/ { output($0) } - diff --git a/perl/stamp-h.in b/perl/stamp-h.in deleted file mode 100644 index 9788f702..00000000 --- a/perl/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/perl/test.pl b/perl/test.pl deleted file mode 100644 index 1406ebc0..00000000 --- a/perl/test.pl +++ /dev/null @@ -1,20 +0,0 @@ -# Before `make install' is performed this script should be runnable with -# `make test'. After `make install' it should work as `perl test.pl' - -######################### We start with some black magic to print on failure. - -# Change 1..1 below to 1..last_test_to_print . -# (It may become useful if the test is moved to ./t subdirectory.) - -BEGIN { $| = 1; print "1..1\n"; } -END {print "not ok 1\n" unless $loaded;} -use Libgtop; -$loaded = 1; -print "ok 1\n"; - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): - diff --git a/perl/typemap b/perl/typemap deleted file mode 100644 index 4d2d2cc2..00000000 --- a/perl/typemap +++ /dev/null @@ -1,22 +0,0 @@ -TYPEMAP -int64_t T_IV -pid_t T_IV -const char * T_PV - -glibtop * O_OBJECT - -OUTPUT -# The Perl object is blessed into 'CLASS', which should be a -# char* having the name of the package for the blessing. -O_OBJECT - sv_setref_pv ($arg, CLASS, (void*)$var); - -INPUT -O_OBJECT - if (sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG)) - $var = ($type)SvIV((SV*)SvRV($arg)); - else { - warn (\"${Package}::$func_name() -- \" - \"$var is not a blessed SV reference\"); - XSRETURN_UNDEF; - }