in reply to Linking Open Perl Filehandles to Stream Based C code via XS
Obviously you'd want to do stuff like error handling and arg counts and stuff, but that's basically how xsubpp handles XSUB definitions like the following in .xs files:XS(XS_widget) { dXSARGS; FILE* in = PerlIO_findFILE(IoIFP(sv_2io(ST(0)))); FILE* out = PerlIO_findFILE(IoIFP(sv_2io(ST(1)))); /* copy in to out */ }
c.char* read(fd,count) FILE* fd int count CODE: ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Linking Open Perl Filehandles to Stream Based C code via XS
by tachyon (Chancellor) on Nov 06, 2004 at 22:31 UTC |