From: hadaq Date: Wed, 1 Feb 2012 11:00:28 +0000 (+0000) Subject: added X-Git-Tag: v6.0~78 X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=2275b58be1f363fb621fef7df575979d5347a030;p=trbnettools.git added --- diff --git a/libtrbnet_perl/Changes b/libtrbnet_perl/Changes new file mode 100644 index 0000000..10b68b9 --- /dev/null +++ b/libtrbnet_perl/Changes @@ -0,0 +1,6 @@ +Revision history for Perl extension HADES::TrbNet. + +0.01 Sun Jan 8 04:53:28 2012 + - original version; created by h2xs 1.23 with options + -n HADES::TrbNet -A -O -x trberror.h trbnet.h trbrpc_perl.h + diff --git a/libtrbnet_perl/MANIFEST b/libtrbnet_perl/MANIFEST new file mode 100644 index 0000000..125177b --- /dev/null +++ b/libtrbnet_perl/MANIFEST @@ -0,0 +1,7 @@ +Changes +MANIFEST +Makefile.PL +README +TrbNet.xs +lib/HADES/TrbNet.pm +test/test.pl diff --git a/libtrbnet_perl/Makefile.PL b/libtrbnet_perl/Makefile.PL new file mode 100644 index 0000000..8cc79ca --- /dev/null +++ b/libtrbnet_perl/Makefile.PL @@ -0,0 +1,17 @@ +# file : Makefile.PL +# See lib/ExtUtils/MakeMaker.pm for details of how to influence +# the contents of the Makefile that is written. + +use ExtUtils::MakeMaker; +WriteMakefile( + NAME => 'HADES::TrbNet', + VERSION_FROM => 'lib/HADES/TrbNet.pm', + PREREQ_PM => {}, # e.g., Module::Name => 1.1 + ($] >= 5.005 ? ## Add these new keywords supported since 5.005 + (ABSTRACT_FROM => 'lib/HADES/TrbNet.pm', # retrieve abstract from module + AUTHOR => 'Hades DAQ ') : ()), + INC => '-I../libtrbnet', + DEFINE => '', + LIBS => '-L../trbnetd -ltrbnet', + OBJECT => '$(O_FILES)' +); diff --git a/libtrbnet_perl/README b/libtrbnet_perl/README new file mode 100644 index 0000000..8ffa658 --- /dev/null +++ b/libtrbnet_perl/README @@ -0,0 +1,40 @@ +HADES-TrbNet version 0.01 +========================= + +The README is used to introduce the module and provide instructions on +how to install the module, any machine dependencies it may have (for +example C compilers and installed libraries) and any other information +that should be provided before the module is installed. + +A README file is required for CPAN modules since CPAN extracts the +README file from a module distribution so that people browsing the +archive can use it get an idea of the modules uses. It is usually a +good idea to provide version information here so that people can +decide whether fixes for the module are worth downloading. + +INSTALLATION + +To install this module type the following: + + perl Makefile.PL + make + make test + make install + +DEPENDENCIES + +This module requires these other modules and libraries: + + blah blah blah + +COPYRIGHT AND LICENCE + +Put the correct copyright and licence information here. + +Copyright (C) 2012 by Hades DAQ + +This library is free software; you can redistribute it and/or modify +it under the same terms as Perl itself, either Perl version 5.10.0 or, +at your option, any later version of Perl 5 you may have available. + + diff --git a/libtrbnet_perl/TrbNet.xs b/libtrbnet_perl/TrbNet.xs new file mode 100644 index 0000000..4cb88b5 --- /dev/null +++ b/libtrbnet_perl/TrbNet.xs @@ -0,0 +1,33 @@ +#include +#include +#include +#include + +#include + +/* file : TrbNet.xs */ + +MODULE = HADES::TrbNet PACKAGE = HADES::TrbNet +PROTOTYPES: ENABLE + +int +init_ports() + +void +trb_uid(trb_address) + U16 trb_address + INIT: + static U32 buf2[1024 * 4]; + int status; + int i; + + PPCODE: + i = 0; + status = trb_read_uid(trb_address, (U32 *)&buf2, 1024 * 4); + if (status <= 0) { + XSRETURN_UNDEF; + return; + } + for (i = 0 ; i < status; i++) { + XPUSHs(sv_2mortal(newSVnv(buf2[i]))); + }