diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh index 16d1cb68..82756a5f 100644 --- a/build-aux/configure-lib.sh +++ b/build-aux/configure-lib.sh @@ -338,6 +338,7 @@ lib/stdio/fileno.c lib/stdio/freopen.c lib/stdio/fscanf.c lib/stdio/perror.c +lib/stdio/rewind.c lib/stdio/vfscanf.c lib/stdlib/__exit.c lib/stdlib/abort.c @@ -384,7 +385,6 @@ lib/stub/pclose.c lib/stub/popen.c lib/stub/pow.c lib/stub/rand.c -lib/stub/rewind.c lib/stub/setbuf.c lib/stub/setgrent.c lib/stub/setlocale.c diff --git a/include/stdio.h b/include/stdio.h index c68576e0..82a9e4df 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -76,6 +76,7 @@ int putc (int c, FILE * stream); int putchar (int c); int puts (char const *s); int remove (char const *file_name); +void rewind (FILE * stream); int setvbuf (FILE * stream, char *buf, int mode, size_t size); int ungetc (int c, FILE * stream); long ftell (FILE * stream); diff --git a/lib/stub/rewind.c b/lib/stdio/rewind.c similarity index 75% rename from lib/stub/rewind.c rename to lib/stdio/rewind.c index db4000fd..4b00e007 100644 --- a/lib/stub/rewind.c +++ b/lib/stdio/rewind.c @@ -1,6 +1,6 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software - * Copyright © 2018 Jan (janneke) Nieuwenhuizen + * Copyright © 2018,2019 Jan (janneke) Nieuwenhuizen * * This file is part of GNU Mes. * @@ -18,16 +18,10 @@ * along with GNU Mes. If not, see . */ -#include -#include +#include -int -rewind (int x) +void +rewind (FILE * stream) { - static int stub = 0; - if (__mes_debug () && !stub) - eputs ("rewind stub\n"); - stub = 1; - errno = 0; - return 0; + fseek (stream, 0, SEEK_SET); }