diff options
| author | 2023-01-28 17:49:02 +0100 | |
|---|---|---|
| committer | 2023-01-28 17:49:02 +0100 | |
| commit | 876bebd9ac904ca930117237edaf8c3dcae7a922 (patch) | |
| tree | 7e91e26c49e18fd80c7de93ff275ffce83fb14df /xs_io.h | |
| parent | Bumped version. (diff) | |
| download | snac2-876bebd9ac904ca930117237edaf8c3dcae7a922.tar.gz snac2-876bebd9ac904ca930117237edaf8c3dcae7a922.tar.xz snac2-876bebd9ac904ca930117237edaf8c3dcae7a922.zip | |
Backport from xs.
Diffstat (limited to 'xs_io.h')
| -rw-r--r-- | xs_io.h | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -4,17 +4,17 @@ | |||
| 4 | 4 | ||
| 5 | #define _XS_IO_H | 5 | #define _XS_IO_H |
| 6 | 6 | ||
| 7 | d_char *xs_readline(FILE *f); | 7 | xs_str *xs_readline(FILE *f); |
| 8 | d_char *xs_read(FILE *f, int *size); | 8 | xs_val *xs_read(FILE *f, int *size); |
| 9 | d_char *xs_readall(FILE *f); | 9 | xs_val *xs_readall(FILE *f); |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | #ifdef XS_IMPLEMENTATION | 12 | #ifdef XS_IMPLEMENTATION |
| 13 | 13 | ||
| 14 | d_char *xs_readline(FILE *f) | 14 | xs_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 | ||
| 41 | d_char *xs_read(FILE *f, int *sz) | 41 | xs_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 | ||
| 79 | d_char *xs_readall(FILE *f) | 79 | xs_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; |