This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
APItest.xs: Silence compiler warnings
[perl5.git] / ext / XS-Typemap / stdio.c
1
2 /* This provides a test of STDIO and emulates a library that
3    has been built outside of the PerlIO system and therefore is
4    built using FILE* rather than PerlIO * (a common occurrence
5    for XS).
6
7    Use a separate file to make sure we are not contaminated by
8    PerlIO.
9 */
10
11 #include <stdio.h>
12
13 /* Open a file for write */
14 FILE * xsfopen ( const char * path ) {
15   FILE * stream;
16   stream = fopen( path, "w");
17   return stream;
18 }
19
20 int xsfclose ( FILE * stream ) {
21   return fclose( stream );
22 }
23
24
25 int xsfprintf ( FILE * stream, const char * text ) {
26   return fprintf( stream, "%s", text );
27 }
28