diff options
| -rw-r--r-- | libpsx/include/stdio.h | 1 | ||||
| -rw-r--r-- | libpsx/src/libc.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libpsx/include/stdio.h b/libpsx/include/stdio.h index 89d8817..34d2d57 100644 --- a/libpsx/include/stdio.h +++ b/libpsx/include/stdio.h @@ -123,6 +123,7 @@ size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream); int fgetc(FILE *f); int ftell(FILE *f); int fseek(FILE *f, int offset, int whence); +void rewind(FILE *f); int fputs(const char *str, FILE *stream); void clearerr(FILE *stream); diff --git a/libpsx/src/libc.c b/libpsx/src/libc.c index 3baccf4..58884b0 100644 --- a/libpsx/src/libc.c +++ b/libpsx/src/libc.c @@ -420,6 +420,12 @@ int fseek(FILE *f, int offset, int whence) return 0; } +void rewind(FILE *f) +{ + fseek(f, 0, SEEK_SET); + clearerr(f); +} + int toupper(int c) { if(c >= 'a' && c <= 'z') |
