* libc/include/wchar.h (fwscanf, swscanf, vfwscanf, vswscanf, vwscanf,

wscanf): Declare.
	(_fwscanf_r, _swscanf_r, _vfwscanf_r, _vswscanf_r, _vwscanf_r,
	_wscanf_r): Declare.
	* libc/stdio/Makefile.am: Add new wscanf files.
	* libc/stdio/Makefile.in: Regenerate.
	* libc/stdio/fwscanf.c: New file.
	* libc/stdio/local.h (__svfwscanf_r, __ssvfwscanf_r, __svfiwscanf_r,
	__ssvfiwscanf_r): Declare.
	* libc/stdio/stdio.tex: Add new documentation references.
	* libc/stdio/swscanf.c: New file.
	* libc/stdio/vfwscanf.c: New file.
	* libc/stdio/vswscanf.c: New file.
	* libc/stdio/vwscanf.c: New file.
	* libc/stdio/wscanf.c: New file.

	* libc/stdio/vfscanf.c (_sungetc_r): Make externaly available.  Only
	define if INTEGER_ONLY is defined.  Declare otherwise.
	(__ssrefill_r): Ditto.
	(_sfread_r): Ditto.

	Remove static eofread/eofread1 functions and use __seofread
	function instead, throughout.
	* libc/stdio/local.h (__seofread): Declare.
	* libc/stdio/stdio.c (__seofread): Define.

	* libc/stdio/fgetwc.c (__fgetwc): Fix compiler warning.
	* libc/stdio/fgetws.c (_fgetws_r): Ditto.
	* libc/stdio/fread.c (_fread_r): Ditto.
	* libc/stdio/vfprintf.c: Ditto.
	* libc/stdio/vswprintf.c: Ditto.
This commit is contained in:
Corinna Vinschen 2009-03-11 11:53:22 +00:00
parent e20efdda16
commit d0b85c158f
23 changed files with 2341 additions and 101 deletions

View File

@ -1,3 +1,37 @@
2009-03-06 Corinna Vinschen <corinna@vinschen.de>
* libc/include/wchar.h (fwscanf, swscanf, vfwscanf, vswscanf, vwscanf,
wscanf): Declare.
(_fwscanf_r, _swscanf_r, _vfwscanf_r, _vswscanf_r, _vwscanf_r,
_wscanf_r): Declare.
* libc/stdio/Makefile.am: Add new wscanf files.
* libc/stdio/Makefile.in: Regenerate.
* libc/stdio/fwscanf.c: New file.
* libc/stdio/local.h (__svfwscanf_r, __ssvfwscanf_r, __svfiwscanf_r,
__ssvfiwscanf_r): Declare.
* libc/stdio/stdio.tex: Add new documentation references.
* libc/stdio/swscanf.c: New file.
* libc/stdio/vfwscanf.c: New file.
* libc/stdio/vswscanf.c: New file.
* libc/stdio/vwscanf.c: New file.
* libc/stdio/wscanf.c: New file.
* libc/stdio/vfscanf.c (_sungetc_r): Make externaly available. Only
define if INTEGER_ONLY is defined. Declare otherwise.
(__ssrefill_r): Ditto.
(_sfread_r): Ditto.
Remove static eofread/eofread1 functions and use __seofread
function instead, throughout.
* libc/stdio/local.h (__seofread): Declare.
* libc/stdio/stdio.c (__seofread): Define.
* libc/stdio/fgetwc.c (__fgetwc): Fix compiler warning.
* libc/stdio/fgetws.c (_fgetws_r): Ditto.
* libc/stdio/fread.c (_fread_r): Ditto.
* libc/stdio/vfprintf.c: Ditto.
* libc/stdio/vswprintf.c: Ditto.
2009-03-09 Brooks Moses <brooks@codesourcery.com>
* libc/machine/arm/arm_asm.h: Fix typo.
@ -29,7 +63,7 @@
* libc/include/stdio.h (__VALIST): Guard against multiple definition.
* libc/include/wchar.h: Include stdarg.h.
(__VALIST): Define conditionally.
(fwprintf, swprintf, vfwprintf, vswprintf, vwprintf, wprintf: Declare.
(fwprintf, swprintf, vfwprintf, vswprintf, vwprintf, wprintf): Declare.
(_fwprintf_r, _swprintf_r, _vfwprintf_r, _vswprintf_r, _vwprintf_r,
_wprintf_r): Declare.
* libc/stdio/Makefile.am: Add new files.

View File

@ -155,6 +155,20 @@ int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, _
int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST));
int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...));
int _EXFUN(fwscanf, (__FILE *, const wchar_t *, ...));
int _EXFUN(swscanf, (const wchar_t *, const wchar_t *, ...));
int _EXFUN(vfwscanf, (__FILE *, const wchar_t *, __VALIST));
int _EXFUN(vswscanf, (const wchar_t *, const wchar_t *, __VALIST));
int _EXFUN(vwscanf, (const wchar_t *, __VALIST));
int _EXFUN(wscanf, (const wchar_t *, ...));
int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...));
int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...));
int _EXFUN(_vfwscanf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST));
int _EXFUN(_vswscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, __VALIST));
int _EXFUN(_vwscanf_r, (struct _reent *, const wchar_t *, __VALIST));
int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...));
#define getwc(fp) fgetwc(fp)
#define putwc(wc,fp) fputwc((wc), (fp))
#ifndef _REENT_ONLY

View File

