Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

XSUB callback
Hi @ all perl folk here,

On a OpenVMS system with Perl 5.8.6, there are some routines in a sharable
image (well, perhaps here better known as 'libxxx.so', isn't it? ;-), I have
to made available from Perl which. I think this can be done by writing a
wrapper using the well-known XS stuff (h2xs, xsubpp & others).

However, one of these routines, when called, performs some action and then
calls back a user-supplied routine, passing this routine the address of a
structure which contains many data the routine can examine and - in some
cases - change in addition. The structure also provides the addresses of
further routines which the callback may invoke to perform additional
operations. The structure exists for the live time of the callback routine
only and its contents is processed further once the callback has terminated.

Hm. In Perl terms, I think, the callback is a perl function and the
"structure" can be expresses as a reference blessed into a package which
provides the corresponding attributes and methods. I havn't however, found,
any ways to implement a callback mechanism with XS. So my question: does
someone know here how to accomplish this. I would very appreciate some code
examples.

Many thanks for any help and kind greetings from Vienna,

Ferry

--
Ing. Ferry Bolhar
Municipality of Vienna, Department 14
A-1010 Vienna / AUSTRIA
E-mail: bol@adv.magwien.gv.at



Report this thread to moderator Post Follow-up to this message
Old Post
Ferry Bolhar
01-27-06 11:59 PM


Re: XSUB callback
"Ferry Bolhar" <bol@adv.magwien.gv.at> wrote in message
news:1138379440.692748@proxy.dienste.wien.at...
> Hi @ all perl folk here,
>
> On a OpenVMS system with Perl 5.8.6, there are some routines in a sharable
> image (well, perhaps here better known as 'libxxx.so', isn't it? ;-), I
have
> to made available from Perl which. I think this can be done by writing a
> wrapper using the well-known XS stuff (h2xs, xsubpp & others).

One of the "others" is Inline::C. Check it out (including the Cookbook that
comes with it).
For the more traditional XS approach start with 'perldoc perlxstut'.

>
> However, one of these routines, when called, performs some action and then
> calls back a user-supplied routine, passing this routine the address of a
> structure which contains many data the routine can examine and - in some
> cases - change in addition. The structure also provides the addresses of
> further routines which the callback may invoke to perform additional
> operations. The structure exists for the live time of the callback routine
> only and its contents is processed further once the callback has
terminated.
>
> Hm. In Perl terms, I think, the callback is a perl function and the
> "structure" can be expresses as a reference blessed into a package which
> provides the corresponding attributes and methods. I havn't however,
found,
> any ways to implement a callback mechanism with XS. So my question: does
> someone know here how to accomplish this. I would very appreciate some
code
> examples.
>

Can't quite follow the description .... but try 'perldoc perlcall' (which
contains some excellent examples) and see if that has anything to offer you.

Cheers,
Rob



Report this thread to moderator Post Follow-up to this message
Old Post
Sisyphus
01-27-06 11:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Miscellaneous archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:31 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.