2003-03-02 Danny Smith <dannysmith@users.sourceforge.net>

* include/stdio.h (vscanf): Add prototype.
	(vfscanf): Ditto.
	(vsscanf): Ditto.
	(vwscanf): Ditto.
	(vfwscanf): Ditto.
	(vswscanf): Ditto.
	* include/wchar.h (vwscanf): Add prototype.
	(vfwscanf): Ditto.
	(vswscanf): Ditto.
	* mingwex/snprintf.c: Move to mingwex/stdio.
 	* mingwex/vsnprintf.c: Ditto.
	* mingwex/snwprintf.c: Ditto.
	* mingwex/vsnwprintf.c: Ditto.
	* mingwex/Makefile.in (VPATH): Add $(srcdir)/stdio
	(STDIO_DISTFILES): Add.
	(DISTFILES): Adjust.
	(STDIO_STUB_OBJS): Rename to STDIO_OBJS and add v*scanf objects.
	(LIB_OBJS): Adjust.
	(dist): Adjust.

2003-03-02  Aaron W  LaFramboise   <AWLaFramboise@aol.com>

	* mingwex/stdio: New directory
	* mingwex/stdio/vfscanf.c: New file.
	* mingwex/stdio/vfwscanf.c:  New file.
	* mingwex/stdio/vscanf.c:  New file.
	* mingwex/stdio/vsscanf.c:  New file.
	* mingwex/stdio/vswscanf.c:  New file.
	* mingwex/stdio/vwscanf.c:  New file.
This commit is contained in:
Danny Smith 2003-03-02 07:00:48 +00:00
parent 408e9b2fd4
commit 4aa3feb899
14 changed files with 259 additions and 17 deletions

View File

@ -1,3 +1,35 @@
2003-03-02 Danny Smith <dannysmith@users.sourceforge.net>
* include/stdio.h (vscanf): Add prototype.
(vfscanf): Ditto.
(vsscanf): Ditto.
(vwscanf): Ditto.
(vfwscanf): Ditto.
(vswscanf): Ditto.
* include/wchar.h (vwscanf): Add prototype.
(vfwscanf): Ditto.
(vswscanf): Ditto.
* mingwex/snprintf.c: Move to mingwex/stdio.
* mingwex/vsnprintf.c: Ditto.
* mingwex/snwprintf.c: Ditto.
* mingwex/vsnwprintf.c: Ditto.
* mingwex/Makefile.in (VPATH): Add $(srcdir)/stdio
(STDIO_DISTFILES): Add.
(DISTFILES): Adjust.
(STDIO_STUB_OBJS): Rename to STDIO_OBJS and add v*scanf objects.
(LIB_OBJS): Adjust.
(dist): Adjust.
2003-03-02 Aaron W LaFramboise <AWLaFramboise@aol.com>
* mingwex/stdio: New directory
* mingwex/stdio/vfscanf.c: New file.
* mingwex/stdio/vfwscanf.c: New file.
* mingwex/stdio/vscanf.c: New file.
* mingwex/stdio/vsscanf.c: New file.
* mingwex/stdio/vswscanf.c: New file.
* mingwex/stdio/vwscanf.c: New file.
2003-02-25 Earnie Boyd <earnie@users.sf.net>
* Makefile.in (libmsvcrt20.a): Remove target and dependencies.
@ -201,7 +233,7 @@
2002-10-30 Guido Serassio <serassio@libero.it>
* include/stdio.h (_getmaxstdio): Add prototype.
* include/stdio.h (_getmaxstdio): Add prototype.
(_setmaxstdio): Likewise.
2002-10-19 Kang Li <rubylith@users.sourceforge.net>

View File