@ -126,18 +126,24 @@ ELIX_4_SOURCES = \
funopen.c \
fwide.c \
fwprintf.c \
fwscanf.c \
getwc.c \
getwchar.c \
open_memstream.c \
putwc.c \
putwchar.c \
swprintf.c \
swscanf.c \
ungetwc.c \
vasniprintf.c \
vasnprintf.c \
vfwscanf.c \
vswprintf.c \
vswscanf.c \
vwprintf.c \
wprintf.c
vwscanf.c \
wprintf.c \
wscanf.c
endif !ELIX_LEVEL_3
endif !ELIX_LEVEL_2
@ -149,7 +155,9 @@ LIBADD_OBJS = \
$(lpfx)vfiprintf.$(oext) $(lpfx)vfprintf.$(oext) \
$(lpfx)vfscanf.$(oext) $(lpfx)vfiscanf.$(oext) \
$(lpfx)svfiwprintf.$(oext) $(lpfx)svfwprintf.$(oext) \
$(lpfx)vfiwprintf.$(oext) $(lpfx)vfwprintf.$(oext)
$(lpfx)vfiwprintf.$(oext) $(lpfx)vfwprintf.$(oext) \
$(lpfx)svfiwscanf.$(oext) $(lpfx)svfwscanf.$(oext) \
$(lpfx)vfiwscanf.$(oext) $(lpfx)vfwscanf.$(oext)
libstdio_la_LDFLAGS = -Xcompiler -nostdlib
@ -211,6 +219,18 @@ $(lpfx)svfscanf.$(oext): vfscanf.c
$(lpfx)svfiscanf.$(oext): vfscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
$(lpfx)vfwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)vfiwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)svfwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)svfiwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
CHEWOUT_FILES = \
clearerr.def \
diprintf.def \
@ -275,6 +295,7 @@ CHEWOUT_FILES = \
sprintf.def \
sscanf.def \
swprintf.def \
swscanf.def \
tmpfile.def \
tmpnam.def \
ungetc.def \
@ -282,6 +303,7 @@ CHEWOUT_FILES = \
vfprintf.def \
vfscanf.def \
vfwprintf.def \
vfwscanf.def \
viprintf.def \
viscanf.def
@ -322,6 +344,7 @@ $(lpfx)fwalk.$(oext): local.h
$(lpfx)fwide.$(oext): local.h
$(lpfx)fwprintf.$(oext): local.h
$(lpfx)fwrite.$(oext): local.h fvwrite.h
$(lpfx)fwscanf.$(oext): local.h
$(lpfx)getwc.$(oext): local.h
$(lpfx)getwchar.$(oext): local.h
$(lpfx)iscanf.$(oext): local.h
@ -345,6 +368,7 @@ $(lpfx)svfiscanf.$(oext): local.h floatio.h
$(lpfx)svfprintf.$(oext): local.h
$(lpfx)svfscanf.$(oext): local.h floatio.h
$(lpfx)swprintf.$(oext): local.h
$(lpfx)swscanf.$(oext): local.h
$(lpfx)ungetc.$(oext): local.h
$(lpfx)ungetwc.$(oext): local.h
$(lpfx)vfiprintf.$(oext): local.h
@ -352,13 +376,17 @@ $(lpfx)vfiscanf.$(oext): local.h floatio.h
$(lpfx)vfprintf.$(oext): local.h
$(lpfx)vfscanf.$(oext): local.h floatio.h
$(lpfx)vfwprintf.$(oext): local.h
$(lpfx)vfwscanf.$(oext): local.h
$(lpfx)viscanf.$(oext): local.h
$(lpfx)vscanf.$(oext): local.h
$(lpfx)vsiscanf.$(oext): local.h
$(lpfx)vsniprintf.$(oext): local.h
$(lpfx)vsscanf.$(oext): local.h
$(lpfx)vswprintf.$(oext): local.h
$(lpfx)vswscanf.$(oext): local.h
$(lpfx)vwprintf.$(oext): local.h
$(lpfx)vwscanf.$(oext): local.h
$(lpfx)wbuf.$(oext): local.h fvwrite.h
$(lpfx)wprintf.$(oext): local.h
$(lpfx)wscanf.$(oext): local.h
$(lpfx)wsetup.$(oext): local.h

View File

