Tuxedo is a Perl extension module for Tuxedo.
This module provides the following functionality...
'C' style interface
The Tuxedo perl module gives you access to almost all of the tuxedo 8.1 apis from perl. In most cases you can take the C API you already familiar with, apply perl semantics to it, and write working tuxedo programs in perl.
Object wrapping of C structures
Many tuxedo functions take pointers to C structures as function parameters. To preserve the C interface, this module provides perl objects that encapsulate the C structures used by tuxedo. These objects allow the user to create and manipulate the elements of these C structures, and these objects are then passed as parameters to the perl version of these tuxedo C functions.
buffer management
Perl classes exist for each buffer type to allow for easy manipulation of buffer contents and automatic memory cleanup when no more references to the buffer exist.
callback subs
perl subs can be registered as unsolicited message handlers and signal handlers.
FML/FML32 field table support
This module includes the mkfldpm32.pl script that is the perl equivalent of the tuxedo mkfldhdr32 program. It accepts a field table file as input and produces a *.pm file that can be included in a perl script, so field identifiers can be referenced by id.
perl tuxedo services
You can now write tuxedo services in perl. When you build the Tuxedo module, it should create a tuxedo server called PERLSVR. This is a tuxedo server that contains an embedded perl interpretor for executing perl tuxedo services. When PERLSVR boots up, it parses the perlsvr.pl script, which at the moment it expects to find in its working directory. The location of perlsvr.pl will be configurable in a future version. The perlsvr.pl script is run as the tpsvrinit routine. You can modify perlsvr.pl to define any subs you want to be tuxedo services and advertise these subs.
There are a few rules for writing subs that are to be run as tuxedo services.
1) They must accept a single input parameter which is a reference to a TPSVCINFO_PTR object.
2) They must return 5 parameters corresponding to the parameters of the tpreturn tuxedo function. You don't call tpreturn directly from a perl sub tuxedo service. When the sub returns, the PERLSVR will extract the return values from the perl stack and call tpreturn for you.
Below is the perlsvr.pl that is included with this distribution. It demonstrates how to write and advertise two simple perl subs that act as tuxedo services.
use Tuxedo;
sub TOUPPER {
my ($tpsvcinfo) = @_;
my ($inbuf) = $tpsvcinfo->data;
$inbuf->value( ($newval = uc($inbuf->value)) );
return ( TPSUCCESS, 0, $inbuf, $tpsvcinfo->len, 0 );
}
sub REVERSE {
my ($tpsvcinfo) = @_;
my ($buf) = $tpsvcinfo->data;
$buf->value( ($newval = reverse($buf->value)) );
return ( TPSUCCESS, 0, $buf, $tpsvcinfo->len, 0 );
}
tpadvertise( "TOUPPER", &TOUPPER );
tpadvertise( "REVERSE", &REVERSE );
Future versions of this module will include
workstation and native modules
Different modules will exist for native and workstation tuxedo development. Currently native is the default.
An object oriented tuxedo interface
Version 1 of the Tuxedo module only presented an object oriented interface to the user. This version of the Tuxedo module presents the original C interface to make perl tuxedo development easier for experienced tuxedo programmers. The object oriented interface will co-exist with the C interface in a future version of this module.
Product's homepage
Requirements:
· Perl