Removed everything in this subdirectory. This was only experimental. The

1998-10-11  Martin Baulig  <martin@home-of-linux.org>

	* perl: Removed everything in this subdirectory. This was
	only experimental. The real perl bindings for LibGTop are
	in the libgtop-bindings module.
This commit is contained in:
Martin Baulig
1998-10-11 09:59:16 +00:00
committed by Martin Baulig
parent 669f7a6b17
commit 70bbae9b75
27 changed files with 6 additions and 668 deletions

View File

@@ -1,3 +1,9 @@
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* 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 <martin@home-of-linux.org>
* src/inodedb/Makefile.am: Removed @libs_xauth@ and -lgdbm

View File

@@ -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

View File

@@ -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

View File

View File

@@ -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

View File

@@ -1,20 +0,0 @@
1998-10-11 Martin Baulig <martin@home-of-linux.org>
* configure.in, automake.sh, Automakefile.am: New files.
This is now a package of its own.
1998-10-10 Martin Baulig <martin@home-of-linux.org>
* Names: New directory. Defines `Libgtop::Names' module with
is the Perl interface of the LibGTop names library.
1998-10-10 Martin Baulig <martin@home-of-linux.org>
* 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.

View File

@@ -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__

View File

@@ -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

View File

@@ -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

View File

@@ -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@',
);

View File

View File

View File

@@ -1 +0,0 @@
Names.xs Makefile blib pm_to_blib Names.c Names.bs Makefile.PL

View File

@@ -1,10 +0,0 @@
MANIFEST
Makefile.PL.in
Names.pm
names.awk
test.pl
Names.pm
Names.xs
names.awk
test.pl
.cvsignore

View File

@@ -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@',
);

View File

@@ -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__

View File

@@ -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 <glibtop.h>";
print "#include <glibtop/union.h>";
print "#include <glibtop/xmalloc.h>";
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 "";
}

View File

@@ -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):

View File

@@ -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 <martin@home-of-linux.org>

View File

@@ -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

View File

@@ -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

View File

@@ -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],[])

View File

@@ -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";

View File

@@ -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 <glibtop.h>";
print "#include <glibtop/union.h>";
print "#include <glibtop/xmalloc.h>";
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) }

View File

@@ -1 +0,0 @@
timestamp

View File

@@ -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):

View File

@@ -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;
}