Hi,

I have a simple C structure like this

    typedef struct CDROM {
        int                 fd;
        char                *device;    
        int                 caps;       
        struct cdrom_tochdr *toch;   
        int                 num_frames;
    } CDROM;

and need to duplicate 'fd' and turn it into a Perl filehandle that gets
returned as reference from an XSUB.

I was experimenting with something like

    PerlIO *io;
    char mode[8];
    PerlIO_intmode2str(O_RDONLY|O_NONBLOCK, mode, NULL);
    io = PerlIO_fdopen(self->fd, mode);

but I can't even figure out whether this works because I don't know how
to turn a PerlIO* thingy into an SV. Actually, I don't know what to do
with this PerlIO stuff at all. According to perlapio.pod, this is the
thing to work with when doing I/O from XS. But there is not a single
indication anywhere how to turn an SV into a PerlIO and vice versa.

Can someone help?
Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to