@ -38,6 +38,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
LIBOBJDIR =
DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am
subdir = stdio
@ -62,7 +63,9 @@ am__DEPENDENCIES_1 = $(lpfx)svfiprintf.$(oext) \
$(lpfx)vfprintf.$(oext) $(lpfx)vfscanf.$(oext) \
$(lpfx)vfiscanf.$(oext) $(lpfx)svfiwprintf.$(oext) \
$(lpfx)svfwprintf.$(oext) $(lpfx)vfiwprintf.$(oext) \
$(lpfx)vfwprintf.$(oext)
$(lpfx)vfwprintf.$(oext) $(lpfx)svfiwscanf.$(oext) \
$(lpfx)svfwscanf.$(oext) $(lpfx)vfiwscanf.$(oext) \
$(lpfx)vfwscanf.$(oext)
am__objects_1 = lib_a-clearerr.$(OBJEXT) lib_a-fclose.$(OBJEXT) \
lib_a-fdopen.$(OBJEXT) lib_a-feof.$(OBJEXT) \
lib_a-ferror.$(OBJEXT) lib_a-fflush.$(OBJEXT) \
@ -126,18 +129,24 @@ am__objects_1 = lib_a-clearerr.$(OBJEXT) lib_a-fclose.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-funopen.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-fwide.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-fwprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-fwscanf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-getwc.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-getwchar.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-open_memstream.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-putwc.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-putwchar.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-swprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-swscanf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-ungetwc.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vasniprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vasnprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vfwscanf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vswprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vswscanf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vwprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wprintf.$(OBJEXT)
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-vwscanf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wprintf.$(OBJEXT) \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ lib_a-wscanf.$(OBJEXT)
@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
@USE_LIBTOOL_FALSE@ $(am__objects_2) $(am__objects_3)
lib_a_OBJECTS = $(am_lib_a_OBJECTS)
@ -173,19 +182,25 @@ am__objects_4 = clearerr.lo fclose.lo fdopen.lo feof.lo ferror.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fputws.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ funopen.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwide.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwscanf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ getwc.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ getwchar.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ open_memstream.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ putwc.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ putwchar.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ swprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ swprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ swscanf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ ungetwc.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vasniprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vasnprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vswprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vwprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wprintf.c
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vfwscanf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vswprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vswscanf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vwprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vwscanf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wprintf.lo \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wscanf.lo
@USE_LIBTOOL_TRUE@am_libstdio_la_OBJECTS = $(am__objects_4) \
@USE_LIBTOOL_TRUE@ $(am__objects_5) $(am__objects_6)
libstdio_la_OBJECTS = $(am_libstdio_la_OBJECTS)
@ -314,20 +329,8 @@ STRIP = @STRIP@
USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
VERSION = @VERSION@
ac_ct_AR = @ac_ct_AR@
ac_ct_AS = @ac_ct_AS@
ac_ct_CC = @ac_ct_CC@
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
ac_ct_LIPO = @ac_ct_LIPO@
ac_ct_NMEDIT = @ac_ct_NMEDIT@
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
ac_ct_OTOOL = @ac_ct_OTOOL@
ac_ct_OTOOL64 = @ac_ct_OTOOL64@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_READELF = @ac_ct_READELF@
ac_ct_STRIP = @ac_ct_STRIP@
aext = @aext@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@ -343,6 +346,9 @@ build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
extra_dir = @extra_dir@
host = @host@
@ -350,12 +356,14 @@ host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libm_machine_dir = @libm_machine_dir@
localedir = @localedir@
localstatedir = @localstatedir@
lpfx = @lpfx@
lt_ECHO = @lt_ECHO@
@ -365,8 +373,10 @@ mkdir_p = @mkdir_p@
newlib_basedir = @newlib_basedir@
oext = @oext@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
subdirs = @subdirs@
@ -483,18 +493,24 @@ GENERAL_SOURCES = \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ funopen.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwide.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ fwscanf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ getwc.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ getwchar.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ open_memstream.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ putwc.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ putwchar.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ swprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ swscanf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ ungetwc.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vasniprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vasnprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vfwscanf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vswprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vswscanf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vwprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wprintf.c
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ vwscanf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wprintf.c \
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ wscanf.c
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_4_SOURCES =
@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_4_SOURCES =
@ -505,7 +521,9 @@ LIBADD_OBJS = \
$(lpfx)vfiprintf.$(oext) $(lpfx)vfprintf.$(oext) \
$(lpfx)vfscanf.$(oext) $(lpfx)vfiscanf.$(oext) \
$(lpfx)svfiwprintf.$(oext) $(lpfx)svfwprintf.$(oext) \
$(lpfx)vfiwprintf.$(oext) $(lpfx)vfwprintf.$(oext)
$(lpfx)vfiwprintf.$(oext) $(lpfx)vfwprintf.$(oext) \
$(lpfx)svfiwscanf.$(oext) $(lpfx)svfwscanf.$(oext) \
$(lpfx)vfiwscanf.$(oext) $(lpfx)vfwscanf.$(oext)
libstdio_la_LDFLAGS = -Xcompiler -nostdlib
@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libstdio.la
@ -585,6 +603,7 @@ CHEWOUT_FILES = \
sprintf.def \
sscanf.def \
swprintf.def \
swscanf.def \
tmpfile.def \
tmpnam.def \
ungetc.def \
@ -592,6 +611,7 @@ CHEWOUT_FILES = \
vfprintf.def \
vfscanf.def \
vfwprintf.def \
vfwscanf.def \
viprintf.def \
viscanf.def
@ -1272,6 +1292,18 @@ lib_a-fwide.o: fwide.c
lib_a-fwide.obj: fwide.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwide.obj `if test -f 'fwide.c'; then $(CYGPATH_W) 'fwide.c'; else $(CYGPATH_W) '$(srcdir)/fwide.c'; fi`
lib_a-fwprintf.o: fwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwprintf.o `test -f 'fwprintf.c' || echo '$(srcdir)/'`fwprintf.c
lib_a-fwprintf.obj: fwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwprintf.obj `if test -f 'fwprintf.c'; then $(CYGPATH_W) 'fwprintf.c'; else $(CYGPATH_W) '$(srcdir)/fwprintf.c'; fi`
lib_a-fwscanf.o: fwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwscanf.o `test -f 'fwscanf.c' || echo '$(srcdir)/'`fwscanf.c
lib_a-fwscanf.obj: fwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwscanf.obj `if test -f 'fwscanf.c'; then $(CYGPATH_W) 'fwscanf.c'; else $(CYGPATH_W) '$(srcdir)/fwscanf.c'; fi`
lib_a-getwc.o: getwc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getwc.o `test -f 'getwc.c' || echo '$(srcdir)/'`getwc.c
@ -1302,6 +1334,18 @@ lib_a-putwchar.o: putwchar.c
lib_a-putwchar.obj: putwchar.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-putwchar.obj `if test -f 'putwchar.c'; then $(CYGPATH_W) 'putwchar.c'; else $(CYGPATH_W) '$(srcdir)/putwchar.c'; fi`
lib_a-swprintf.o: swprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swprintf.o `test -f 'swprintf.c' || echo '$(srcdir)/'`swprintf.c
lib_a-swprintf.obj: swprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swprintf.obj `if test -f 'swprintf.c'; then $(CYGPATH_W) 'swprintf.c'; else $(CYGPATH_W) '$(srcdir)/swprintf.c'; fi`
lib_a-swscanf.o: swscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swscanf.o `test -f 'swscanf.c' || echo '$(srcdir)/'`swscanf.c
lib_a-swscanf.obj: swscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swscanf.obj `if test -f 'swscanf.c'; then $(CYGPATH_W) 'swscanf.c'; else $(CYGPATH_W) '$(srcdir)/swscanf.c'; fi`
lib_a-ungetwc.o: ungetwc.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ungetwc.o `test -f 'ungetwc.c' || echo '$(srcdir)/'`ungetwc.c
@ -1320,17 +1364,11 @@ lib_a-vasnprintf.o: vasnprintf.c
lib_a-vasnprintf.obj: vasnprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vasnprintf.obj `if test -f 'vasnprintf.c'; then $(CYGPATH_W) 'vasnprintf.c'; else $(CYGPATH_W) '$(srcdir)/vasnprintf.c'; fi`
lib_a-vwprintf.o: vwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwprintf.o `test -f 'vwprintf.c' || echo '$(srcdir)/'`vwprintf.c
lib_a-vfwscanf.o: vfwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfwscanf.o `test -f 'vfwscanf.c' || echo '$(srcdir)/'`vfwscanf.c
lib_a-vwprintf.obj: vwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwprintf.obj `if test -f 'vwprintf.c'; then $(CYGPATH_W) 'vwprintf.c'; else $(CYGPATH_W) '$(srcdir)/vwprintf.c'; fi`
lib_a-swprintf.o: swprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swprintf.o `test -f 'swprintf.c' || echo '$(srcdir)/'`swprintf.c
lib_a-swprintf.obj: swprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-swprintf.obj `if test -f 'swprintf.c'; then $(CYGPATH_W) 'swprintf.c'; else $(CYGPATH_W) '$(srcdir)/swprintf.c'; fi`
lib_a-vfwscanf.obj: vfwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vfwscanf.obj `if test -f 'vfwscanf.c'; then $(CYGPATH_W) 'vfwscanf.c'; else $(CYGPATH_W) '$(srcdir)/vfwscanf.c'; fi`
lib_a-vswprintf.o: vswprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vswprintf.o `test -f 'vswprintf.c' || echo '$(srcdir)/'`vswprintf.c
@ -1338,17 +1376,35 @@ lib_a-vswprintf.o: vswprintf.c
lib_a-vswprintf.obj: vswprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vswprintf.obj `if test -f 'vswprintf.c'; then $(CYGPATH_W) 'vswprintf.c'; else $(CYGPATH_W) '$(srcdir)/vswprintf.c'; fi`
lib_a-vswscanf.o: vswscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vswscanf.o `test -f 'vswscanf.c' || echo '$(srcdir)/'`vswscanf.c
lib_a-vswscanf.obj: vswscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vswscanf.obj `if test -f 'vswscanf.c'; then $(CYGPATH_W) 'vswscanf.c'; else $(CYGPATH_W) '$(srcdir)/vswscanf.c'; fi`
lib_a-vwprintf.o: vwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwprintf.o `test -f 'vwprintf.c' || echo '$(srcdir)/'`vwprintf.c
lib_a-vwprintf.obj: vwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwprintf.obj `if test -f 'vwprintf.c'; then $(CYGPATH_W) 'vwprintf.c'; else $(CYGPATH_W) '$(srcdir)/vwprintf.c'; fi`
lib_a-vwscanf.o: vwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwscanf.o `test -f 'vwscanf.c' || echo '$(srcdir)/'`vwscanf.c
lib_a-vwscanf.obj: vwscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-vwscanf.obj `if test -f 'vwscanf.c'; then $(CYGPATH_W) 'vwscanf.c'; else $(CYGPATH_W) '$(srcdir)/vwscanf.c'; fi`
lib_a-wprintf.o: wprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wprintf.o `test -f 'wprintf.c' || echo '$(srcdir)/'`wprintf.c
lib_a-wprintf.obj: wprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wprintf.obj `if test -f 'wprintf.c'; then $(CYGPATH_W) 'wprintf.c'; else $(CYGPATH_W) '$(srcdir)/wprintf.c'; fi`
lib_a-fwprintf.o: fwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwprintf.o `test -f 'fwprintf.c' || echo '$(srcdir)/'`fwprintf.c
lib_a-wscanf.o: wscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wscanf.o `test -f 'wscanf.c' || echo '$(srcdir)/'`wscanf.c
lib_a-fwprintf.obj: fwprintf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-fwprintf.obj `if test -f 'fwprintf.c'; then $(CYGPATH_W) 'fwprintf.c'; else $(CYGPATH_W) '$(srcdir)/fwprintf.c'; fi`
lib_a-wscanf.obj: wscanf.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-wscanf.obj `if test -f 'wscanf.c'; then $(CYGPATH_W) 'wscanf.c'; else $(CYGPATH_W) '$(srcdir)/wscanf.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@ -1357,7 +1413,7 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
-rm -f libtool config.lt
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
@ -1543,6 +1599,18 @@ $(lpfx)svfscanf.$(oext): vfscanf.c
$(lpfx)svfiscanf.$(oext): vfscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfscanf.c -o $@
$(lpfx)vfwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)vfiwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)svfwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
$(lpfx)svfiwscanf.$(oext): vfwscanf.c
$(LIB_COMPILE) -DINTEGER_ONLY -DSTRING_ONLY -c $(srcdir)/vfwscanf.c -o $@
.c.def:
$(CHEW) < $< > $*.def 2> $*.ref
touch stmp-def
@ -1572,6 +1640,7 @@ $(lpfx)fwalk.$(oext): local.h
$(lpfx)fwide.$(oext): local.h
$(lpfx)fwprintf.$(oext): local.h
$(lpfx)fwrite.$(oext): local.h fvwrite.h
$(lpfx)fwscanf.$(oext): local.h
$(lpfx)getwc.$(oext): local.h
$(lpfx)getwchar.$(oext): local.h
$(lpfx)iscanf.$(oext): local.h
@ -1595,6 +1664,7 @@ $(lpfx)svfiscanf.$(oext): local.h floatio.h
$(lpfx)svfprintf.$(oext): local.h
$(lpfx)svfscanf.$(oext): local.h floatio.h
$(lpfx)swprintf.$(oext): local.h
$(lpfx)swscanf.$(oext): local.h
$(lpfx)ungetc.$(oext): local.h
$(lpfx)ungetwc.$(oext): local.h
$(lpfx)vfiprintf.$(oext): local.h
@ -1602,15 +1672,19 @@ $(lpfx)vfiscanf.$(oext): local.h floatio.h
$(lpfx)vfprintf.$(oext): local.h
$(lpfx)vfscanf.$(oext): local.h floatio.h
$(lpfx)vfwprintf.$(oext): local.h
$(lpfx)vfwscanf.$(oext): local.h
$(lpfx)viscanf.$(oext): local.h
$(lpfx)vscanf.$(oext): local.h
$(lpfx)vsiscanf.$(oext): local.h
$(lpfx)vsniprintf.$(oext): local.h
$(lpfx)vsscanf.$(oext): local.h
$(lpfx)vswprintf.$(oext): local.h
$(lpfx)vswscanf.$(oext): local.h
$(lpfx)vwprintf.$(oext): local.h
$(lpfx)vwscanf.$(oext): local.h
$(lpfx)wbuf.$(oext): local.h fvwrite.h
$(lpfx)wprintf.$(oext): local.h
$(lpfx)wscanf.$(oext): local.h
$(lpfx)wsetup.$(oext): local.h
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -129,7 +129,7 @@ _DEFUN(__fgetwc, (ptr, fp),
}
do
{
nconv = _mbrtowc_r (ptr, &wc, fp->_p, fp->_r, &fp->_mbstate);
nconv = _mbrtowc_r (ptr, &wc, (char *) fp->_p, fp->_r, &fp->_mbstate);
if (nconv == (size_t)-1)
break;
else if (nconv == (size_t)-2)

View File

@ -108,7 +108,7 @@ _DEFUN(_fgetws_r, (ptr, ws, n, fp),
wsp = ws;
do
{
src = fp->_p;
src = (char *) fp->_p;
nl = memchr (fp->_p, '\n', fp->_r);
nconv = _mbsrtowcs_r (ptr, wsp, &src,
nl != NULL ? (nl - fp->_p + 1) : fp->_r,

View File

@ -179,9 +179,9 @@ _DEFUN(_fread_r, (ptr, buf, size, count, fp),
void * old_p = fp->_p;
int old_size = fp->_bf._size;
/* allow __refill to use user's buffer */
fp->_bf._base = p;
fp->_bf._base = (unsigned char *) p;
fp->_bf._size = resid;
fp->_p = p;
fp->_p = (unsigned char *) p;
rc = __srefill_r (ptr, fp);
/* restore fp buffering back to original state */
fp->_bf._base = old_base;

View File

@ -0,0 +1,52 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h>
#include <reent.h>
#include <stdio.h>
#include <wchar.h>
#include <stdarg.h>
#include "local.h"
#ifndef _REENT_ONLY
int
fwscanf (FILE *fp, _CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
va_start (ap, fmt);
ret = __svfwscanf_r (_REENT, fp, fmt, ap);
va_end (ap);
return ret;
}
#endif /* !_REENT_ONLY */
int
_fwscanf_r (struct _reent *ptr, FILE *fp, _CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
va_start (ap, fmt);
ret = __svfwscanf_r (ptr, fp, fmt, ap);
va_end (ap);
return (ret);
}

View File

@ -38,6 +38,10 @@ extern int _EXFUN(__svfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list
extern int _EXFUN(__ssvfscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__svfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__ssvfiscanf_r,(struct _reent *,FILE *, _CONST char *,va_list));
extern int _EXFUN(__svfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
extern int _EXFUN(__ssvfwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
extern int _EXFUN(__svfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
extern int _EXFUN(__ssvfiwscanf_r,(struct _reent *,FILE *, _CONST wchar_t *,va_list));
int _EXFUN(_svfprintf_r,(struct _reent *, FILE *, const char *,
va_list)
_ATTRIBUTE ((__format__ (__printf__, 3, 0))));
@ -53,6 +57,8 @@ extern int _EXFUN(__sflags,(struct _reent *,_CONST char*, int*));
extern int _EXFUN(__srefill_r,(struct _reent *,FILE *));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__sread,(struct _reent *, void *, char *,
int));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__seofread,(struct _reent *, void *,
char *, int));
extern _READ_WRITE_RETURN_TYPE _EXFUN(__swrite,(struct _reent *, void *,
const char *, int));
extern _fpos_t _EXFUN(__sseek,(struct _reent *, void *, _fpos_t, int));

View File

@ -113,18 +113,6 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#endif
#include "local.h"
/* | ARGSUSED */
/*SUPPRESS 590*/
static _READ_WRITE_RETURN_TYPE
_DEFUN(eofread, (ptr, cookie, buf, len),
struct _reent *ptr _AND
_PTR cookie _AND
char *buf _AND
int len)
{
return 0;
}
#ifndef _REENT_ONLY
#ifdef _HAVE_STDC
@ -147,7 +135,7 @@ siscanf(str, fmt, va_alist)
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */
@ -185,7 +173,7 @@ _siscanf_r(ptr, str, fmt, va_alist)
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */

View File

@ -394,18 +394,6 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
#endif
#include "local.h"
/* | ARGSUSED */
/*SUPPRESS 590*/
static _READ_WRITE_RETURN_TYPE
_DEFUN(eofread, (ptr, cookie, buf, len),
struct _reent *ptr _AND
_PTR cookie _AND
char *buf _AND
int len)
{
return 0;
}
#ifndef _REENT_ONLY
#ifdef _HAVE_STDC
@ -428,7 +416,7 @@ sscanf(str, fmt, va_alist)
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */
@ -466,7 +454,7 @@ _sscanf_r(ptr, str, fmt, va_alist)
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */

View File

@ -61,6 +61,17 @@ _DEFUN(__sread, (ptr, cookie, buf, n),
return ret;
}
/* Dummy function used in sscanf/swscanf. */
_READ_WRITE_RETURN_TYPE
_DEFUN(__seofread, (ptr, cookie, buf, len),
struct _reent *_ptr _AND
_PTR cookie _AND
char *buf _AND
int len)
{
return 0;
}
_READ_WRITE_RETURN_TYPE
_DEFUN(__swrite, (ptr, cookie, buf, n),
struct _reent *ptr _AND

View File

@ -85,6 +85,7 @@ structure.
* sprintf:: Write formatted output
* sscanf:: Scan and format input
* swprintf:: Write formatted wide character output
* swscanf:: Scan and format wide character input
* tmpfile:: Create a temporary file
* tmpnam:: Generate name for a temporary file
* ungetc:: Push data back into a stream
@ -92,6 +93,7 @@ structure.
* vfprintf:: Format variable argument list
* vfscanf:: Scan variable argument list
* vfwprintf:: Format variable wide character argument list
* vfwscanf:: Scan and format argument list from wide character input
* viprintf:: Format variable argument list (integer only)
* viscanf:: Scan variable format list (integer only)
@end menu
@ -279,6 +281,9 @@ structure.
@page
@include stdio/swprintf.def
@page
@include stdio/swscanf.def
@page
@include stdio/tmpfile.def
@ -300,6 +305,9 @@ structure.
@page
@include stdio/vfwprintf.def
@page
@include stdio/vfwscanf.def
@page
@include stdio/viprintf.def

417
newlib/libc/stdio/swscanf.c Normal file
View File

@ -0,0 +1,417 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/*
FUNCTION
<<swscanf>>, <<fwscanf>>, <<wscanf>>---scan and format wide character input
INDEX
wscanf
INDEX
_wscanf_r
INDEX
fwscanf
INDEX
_fwscanf_r
INDEX
swscanf
INDEX
_swscanf_r
ANSI_SYNOPSIS
#include <stdio.h>
int wscanf(const wchar_t *<[format]>, ...);
int fwscanf(FILE *<[fd]>, const wchar_t *<[format]>, ...);
int swscanf(const wchar_t *<[str]>, const wchar_t *<[format]>, ...);
int _wscanf_r(struct _reent *<[ptr]>, const wchar_t *<[format]>, ...);
int _fwscanf_r(struct _reent *<[ptr]>, FILE *<[fd]>,
const wchar_t *<[format]>, ...);
int _swscanf_r(struct _reent *<[ptr]>, const wchar_t *<[str]>,
const wchar_t *<[format]>, ...);
TRAD_SYNOPSIS
#include <stdio.h>
int wscanf(<[format]> [, <[arg]>, ...])
wchar_t *<[format]>;
int fwscanf(<[fd]>, <[format]> [, <[arg]>, ...]);
FILE *<[fd]>;
wchar_t *<[format]>;
int swscanf(<[str]>, <[format]> [, <[arg]>, ...]);
wchar_t *<[str]>;
wchar_t *<[format]>;
int _wscanf_r(<[ptr]>, <[format]> [, <[arg]>, ...])
struct _reent *<[ptr]>;
wchar_t *<[format]>;
int _fwscanf_r(<[ptr]>, <[fd]>, <[format]> [, <[arg]>, ...]);
struct _reent *<[ptr]>;
FILE *<[fd]>;
wchar_t *<[format]>;
int _swscanf_r(<[ptr]>, <[str]>, <[format]> [, <[arg]>, ...]);
struct _reent *<[ptr]>;
wchar_t *<[str]>;
wchar_t *<[format]>;
DESCRIPTION
<<wscanf>> scans a series of input fields from standard input,
one wide character at a time. Each field is interpreted according to
a format specifier passed to <<wscanf>> in the format string at
<<*<[format]>>>. <<wscanf>> stores the interpreted input from
each field at the address passed to it as the corresponding argument
following <[format]>. You must supply the same number of
format specifiers and address arguments as there are input fields.
There must be sufficient address arguments for the given format
specifiers; if not the results are unpredictable and likely
disasterous. Excess address arguments are merely ignored.
<<wscanf>> often produces unexpected results if the input diverges from
an expected pattern. Since the combination of <<gets>> or <<fgets>>
followed by <<swscanf>> is safe and easy, that is the preferred way
to be certain that a program is synchronized with input at the end
of a line.
<<fwscanf>> and <<swscanf>> are identical to <<wscanf>>, other than the
source of input: <<fwscanf>> reads from a file, and <<swscanf>>
from a string.
The routines <<_wscanf_r>>, <<_fwscanf_r>>, and <<_swscanf_r>> are reentrant
versions of <<wscanf>>, <<fwscanf>>, and <<swscanf>> that take an additional
first argument pointing to a reentrancy structure.
The string at <<*<[format]>>> is a wide character sequence composed
of zero or more directives. Directives are composed of
one or more whitespace characters, non-whitespace characters,
and format specifications.
Whitespace characters are blank (<< >>), tab (<<\t>>), or
newline (<<\n>>).
When <<wscanf>> encounters a whitespace character in the format string
it will read (but not store) all consecutive whitespace characters
up to the next non-whitespace character in the input.
Non-whitespace characters are all other ASCII characters except the
percent sign (<<%>>). When <<wscanf>> encounters a non-whitespace
character in the format string it will read, but not store
a matching non-whitespace character.
Format specifications tell <<wscanf>> to read and convert characters
from the input field into specific types of values, and store then
in the locations specified by the address arguments.
Trailing whitespace is left unread unless explicitly
matched in the format string.
The format specifiers must begin with a percent sign (<<%>>)
and have the following form:
. %[*][<[width]>][<[size]>]<[type]>
Each format specification begins with the percent character (<<%>>).
The other fields are:
o+
o *
an optional marker; if present, it suppresses interpretation and
assignment of this input field.
o <[width]>
an optional maximum field width: a decimal integer,
which controls the maximum number of characters that
will be read before converting the current input field. If the
input field has fewer than <[width]> characters, <<wscanf>>
reads all the characters in the field, and then
proceeds with the next field and its format specification.
If a whitespace or a non-convertable wide character occurs
before <[width]> character are read, the characters up
to that character are read, converted, and stored.
Then <<wscanf>> proceeds to the next format specification.
o size
<<h>>, <<j>>, <<l>>, <<L>>, <<t>>, and <<z>> are optional size
characters which override the default way that <<wscanf>>
interprets the data type of the corresponding argument.
.Modifier Type(s)
. hh d, i, o, u, x, n convert input to char,
. store in char object
.
. h d, i, o, u, x, n convert input to short,
. store in short object
.
. h e, f, c, s, p no effect
.
. j d, i, o, u, x, n convert input to intmax_t,
. store in intmax_t object
.
. j all others no effect
.
. l d, i, o, u, x, n convert input to long,
. store in long object
.
. l e, f, g convert input to double
. store in a double object
.
. l c, s, [ the input is stored in a wchar_t object
.
. l p no effect
.
. ll d, i, o, u, x, n convert to long long,
. store in long long
.
. L d, i, o, u, x, n convert to long long,
. store in long long
.
. L e, f, g, E, G convert to long double,
. store in long double
.
. L all others no effect
.
. t d, i, o, u, x, n convert input to ptrdiff_t,
. store in ptrdiff_t object
.
. t all others no effect
.
. z d, i, o, u, x, n convert input to size_t,
. store in size_t object
.
. z all others no effect
.
o <[type]>
A character to specify what kind of conversion
<<wscanf>> performs. Here is a table of the conversion
characters:
o+
o %
No conversion is done; the percent character (<<%>>) is stored.
o c
Scans one wide character. Corresponding <[arg]>: <<(char *arg)>>.
Otherwise, if an <<l>> specifier is present, the corresponding
<[arg]> is a <<(wchar_t *arg)>>.
o s
Reads a character string into the array supplied.
Corresponding <[arg]>: <<(char arg[])>>.
If an <<l>> specifier is present, the corresponding <[arg]> is a <<(wchar_t *arg)>>.
o [<[pattern]>]
Reads a non-empty character string into memory
starting at <[arg]>. This area must be large
enough to accept the sequence and a
terminating null character which will be added
automatically. (<[pattern]> is discussed in the paragraph following
this table). Corresponding <[arg]>: <<(char *arg)>>.
o d
Reads a decimal integer into the corresponding <[arg]>: <<(int *arg)>>.
o o
Reads an octal integer into the corresponding <[arg]>: <<(int *arg)>>.
o u
Reads an unsigned decimal integer into the corresponding
<[arg]>: <<(unsigned int *arg)>>.
o x,X
Read a hexadecimal integer into the corresponding <[arg]>:
<<(int *arg)>>.
o e, f, g
Read a floating-point number into the corresponding <[arg]>:
<<(float *arg)>>.
o E, F, G
Read a floating-point number into the corresponding <[arg]>:
<<(double *arg)>>.
o i
Reads a decimal, octal or hexadecimal integer into the
corresponding <[arg]>: <<(int *arg)>>.
o n
Stores the number of characters read in the corresponding
<[arg]>: <<(int *arg)>>.
o p
Stores a scanned pointer. ANSI C leaves the details
to each implementation; this implementation treats
<<%p>> exactly the same as <<%U>>. Corresponding
<[arg]>: <<(void **arg)>>.
o-
A <[pattern]> of characters surrounded by square brackets can be used
instead of the <<s>> type character. <[pattern]> is a set of
characters which define a search set of possible characters making up
the <<wscanf>> input field. If the first character in the brackets is a
caret (<<^>>), the search set is inverted to include all ASCII characters
except those between the brackets. There is no range facility as is
defined in the corresponding non-wide character scanf functions.
Ranges are not part of the POSIX standard.
Here are some <[pattern]> examples:
o+
o %[abcd]
matches wide wide character strings containing only
<<a>>, <<b>>, <<c>>, and <<d>>.
o %[^abcd]
matches wide character strings containing any characters except
<<a>>, <<b>>, <<c>>, or <<d>>.
o %[A-DW-Z]
Note: No wide character ranges, so this expression matches wide
character strings containing <<A>>, <<->>, <<D>>, <<W>>, <<Z>>.
Floating point numbers (for field types <<e>>, <<f>>, <<g>>, <<E>>,
<<F>>, <<G>>) must correspond to the following general form:
. [+/-] ddddd[.]ddd [E|e[+|-]ddd]
where objects inclosed in square brackets are optional, and <<ddd>>
represents decimal, octal, or hexadecimal digits.
o-
RETURNS
<<wscanf>> returns the number of input fields successfully
scanned, converted and stored; the return value does
not include scanned fields which were not stored.
If <<wscanf>> attempts to read at end-of-file, the return
value is <<EOF>>.
If no fields were stored, the return value is <<0>>.
<<wscanf>> might stop scanning a particular field before
reaching the normal field end character, or may
terminate entirely.
<<wscanf>> stops scanning and storing the current field
and moves to the next input field (if any)
in any of the following situations:
O+
o The assignment suppressing character (<<*>>) appears
after the <<%>> in the format specification; the current
input field is scanned but not stored.
o <[width]> characters have been read (<[width]> is a
width specification, a positive decimal integer).
o The next wide character read cannot be converted
under the the current format (for example,
if a <<Z>> is read when the format is decimal).
o The next wide character in the input field does not appear
in the search set (or does appear in the inverted search set).
O-
When <<wscanf>> stops scanning the current input field for one of
these reasons, the next character is considered unread and
used as the first character of the following input field, or the
first character in a subsequent read operation on the input.
<<wscanf>> will terminate under the following circumstances:
O+
o The next wide character in the input field conflicts
with a corresponding non-whitespace character in the
format string.
o The next wide character in the input field is <<WEOF>>.
o The format string has been exhausted.
O-
When the format string contains a wide character sequence that is
not part of a format specification, the same wide character
sequence must appear in the input; <<wscanf>> will
scan but not store the matched characters. If a
conflict occurs, the first conflicting wide character remains in the
input as if it had never been read.
PORTABILITY
<<wscanf>> is C99, POSIX-1.2008.
Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
<<lseek>>, <<read>>, <<sbrk>>, <<write>>.
*/
#include <_ansi.h>
#include <reent.h>
#include <stdio.h>
#include <wchar.h>
#include <stdarg.h>
#include "local.h"
#ifndef _REENT_ONLY
int
swscanf (_CONST wchar_t *str, _CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
FILE f;
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = wcslen (str) * sizeof (wchar_t);
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */
va_start (ap, fmt);
ret = __ssvfwscanf_r (_REENT, &f, fmt, ap);
va_end (ap);
return ret;
}
#endif /* !_REENT_ONLY */
int
_swscanf_r (struct _reent *ptr, _CONST wchar_t *str, _CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
FILE f;
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = wcslen (str) * sizeof (wchar_t);
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */
va_start (ap, fmt);
ret = __ssvfwscanf_r (ptr, &f, fmt, ap);
va_end (ap);
return ret;
}

View File

@ -278,7 +278,9 @@ err:
uio->uio_iovcnt = 0;
return EOF;
}
#endif /* INTEGER_ONLY */
#else /* !INTEGER_ONLY */
int __ssprint_r (struct _reent *, FILE *, register struct __suio *);
#endif /* !INTEGER_ONLY */
#else /* !STRING_ONLY */
#ifdef INTEGER_ONLY
@ -322,7 +324,9 @@ out:
uio->uio_iovcnt = 0;
return (err);
}
#endif /* INTEGER_ONLY */
#else /* !INTEGER_ONLY */
int __sprint_r (struct _reent *, FILE *, register struct __suio *);
#endif /* !INTEGER_ONLY */
/*
* Helper function for `fprintf to unbuffered unix file': creates a

