line |
stmt |
bran |
cond |
sub |
time |
code |
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 |
12
|
|
|
|
|
|
|
13
|
|
|
|
|
|
/* Open a file for write */ |
14
|
2
|
|
|
|
|
FILE * xsfopen ( const char * path ) { |
15
|
|
|
|
|
|
FILE * stream; |
16
|
2
|
|
|
|
|
stream = fopen( path, "w"); |
17
|
2
|
|
|
|
|
return stream; |
18
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
20
|
2
|
|
|
|
|
int xsfclose ( FILE * stream ) { |
21
|
2
|
|
|
|
|
return fclose( stream ); |
22
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
int xsfprintf ( FILE * stream, const char * text ) { |
26
|
2
|
|
|
|
|
return fprintf( stream, "%s", text ); |
27
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|