summaryrefslogtreecommitdiff
path: root/xs_io.h
diff options
context:
space:
mode:
authorGravatar default2023-01-28 17:49:02 +0100
committerGravatar default2023-01-28 17:49:02 +0100
commit876bebd9ac904ca930117237edaf8c3dcae7a922 (patch)
tree7e91e26c49e18fd80c7de93ff275ffce83fb14df /xs_io.h
parentBumped version. (diff)
downloadsnac2-876bebd9ac904ca930117237edaf8c3dcae7a922.tar.gz
snac2-876bebd9ac904ca930117237edaf8c3dcae7a922.tar.xz
snac2-876bebd9ac904ca930117237edaf8c3dcae7a922.zip
Backport from xs.
Diffstat (limited to 'xs_io.h')
-rw-r--r--xs_io.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/xs_io.h b/xs_io.h
index cb6ba85..f32e814 100644
--- a/xs_io.h
+++ b/xs_io.h
@@ -4,17 +4,17 @@
4 4
5#define _XS_IO_H 5#define _XS_IO_H
6 6
7d_char *xs_readline(FILE *f); 7xs_str *xs_readline(FILE *f);
8d_char *xs_read(FILE *f, int *size); 8xs_val *xs_read(FILE *f, int *size);
9d_char *xs_readall(FILE *f); 9xs_val *xs_readall(FILE *f);
10 10
11 11
12#ifdef XS_IMPLEMENTATION 12#ifdef XS_IMPLEMENTATION
13 13
14d_char *xs_readline(FILE *f) 14xs_str *xs_readline(FILE *f)
15/* reads a line from a file */ 15/* reads a line from a file */
16{ 16{
17 d_char *s = NULL; 17 xs_str *s = NULL;
18 18
19 errno = 0; 19 errno = 0;
20 20
@@ -38,10 +38,10 @@ d_char *xs_readline(FILE *f)
38} 38}
39 39
40 40
41d_char *xs_read(FILE *f, int *sz) 41xs_val *xs_read(FILE *f, int *sz)
42/* reads up to size bytes from f */ 42/* reads up to size bytes from f */
43{ 43{
44 d_char *s = NULL; 44 xs_val *s = NULL;
45 int size = *sz; 45 int size = *sz;
46 int rdsz = 0; 46 int rdsz = 0;
47 47
@@ -76,7 +76,7 @@ d_char *xs_read(FILE *f, int *sz)
76} 76}
77 77
78 78
79d_char *xs_readall(FILE *f) 79xs_val *xs_readall(FILE *f)
80/* reads the rest of the file into a string */ 80/* reads the rest of the file into a string */
81{ 81{
82 int size = XS_ALL; 82 int size = XS_ALL;