@ -222,9 +222,14 @@ _CRTIMP int __cdecl _vsnprintf (char*, size_t, const char*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int __cdecl snprintf(char* s, size_t n, const char* format, ...);
extern __inline__ int __cdecl vsnprintf (char* s, size_t n, const char* format,
__VALIST arg)
extern __inline__ int __cdecl
vsnprintf (char* s, size_t n, const char* format, __VALIST arg)
{ return _vsnprintf ( s, n, format, arg); }
int __cdecl vscanf (const char * __restrict__, __VALIST);
int __cdecl vfscanf (FILE * __restrict__, const char * __restrict__,
__VALIST);
int __cdecl vsscanf (const char * __restrict__,
const char * __restrict__, __VALIST);
#endif
/*
@ -358,6 +363,7 @@ _CRTIMP int __cdecl swscanf (const wchar_t*, const wchar_t*, ...);
_CRTIMP wint_t __cdecl fgetwc (FILE*);
_CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*);
_CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*);
#ifdef __MSVCRT__
_CRTIMP wchar_t* __cdecl fgetws (wchar_t*, int, FILE*);
_CRTIMP int __cdecl fputws (const wchar_t*, FILE*);
@ -380,10 +386,15 @@ _CRTIMP FILE* __cdecl _wpopen (const wchar_t*, const wchar_t*);
#endif /* __MSVCRT__ */
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int __cdecl snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);
extern __inline__ int __cdecl
vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg)
{ return _vsnwprintf ( s, n, format, arg);}
int __cdecl vwscanf (const wchar_t * __restrict__, __VALIST);
int __cdecl vfwscanf (FILE * __restrict__,
const wchar_t * __restrict__, __VALIST);
int __cdecl vswscanf (const wchar_t * __restrict__,
const wchar_t * __restrict__, __VALIST);
#endif
#define _WSTDIO_DEFINED

View File

@ -118,10 +118,15 @@ _CRTIMP wint_t __cdecl fputwc (wchar_t, FILE*);
_CRTIMP wint_t __cdecl ungetwc (wchar_t, FILE*);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */
int __cdecl snwprintf(wchar_t* s, size_t n, const wchar_t* format, ...);
extern __inline__ int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format,
__VA_LIST arg)
{ return _vsnwprintf ( s, n, format, arg); }
int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t* format, ...);
extern __inline__ int __cdecl
vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg)
{ return _vsnwprintf ( s, n, format, arg);}
int __cdecl vwscanf (const wchar_t * __restrict__, __VALIST);
int __cdecl vfwscanf (FILE * __restrict__,
const wchar_t * __restrict__, __VALIST);
int __cdecl vswscanf (const wchar_t * __restrict__,
const wchar_t * __restrict__, __VALIST);
#endif
#ifdef __MSVCRT__

View File

