First step to cleaning up stdio. This breaks the libc ABI, all programs
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 23 Jul 2005 20:23:06 +0000 (20:23 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Sat, 23 Jul 2005 20:23:06 +0000 (20:23 +0000)
commit55b5af8438bae897e96d192972b15905aa65edb6
treee7560fabdf446721423d8a359aac9fbf23920fee
parent2209b3e5189098877d0b57e38386b5be71a29a83
First step to cleaning up stdio. This breaks the libc ABI, all programs
have to be recompiled.

Make FILE an opaque type for normal operation (anything outside libc).
This means programs have to use the exported interface, they can neither
make static instances on the heap or access fields of their own.

Introduce a new type __FILE_public, which contains the fields accessed
by the various macros. It is placed first in the real FILE and the
macros cast the given FILE * to __FILE_public for access. To allow
better argument checks, all macros have been converted to inline
functions instead.

Merge the various stdio helper headers into a single priv_stdio.h. The
license from the original files has been kept, the third clause is gone
as part of the UCB copyright addendum. They haven't been changed in
FreeBSD at all.

Add two new helper functions, fcookie and __fpending to read parts of
the hidden state. The former is handy for funopen users, the latter
exists on other systems as well.

Cleanup some minor warnings on the way and hide some local functions
with static.

Adept libftpio and CVS to the chanced API.
52 files changed:
gnu/usr.bin/cvs/lib/Makefile
gnu/usr.bin/cvs/lib/config.h.proto
include/stdio.h
lib/libc/stdio/Makefile.inc
lib/libc/stdio/__fpending.c [new file with mode: 0644]
lib/libc/stdio/_flock_stub.c
lib/libc/stdio/asprintf.c
lib/libc/stdio/fclose.c
lib/libc/stdio/fcookie.c [new file with mode: 0644]
lib/libc/stdio/fdopen.c
lib/libc/stdio/fflush.c
lib/libc/stdio/fgetc.c
lib/libc/stdio/fgetln.c
lib/libc/stdio/fgets.c
lib/libc/stdio/fileno.c
lib/libc/stdio/findfp.c
lib/libc/stdio/fopen.c
lib/libc/stdio/fpurge.c
lib/libc/stdio/fputs.c
lib/libc/stdio/fread.c
lib/libc/stdio/freopen.c
lib/libc/stdio/fseek.c
lib/libc/stdio/ftell.c
lib/libc/stdio/funopen.c
lib/libc/stdio/fvwrite.c
lib/libc/stdio/fvwrite.h [deleted file]
lib/libc/stdio/fwalk.c
lib/libc/stdio/fwrite.c
lib/libc/stdio/glue.h [deleted file]
lib/libc/stdio/local.h
lib/libc/stdio/makebuf.c
lib/libc/stdio/perror.c
lib/libc/stdio/priv_stdio.h [new file with mode: 0644]
lib/libc/stdio/puts.c
lib/libc/stdio/putw.c
lib/libc/stdio/refill.c
lib/libc/stdio/rget.c
lib/libc/stdio/setvbuf.c
lib/libc/stdio/snprintf.c
lib/libc/stdio/sprintf.c
lib/libc/stdio/sscanf.c
lib/libc/stdio/stdio.c
lib/libc/stdio/ungetc.c
lib/libc/stdio/vasprintf.c
lib/libc/stdio/vfprintf.c
lib/libc/stdio/vfscanf.c
lib/libc/stdio/vsnprintf.c
lib/libc/stdio/vsprintf.c
lib/libc/stdio/vsscanf.c
lib/libc/stdio/wbuf.c
lib/libc/stdio/wsetup.c
lib/libftpio/ftpio.c