Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/ext/XS/Typemap/stdio.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.



/* This provides a test of STDIO and emulates a library that
   has been built outside of the PerlIO system and therefore is
   built using FILE* rather than PerlIO * (a common occurrence
   for XS).

   Use a separate file to make sure we are not contaminated by
   PerlIO.
*/

#include <stdio.h>

/* Open a file for write */
FILE * xsfopen ( const char * path ) {
  FILE * stream;
  stream = fopen( path, "w");
  return stream;
}

int xsfclose ( FILE * stream ) {
  return fclose( stream );
}


int xsfprintf ( FILE * stream, const char * text ) {
  return fprintf( stream, text );
}


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.