@ -4,7 +4,7 @@
# This makefile requires GNU make.
srcdir = @srcdir@
VPATH = $(srcdir):$(srcdir)/math
VPATH = $(srcdir):$(srcdir)/math:$(srcdir)/stdio
objdir = .
target_alias = @target_alias@
@ -30,11 +30,12 @@ DISTFILES = Makefile.in configure configure.in \
fegetexceptflag.c fegetround.c feholdexcept.c feraiseexcept.c \
fesetenv.c fesetexceptflag.c fesetround.c fetestexcept.c \
feupdateenv.c fwide.c imaxabs.c imaxdiv.c ldtoa.c lltoa.c lltow.c \
mbsinit.c mingw-fseek.c sitest.c snprintf.c snwprintf.c \
mbsinit.c mingw-fseek.c sitest.c \
strtof.c strtoimax.c strtold.c strtoumax.c testwmem.c \
ulltoa.c ulltow.c vsnprintf.c vsnwprintf.c wcstof.c \
ulltoa.c ulltow.c wcstof.c \
wcstoimax.c wcstold.c wcstoumax.c wdirent.c wmemchr.c \
wmemcmp.c wmemcpy.c wmemmove.c wmemset.c wtoll.c
MATH_DISTFILES = \
acosf.c acosl.c asinf.c asinl.c atan2f.c atan2l.c \
atanf.c atanl.c cbrt.c cbrtf.c cbrtl.c ceilf.S ceill.S \
@ -61,6 +62,10 @@ MATH_DISTFILES = \
sqrtf.c sqrtl.c tanf.S tanhf.c tanhl.c tanl.S tgamma.c \
tgammaf.c tgammal.c trunc.c truncf.c truncl.c
STDIO_DISTFILES = \
snprintf.c snwprintf.c vsnprintf.c vsnwprintf.c \
vfscanf.c vfwscanf.c vscanf.c vsscanf.c vswscanf.c vwscanf.c
CC = @CC@
# FIXME: Which is it, CC or CC_FOR_TARGET?
CC_FOR_TARGET = $(CC)
@ -104,8 +109,9 @@ STDLIB_STUB_OBJS = \
atoll.o wtoll.o \
strtof.o wcstof.o \
_Exit.o
STDIO_STUB_OBJS = \
snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o
STDIO_OBJS = \
snprintf.o vsnprintf.o snwprintf.o vsnwprintf.o \
vfscanf.o vfwscanf.o vscanf.o vsscanf.o vswscanf.o vwscanf.o
MATH_OBJS = \
acosf.o acosl.o asinf.o asinl.o atan2f.o atan2l.o \
atanf.o atanl.o cbrt.o cbrtf.o cbrtl.o ceilf.o ceill.o \
@ -141,8 +147,8 @@ REPLACE_OBJS = \
mingw-fseek.o
LIB_OBJS = $(Q8_OBJS) $(STDLIB_OBJS) $(STDLIB_STUB_OBJS) \
$(STDIO_STUB_OBJS) $(MATH_OBJS) $(FENV_OBJS) $(POSIX_OBJS) \
$(REPLACE_OBJS)
$(STDIO_OBJS) $(MATH_OBJS) $(FENV_OBJS) \
$(POSIX_OBJS) $(REPLACE_OBJS)
LIBS = $(LIBMINGWEX_A)
DLLS =
@ -203,8 +209,12 @@ dist:
cp -p $(srcdir)/$$i $(distdir)/mingwex/$$i ; \
done
mkdir $(distdir)/mingwex/math
chmod 755 $(distdir)//mingwex/math
chmod 755 $(distdir)/mingwex/math
@for i in $(MATH_DISTFILES); do\
cp -p $(srcdir)/math/$$i $(distdir)/mingwex/math/$$i ; \
done
mkdir $(distdir)/mingwex/stdio
chmod 755 $(distdir)/mingwex/stdio
@for i in $(STDIO_DISTFILES); do\
cp -p $(srcdir)/stdio/$$i $(distdir)/mingwex/stdio/$$i ; \
done

View File

@ -0,0 +1,40 @@
// By aaronwl 2003-01-28 for mingw-msvcrt
// Public domain: all copyrights disclaimed, absolutely no warranties */
#include <stdarg.h>
#include <stdio.h>
int vfscanf(FILE * __restrict__ stream, const char * __restrict__ format, va_list arg) {
int ret;
__asm__(
/* allocate stack (esp += frame - arg3 - (8[arg1,2] + 12)) */
"movl %%esp, %%ebx\n\t"
"lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t"
"subl %5, %%esp\n\t"
// set up stack
"movl %1, 0xC(%%esp)\n\t" // stream
"movl %2, 0x10(%%esp)\n\t" // format
"lea 0x14(%%esp), %%edi\n\t"
"movl %%edi, (%%esp)\n\t" // memcpy dest
"movl %5, 0x4(%%esp)\n\t" // memcpy src
"movl %5, 0x8(%%esp)\n\t"
"subl %6, 0x8(%%esp)\n\t" // memcpy len
"call _memcpy\n\t"
"addl $12, %%esp\n\t"
// call fscanf
"call _fscanf\n\t"
// restore stack
"movl %%ebx, %%esp\n\t"
: "=a"(ret), "=c"(stream), "=d"(format)
: "1"(stream), "2"(format), "S"(arg),
"a"(&ret)
: "ebx");
return ret;
}

View File

