Thread: [Compbench-devel] CompBenchmarks++/CBM-PI CBM.i, NONE, 1.1 CBM.pm, NONE, 1.1 CBM_wrap.cxx, NONE, 1.
Brought to you by:
xfred
From: Frederic T. <xf...@us...> - 2006-12-28 00:38:19
|
Update of /cvsroot/compbench/CompBenchmarks++/CBM-PI In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31033 Added Files: CBM.i CBM.pm CBM_wrap.cxx Glue.cpp Glue.h Makefile.am Log Message: First import. --- NEW FILE: CBM.pm --- # This file was created automatically by SWIG 1.3.28. # Don't modify this file, modify the SWIG interface instead. package CBM; require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); package CBMc; bootstrap CBM; package CBM; @EXPORT = qw( ); # ---------- BASE METHODS ------------- package CBM; sub TIEHASH { my ($classname,$obj) = @_; return bless $obj, $classname; } sub CLEAR { } sub FIRSTKEY { } sub NEXTKEY { } sub FETCH { my ($self,$field) = @_; my $member_func = "swig_${field}_get"; $self->$member_func(); } sub STORE { my ($self,$field,$newval) = @_; my $member_func = "swig_${field}_set"; $self->$member_func($newval); } sub this { my $ptr = shift; return tied(%$ptr); } # ------- FUNCTION WRAPPERS -------- package CBM; *Init = *CBMc::Init; *stringref = *CBMc::stringref; *c_str = *CBMc::c_str; ############# Class : CBM::CBMSystem ############## package CBM::CBMSystem; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM ); %OWNER = (); *Root = *CBMc::CBMSystem_Root; *HostDep = *CBMc::CBMSystem_HostDep; *Extract = *CBMc::CBMSystem_Extract; *Patches = *CBMc::CBMSystem_Patches; *System = *CBMc::CBMSystem_System; *Download = *CBMc::CBMSystem_Download; *Status = *CBMc::CBMSystem_Status; *Configuration = *CBMc::CBMSystem_Configuration; *init = *CBMc::CBMSystem_init; *Split = *CBMc::CBMSystem_Split; *Chomp = *CBMc::CBMSystem_Chomp; *display = *CBMc::CBMSystem_display; *displayPrograms = *CBMc::CBMSystem_displayPrograms; *exec = *CBMc::CBMSystem_exec; *md5 = *CBMc::CBMSystem_md5; *md5File = *CBMc::CBMSystem_md5File; *download = *CBMc::CBMSystem_download; *copy = *CBMc::CBMSystem_copy; *mkdir = *CBMc::CBMSystem_mkdir; *checkDirectory = *CBMc::CBMSystem_checkDirectory; *temporaryDirectory = *CBMc::CBMSystem_temporaryDirectory; *unlink = *CBMc::CBMSystem_unlink; *store = *CBMc::CBMSystem_store; *read = *CBMc::CBMSystem_read; *fileExists = *CBMc::CBMSystem_fileExists; *Time = *CBMc::CBMSystem_Time; *done = *CBMc::CBMSystem_done; *getLastCommand = *CBMc::CBMSystem_getLastCommand; *getLastCommandOutput = *CBMc::CBMSystem_getLastCommandOutput; sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMSystemUnix ############## package CBM::CBMSystemUnix; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM::CBMSystem CBM ); %OWNER = (); %ITERATORS = (); *copy = *CBMc::CBMSystemUnix_copy; *mkdir = *CBMc::CBMSystemUnix_mkdir; *checkDirectory = *CBMc::CBMSystemUnix_checkDirectory; *arch = *CBMc::CBMSystemUnix_arch; *hostid = *CBMc::CBMSystemUnix_hostid; *hostname = *CBMc::CBMSystemUnix_hostname; *os = *CBMc::CBMSystemUnix_os; *os_version = *CBMc::CBMSystemUnix_os_version; *unlink = *CBMc::CBMSystemUnix_unlink; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMSystemUnix($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMSystemLinux ############## package CBM::CBMSystemLinux; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM::CBMSystemUnix CBM ); %OWNER = (); %ITERATORS = (); sub new { my $pkg = shift; my $self = CBMc::new_CBMSystemLinux(@_); bless $self, $pkg if defined($self); } *processor_name = *CBMc::CBMSystemLinux_processor_name; *processor_mhz = *CBMc::CBMSystemLinux_processor_mhz; *processor_cache = *CBMc::CBMSystemLinux_processor_cache; *processor_number = *CBMc::CBMSystemLinux_processor_number; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMSystemLinux($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMBenchmark ############## package CBM::CBMBenchmark; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM ); %OWNER = (); %ITERATORS = (); *Unknown = *CBMc::CBMBenchmark_Unknown; *Downloaded = *CBMc::CBMBenchmark_Downloaded; *Extracted = *CBMc::CBMBenchmark_Extracted; *Patched = *CBMc::CBMBenchmark_Patched; *Preconfigured = *CBMc::CBMBenchmark_Preconfigured; *Configured = *CBMc::CBMBenchmark_Configured; *Made = *CBMc::CBMBenchmark_Made; *Tested = *CBMc::CBMBenchmark_Tested; *Benchmarked = *CBMc::CBMBenchmark_Benchmarked; *downloadURL = *CBMc::CBMBenchmark_downloadURL; *display = *CBMc::CBMBenchmark_display; *benchmarkSize = *CBMc::CBMBenchmark_benchmarkSize; *ContextMatches = *CBMc::CBMBenchmark_ContextMatches; *Download = *CBMc::CBMBenchmark_Download; *Extract = *CBMc::CBMBenchmark_Extract; *Patch = *CBMc::CBMBenchmark_Patch; *PreConfigure = *CBMc::CBMBenchmark_PreConfigure; *Configure = *CBMc::CBMBenchmark_Configure; *Make = *CBMc::CBMBenchmark_Make; *Test = *CBMc::CBMBenchmark_Test; *Bench = *CBMc::CBMBenchmark_Bench; *Release = *CBMc::CBMBenchmark_Release; *Install = *CBMc::CBMBenchmark_Install; *Fetch = *CBMc::CBMBenchmark_Fetch; *Uninstall = *CBMc::CBMBenchmark_Uninstall; *getStatus = *CBMc::CBMBenchmark_getStatus; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMBenchmark($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMBenchmarkSelector ############## package CBM::CBMBenchmarkSelector; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM ); %OWNER = (); %ITERATORS = (); sub new { my $pkg = shift; my $self = CBMc::new_CBMBenchmarkSelector(@_); bless $self, $pkg if defined($self); } *select = *CBMc::CBMBenchmarkSelector_select; *displayList = *CBMc::CBMBenchmarkSelector_displayList; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMBenchmarkSelector($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMCompiler ############## package CBM::CBMCompiler; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM ); %OWNER = (); %ITERATORS = (); *display = *CBMc::CBMCompiler_display; *compiler = *CBMc::CBMCompiler_compiler; *compilerName = *CBMc::CBMCompiler_compilerName; *compilerVersion = *CBMc::CBMCompiler_compilerVersion; *Binary = *CBMc::CBMCompiler_Binary; *language = *CBMc::CBMCompiler_language; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMCompiler($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } ############# Class : CBM::CBMCompilerSelector ############## package CBM::CBMCompilerSelector; use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); @ISA = qw( CBM ); %OWNER = (); %ITERATORS = (); sub new { my $pkg = shift; my $self = CBMc::new_CBMCompilerSelector(@_); bless $self, $pkg if defined($self); } *select = *CBMc::CBMCompilerSelector_select; sub DESTROY { return unless $_[0]->isa('HASH'); my $self = tied(%{$_[0]}); return unless defined $self; delete $ITERATORS{$self}; if (exists $OWNER{$self}) { CBMc::delete_CBMCompilerSelector($self); delete $OWNER{$self}; } } sub DISOWN { my $self = shift; my $ptr = tied(%$self); delete $OWNER{$ptr}; } sub ACQUIRE { my $self = shift; my $ptr = tied(%$self); $OWNER{$ptr} = 1; } # ------- VARIABLE STUBS -------- package CBM; *CBM_PROG_BZIP2 = *CBMc::CBM_PROG_BZIP2; *CBM_PROG_CAT = *CBMc::CBM_PROG_CAT; *CBM_PROG_CP = *CBMc::CBM_PROG_CP; *CBM_PROG_CUT = *CBMc::CBM_PROG_CUT; *CBM_PROG_DD = *CBMc::CBM_PROG_DD; *CBM_PROG_DIALOG = *CBMc::CBM_PROG_DIALOG; *CBM_PROG_GREP = *CBMc::CBM_PROG_GREP; *CBM_PROG_GZIP = *CBMc::CBM_PROG_GZIP; *CBM_PROG_HEAD = *CBMc::CBM_PROG_HEAD; *CBM_PROG_MAKE = *CBMc::CBM_PROG_MAKE; *CBM_PROG_MKDIR = *CBMc::CBM_PROG_MKDIR; *CBM_PROG_PATCH = *CBMc::CBM_PROG_PATCH; *CBM_PROG_PERL = *CBMc::CBM_PROG_PERL; *CBM_PROG_RM = *CBMc::CBM_PROG_RM; *CBM_PROG_TAIL = *CBMc::CBM_PROG_TAIL; *CBM_PROG_TAR = *CBMc::CBM_PROG_TAR; *CBM_PROG_UNZIP = *CBMc::CBM_PROG_UNZIP; *CBM_PROG_WGET = *CBMc::CBM_PROG_WGET; *CBM_PROG_ZCAT = *CBMc::CBM_PROG_ZCAT; *CBM_SYSTEM_CYGWIN = *CBMc::CBM_SYSTEM_CYGWIN; *CBM_SYSTEM_FREEBSD = *CBMc::CBM_SYSTEM_FREEBSD; *CBM_SYSTEM_LINUX = *CBMc::CBM_SYSTEM_LINUX; *HAVE_DLFCN_H = *CBMc::HAVE_DLFCN_H; *HAVE_GETOPT_H = *CBMc::HAVE_GETOPT_H; *HAVE_INTTYPES_H = *CBMc::HAVE_INTTYPES_H; *HAVE_LIBDL = *CBMc::HAVE_LIBDL; *HAVE_MEMORY_H = *CBMc::HAVE_MEMORY_H; *HAVE_STDINT_H = *CBMc::HAVE_STDINT_H; *HAVE_STDLIB_H = *CBMc::HAVE_STDLIB_H; *HAVE_STRINGS_H = *CBMc::HAVE_STRINGS_H; *HAVE_STRING_H = *CBMc::HAVE_STRING_H; *HAVE_SYS_STAT_H = *CBMc::HAVE_SYS_STAT_H; *HAVE_SYS_TYPES_H = *CBMc::HAVE_SYS_TYPES_H; *HAVE_TIME_H = *CBMc::HAVE_TIME_H; *HAVE_UNISTD_H = *CBMc::HAVE_UNISTD_H; *PACKAGE = *CBMc::PACKAGE; *PACKAGE_BUGREPORT = *CBMc::PACKAGE_BUGREPORT; *PACKAGE_NAME = *CBMc::PACKAGE_NAME; *PACKAGE_STRING = *CBMc::PACKAGE_STRING; *PACKAGE_TARNAME = *CBMc::PACKAGE_TARNAME; *PACKAGE_VERSION = *CBMc::PACKAGE_VERSION; *PREFIX = *CBMc::PREFIX; *STDC_HEADERS = *CBMc::STDC_HEADERS; *VERSION = *CBMc::VERSION; my %__cbmSystem_hash; tie %__cbmSystem_hash,"CBM::CBMSystem", $CBMc::cbmSystem; $cbmSystem= \%__cbmSystem_hash; bless $cbmSystem, CBM::CBMSystem; 1; --- NEW FILE: Glue.cpp --- /* ---------------------------------------------------------------------------- $Id: Glue.cpp,v 1.1 2006/12/28 00:38:14 xfred Exp $ Description : Missing declaration for CBM Perl module. This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #include <Glue.h> CBM_SYSTEM *sys; CBM_SYSTEM *Init(void) { sys = new CBM_SYSTEM; sys->init(); return(sys); } std::string & stringref(char *str) { std::string *dum = new std::string(str); return(*dum); } char *c_str(std::string &str) { return((char*) str.c_str()); } --- NEW FILE: CBM_wrap.cxx --- /* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 1.3.28 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPERL #define SWIG_CASTRANK_MODE #ifdef __cplusplus template<class T> class SwigValueWrapper { T *tt; public: SwigValueWrapper() : tt(0) { } SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { } [...5868 lines suppressed...] SvREADONLY_on(sv); } while(0) /*@SWIG@*/; /*@SWIG:%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "CBMBenchmark_Tested", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(CBMBenchmark::Tested))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; /*@SWIG:%set_constant@*/ do { SV *sv = get_sv((char*) SWIG_prefix "CBMBenchmark_Benchmarked", TRUE | 0x2); sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1(static_cast<int >(CBMBenchmark::Benchmarked))); SvREADONLY_on(sv); } while(0) /*@SWIG@*/; SWIG_TypeClientData(SWIGTYPE_p_CBMBenchmark, (void*) "CBM::CBMBenchmark"); SWIG_TypeClientData(SWIGTYPE_p_CBMBenchmarkSelector, (void*) "CBM::CBMBenchmarkSelector"); SWIG_TypeClientData(SWIGTYPE_p_CBMCompiler, (void*) "CBM::CBMCompiler"); SWIG_TypeClientData(SWIGTYPE_p_CBMCompilerSelector, (void*) "CBM::CBMCompilerSelector"); ST(0) = &PL_sv_yes; XSRETURN(1); } --- NEW FILE: CBM.i --- %include std_string.i %module CBM %{ #include "Glue.h" %} %module CBMSystem %{ #include "System/System.h" %} %module CBMSystemUnix %{ #include "System/System-Unix.h" %} %module CBMSystemLinux %{ #include "System/System-Linux.h" %} %module CBMBenchmark %{ #include "Benchmark/Benchmark.h" %} %module CBMBenchmarkSelector %{ #include "Benchmark/Benchmark-Selector.h" %} %module CBMCompiler %{ #include "Compiler/Compiler.h" %} %include "config.h" %include "System/System.h" %include "System/System-Unix.h" %include "System/System-Linux.h" %include "Benchmark/Benchmark.h" %include "Benchmark/Benchmark-Selector.h" %include "Compiler/Compiler.h" %include "Glue.h" --- NEW FILE: Makefile.am --- SUBDIRS = t INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/CBM-PI -I.. -I. # LDFLAGS = -L../testing/.libs -lcompbenchmarks PERL = @CBM_PROG_PERL@ data_DATA = $(top_srcdir)/CBM-PI/CBM.pm Glue.o: $(top_srcdir)/CBM-PI/Glue.cpp $(CXX) $(INCLUDES) -c $< -o $@ CBM.pm: CBM.i swig -c++ $(INCLUDES) -shadow -Wall -perl $< CBM.o: CBM.pm $(CXX) $(INCLUDES) -c $(top_srcdir)/CBM-PI/CBM_wrap.cxx `$(PERL) -MExtUtils::Embed -e ccopts` CBM.so: CBM.o Glue.o ld -G CBM_wrap.o Glue.o -o CBM.so -L ../.libs -lcompbenchmarks test: @CBM_PROG_MAKE@ -C t test all-local: CBM.so clean-local: rm -rf *.pm *.i~ *.cxx *.so *.o *.cpp~ *.h~ Makefile~ --- NEW FILE: Glue.h --- /* ---------------------------------------------------------------------------- $Id: Glue.h,v 1.1 2006/12/28 00:38:14 xfred Exp $ Description : Missing declaration for CBM Perl module. This is free software. For details, see the GNU Public License in the COPYING file, or Look http://www.fsf.org ------------------------------------------------------------------------- */ #ifndef H_CBM_PI_GLUE #define H_CBM_PI_GLUE #include <libcompbenchmarks.h> extern CBM_SYSTEM *Init(void); extern std::string & stringref(char *str); extern char *c_str(std::string &str); #endif |