View File

@ -293,11 +293,11 @@ _DEFUN(_VFSCANF_R, (data, fp, fmt, ap),
}
#endif /* !STRING_ONLY */
#ifdef STRING_ONLY
#if defined (STRING_ONLY) && defined (INTEGER_ONLY)
/* When dealing with the sscanf family, we don't want to use the
* regular ungetc which will drag in file I/O items we don't need.
* So, we create our own trimmed-down version. */
static int
int
_DEFUN(_sungetc_r, (data, fp, ch),
struct _reent *data _AND
int c _AND
@ -355,7 +355,7 @@ _DEFUN(_sungetc_r, (data, fp, ch),
}
/* String only version of __srefill_r for sscanf family. */
static int
int
_DEFUN(__ssrefill_r, (ptr, fp),
struct _reent * ptr _AND
register FILE * fp)
@ -381,7 +381,7 @@ _DEFUN(__ssrefill_r, (ptr, fp),
return EOF;
}
static size_t
size_t
_DEFUN(_sfread_r, (ptr, buf, size, count, fp),
struct _reent * ptr _AND
_PTR buf _AND
@ -418,7 +418,11 @@ _DEFUN(_sfread_r, (ptr, buf, size, count, fp),
fp->_p += resid;
return count;
}
#endif /* STRING_ONLY */
#else /* !STRING_ONLY || !INTEGER_ONLY */
int _EXFUN (_sungetc_r, (struct _reent *, int, register FILE *));
int _EXFUN (__ssrefill_r, (struct _reent *, register FILE *));
size_t _EXFUN (_sfread_r, (struct _reent *, _PTR buf, size_t, size_t, FILE *));
#endif /* !STRING_ONLY || !INTEGER_ONLY */
int
_DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap),
@ -717,7 +721,7 @@ _DEFUN(__SVFSCANF_R, (rptr, fp, fmt0, ap),
break;
case '[':
fmt = __sccl (ccltab, fmt);
fmt = (u_char *) __sccl (ccltab, (unsigned char *) fmt);
flags |= NOSKIP;
c = CT_CCL;
break;

1469
newlib/libc/stdio/vfwscanf.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -28,16 +28,6 @@
#endif
#include "local.h"
static _READ_WRITE_RETURN_TYPE
_DEFUN(eofread1, (ptr, cookie, buf, len),
struct _reent *ptr _AND
_PTR cookie _AND
char *buf _AND
int len)
{
return 0;
}
/*
* vsiscanf
*/
@ -67,7 +57,7 @@ _DEFUN(_vsiscanf_r, (ptr, str, fmt, ap),
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread1;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */

View File

@ -28,16 +28,6 @@
#endif
#include "local.h"
static _READ_WRITE_RETURN_TYPE
_DEFUN(eofread1, (ptr, cookie, buf, len),
struct _reent *_ptr _AND
_PTR cookie _AND
char *buf _AND
int len)
{
return 0;
}
/*
* vsscanf
*/
@ -67,7 +57,7 @@ _DEFUN(_vsscanf_r, (ptr, str, fmt, ap),
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = strlen (str);
f._read = eofread1;
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */

View File

@ -27,6 +27,7 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#include <limits.h>
#include <stdarg.h>
#include <errno.h>
#include "local.h"
int
_DEFUN(_vswprintf_r, (ptr, str, size, fmt, ap),

View File

@ -0,0 +1,60 @@
/*
* Code created by modifying scanf.c which has following copyright.
*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h>
#include <reent.h>
#include <stdio.h>
#include <wchar.h>
#include <string.h>
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
/*
* vsscanf
*/
#ifndef _REENT_ONLY
int
vswscanf (_CONST wchar_t *str, _CONST wchar_t *fmt, va_list ap)
{
return _vswscanf_r (_REENT, str, fmt, ap);
}
#endif /* !_REENT_ONLY */
int
_vswscanf_r (struct _reent *ptr, _CONST wchar_t *str, _CONST wchar_t *fmt,
va_list ap)
{
FILE f;
f._flags = __SRD | __SSTR;
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._r = wcslen (str) * sizeof (wchar_t);
f._read = __seofread;
f._ub._base = NULL;
f._lb._base = NULL;
f._file = -1; /* No file. */
return __ssvfwscanf_r (ptr, &f, fmt, ap);
}

View File

@ -0,0 +1,48 @@
/*-
* Code created by modifying scanf.c which has following copyright.
*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h>
#include <reent.h>
#include <stdio.h>
#include <wchar.h>
#ifdef _HAVE_STDC
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "local.h"
#ifndef _REENT_ONLY
int
vwscanf (_CONST wchar_t *fmt, va_list ap)
{
_REENT_SMALL_CHECK_INIT (_REENT);
return __svfwscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
}
#endif /* !_REENT_ONLY */
int
_vwscanf_r (struct _reent *ptr, _CONST wchar_t *fmt, va_list ap)
{
_REENT_SMALL_CHECK_INIT (ptr);
return __svfwscanf_r (ptr, _stdin_r (ptr), fmt, ap);
}

View File

@ -0,0 +1,54 @@
/*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
#include <_ansi.h>
#include <reent.h>
#include <stdio.h>
#include <wchar.h>
#include <stdarg.h>
#include "local.h"
#ifndef _REENT_ONLY
int
wscanf(_CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
_REENT_SMALL_CHECK_INIT (_REENT);
va_start (ap, fmt);
ret = __svfwscanf_r (_REENT, _stdin_r (_REENT), fmt, ap);
va_end (ap);
return ret;
}
#endif /* !_REENT_ONLY */
int
_wscanf_r(struct _reent *ptr, _CONST wchar_t *fmt, ...)
{
int ret;
va_list ap;
_REENT_SMALL_CHECK_INIT (ptr);
va_start (ap, fmt);
ret = __svfwscanf_r (ptr, _stdin_r (ptr), fmt, ap);
va_end (ap);
return (ret);
}