@ -0,0 +1,42 @@
// By aaronwl 2003-01-28 for mingw-msvcrt.
// Public domain: all copyrights disclaimed, absolutely no warranties.
#include <stdarg.h>
#include <wchar.h>
int vfwscanf(FILE * __restrict__ stream, const wchar_t * __restrict__ format,
va_list arg) {
int ret;
__asm__(
// allocate stack (esp += frame - arg3 - (8[arg1,2] + 12))
"movl %%esp, %%ebx\n\t"
"lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t"
"subl %5, %%esp\n\t"
// set up stack
"movl %1, 0xC(%%esp)\n\t" // stream
"movl %2, 0x10(%%esp)\n\t" // format
"lea 0x14(%%esp), %%edi\n\t"
"movl %%edi, (%%esp)\n\t" // memcpy dest
"movl %5, 0x4(%%esp)\n\t" // memcpy src
"movl %5, 0x8(%%esp)\n\t"
"subl %6, 0x8(%%esp)\n\t" // memcpy len
"call _memcpy\n\t"
"addl $12, %%esp\n\t"
// call fscanf
"call _fwscanf\n\t"
// restore stack
"movl %%ebx, %%esp\n\t"
: "=a"(ret), "=c"(stream), "=d"(format)
: "1"(stream), "2"(format), "S"(arg),
"a"(&ret)
: "ebx");
return ret;
}

View File

@ -0,0 +1,9 @@
// By aaronwl 2003-01-28 for mingw-msvcrt
// Public domain: all copyrights disclaimed, absolutely no warranties
#include <stdarg.h>
#include <stdio.h>
int vscanf(const char * __restrict__ format, va_list arg) {
return vfscanf(stdin, format, arg);
}

View File

@ -0,0 +1,41 @@
// By aaronwl 2003-01-28 for mingw-msvcrt.
// Public domain: all copyrights disclaimed, absolutely no warranties.
#include <stdarg.h>
#include <stdio.h>
int vsscanf(const char * __restrict__ s, const char * __restrict__ format, va_list arg) {
int ret;
__asm__(
// allocate stack (esp += frame - arg3 - (8[arg1,2] + 12))
"movl %%esp, %%ebx\n\t"
"lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t"
"subl %5, %%esp\n\t"
// set up stack
"movl %1, 0xC(%%esp)\n\t" // s
"movl %2, 0x10(%%esp)\n\t" // format
"lea 0x14(%%esp), %%edi\n\t"
"movl %%edi, (%%esp)\n\t" // memcpy dest
"movl %5, 0x4(%%esp)\n\t" // memcpy src
"movl %5, 0x8(%%esp)\n\t"
"subl %6, 0x8(%%esp)\n\t" // memcpy len
"call _memcpy\n\t"
"addl $12, %%esp\n\t"
// call sscanf
"call _sscanf\n\t"
// restore stack
"movl %%ebx, %%esp\n\t"
: "=a"(ret), "=c"(s), "=d"(format)
: "1"(s), "2"(format), "S"(arg),
"a"(&ret)
: "ebx");
return ret;
}

View File

@ -0,0 +1,43 @@
// By aaronwl 2003-01-28 for mingw-msvcrt
// Public domain: all copyrights disclaimed, absolutely no warranties */
#include <stdarg.h>
#include <wchar.h>
int vswscanf(const wchar_t * __restrict__ s, const wchar_t * __restrict__ format,
va_list arg) {
int ret;
__asm__(
// allocate stack (esp += frame - arg3 - (8[arg1,2] + 12))
"movl %%esp, %%ebx\n\t"
"lea 0xFFFFFFEC(%%esp, %6), %%esp\n\t"
"subl %5, %%esp\n\t"
// set up stack
"movl %1, 0xC(%%esp)\n\t" // s
"movl %2, 0x10(%%esp)\n\t" // format
"lea 0x14(%%esp), %%edi\n\t"
"movl %%edi, (%%esp)\n\t" // memcpy dest
"movl %5, 0x4(%%esp)\n\t" // memcpy src
"movl %5, 0x8(%%esp)\n\t"
"subl %6, 0x8(%%esp)\n\t" // memcpy len
"call _memcpy\n\t"
"addl $12, %%esp\n\t"
// call sscanf
"call _swscanf\n\t"
// restore stack
"movl %%ebx, %%esp\n\t"
: "=a"(ret), "=c"(s), "=d"(format)
: "1"(s), "2"(format), "S"(arg),
"a"(&ret)
: "ebx");
return ret;
}

View File

@ -0,0 +1,9 @@
// By aaronwl 2003-01-28 for mingw-msvcrt.
// Public domain: all copyrights disclaimed, absolutely no warranties.
#include <stdarg.h>
#include <wchar.h>
int vwscanf(const wchar_t * __restrict__ format, va_list arg) {
return vfwscanf(stdin, format, arg);
}