/* T_ARRAY - allocate some memory */
intArray * intArrayPtr( int nelem ) {
intArray * array;
- New(0, array, nelem, intArray);
+ Newx(array, nelem, intArray);
return array;
}
=item T_HVREF
From the perl level this is a reference to a perl hash.
-From the C level this is a pointer to a HV.
+From the C level this is a pointer to an HV.
=cut
=item T_IV
A signed integer. This is cast to the required integer type when
-passed to C and converted to a IV when passed back to Perl.
+passed to C and converted to an IV when passed back to Perl.
=cut
intArray *
T_ARRAY( dummy, array, ... )
- int dummy = NO_INIT
+ int dummy = 0;
intArray * array
PREINIT:
U32 size_RETVAL;
RETVAL
SysRet
-T_STDIO_close( stream )
- FILE * stream
- CODE:
+T_STDIO_close( f )
+ PerlIO * f
+ PREINIT:
+ FILE * stream;
+ CODE:
+ /* Get the FILE* */
+ stream = PerlIO_findFILE( f );
+ /* Release the FILE* from the PerlIO system so that we do
+ not close the file twice */
+ PerlIO_releaseFILE(f,stream);
+ /* Must release the file before closing it */
RETVAL = xsfclose( stream );
OUTPUT:
RETVAL