Well I recently got re-motivated, by forgetting I was using an unpatched
version of Wine, and getting my WC3 campaign file nuked :(.
So, I've had a go over this all, and here is a new version. Is it a step
in the right direction? I still don't really know what I should be doing
to improve this.
Aneurin Price
Index: dlls/msvcrt/Makefile.in
===
RCS file: /home/wine/wine/dlls/msvcrt/Makefile.in,v
retrieving revision 1.17
diff -u -u -r1.17 Makefile.in
--- dlls/msvcrt/Makefile.in 8 Nov 2004 22:10:43 - 1.17
+++ dlls/msvcrt/Makefile.in 27 Nov 2004 21:27:58 -
@@ -27,6 +27,7 @@
math.c \
mbcs.c \
misc.c \
+ printf.c \
process.c \
scanf.c \
string.c \
Index: dlls/msvcrt/file.c
===
RCS file: /home/wine/wine/dlls/msvcrt/file.c,v
retrieving revision 1.73
diff -u -u -r1.73 file.c
--- dlls/msvcrt/file.c 3 Nov 2004 22:17:05 - 1.73
+++ dlls/msvcrt/file.c 27 Nov 2004 21:28:00 -
@@ -2614,113 +2614,6 @@
return file;
}
-/*
- * vfprintf (MSVCRT.@)
- */
-int MSVCRT_vfprintf(MSVCRT_FILE* file, const char *format, va_list valist)
-{
- char buf[2048], *mem = buf;
- int written, resize = sizeof(buf), retval;
- /* There are two conventions for vsnprintf failing:
- * Return -1 if we truncated, or
- * Return the number of bytes that would have been written
- * The code below handles both cases
- */
- while ((written = vsnprintf(mem, resize, format, valist)) == -1 ||
- written resize)
- {
-resize = (written == -1 ? resize * 2 : written + 1);
-if (mem != buf)
- MSVCRT_free (mem);
-if (!(mem = (char *)MSVCRT_malloc(resize)))
- return MSVCRT_EOF;
- }
- retval = MSVCRT_fwrite(mem, sizeof(*mem), written, file);
- if (mem != buf)
-MSVCRT_free (mem);
- return retval;
-}
-
-/*
- * vfwprintf (MSVCRT.@)
- * FIXME:
- * Is final char included in written (then resize is too big) or not
- * (then we must test for equality too)?
- */
-int MSVCRT_vfwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, va_list
valist)
-{
- MSVCRT_wchar_t buf[2048], *mem = buf;
- int written, resize = sizeof(buf) / sizeof(MSVCRT_wchar_t), retval;
- /* See vfprintf comments */
- while ((written = _vsnwprintf(mem, resize, format, valist)) == -1 ||
- written resize)
- {
-resize = (written == -1 ? resize * 2 : written + sizeof(MSVCRT_wchar_t));
-if (mem != buf)
- MSVCRT_free (mem);
-if (!(mem = (MSVCRT_wchar_t *)MSVCRT_malloc(resize*sizeof(*mem
- return MSVCRT_EOF;
- }
- retval = MSVCRT_fwrite(mem, sizeof(*mem), written, file);
- if (mem != buf)
-MSVCRT_free (mem);
- return retval;
-}
-
-/*
- * vprintf (MSVCRT.@)
- */
-int MSVCRT_vprintf(const char *format, va_list valist)
-{
- return MSVCRT_vfprintf(MSVCRT_stdout,format,valist);
-}
-
-/*
- * vwprintf (MSVCRT.@)
- */
-int MSVCRT_vwprintf(const MSVCRT_wchar_t *format, va_list valist)
-{
- return MSVCRT_vfwprintf(MSVCRT_stdout,format,valist);
-}
-
-/*
- * fprintf (MSVCRT.@)
- */
-int MSVCRT_fprintf(MSVCRT_FILE* file, const char *format, ...)
-{
-va_list valist;
-int res;
-va_start(valist, format);
-res = MSVCRT_vfprintf(file, format, valist);
-va_end(valist);
-return res;
-}
-
-/*
- * fwprintf (MSVCRT.@)
- */
-int MSVCRT_fwprintf(MSVCRT_FILE* file, const MSVCRT_wchar_t *format, ...)
-{
-va_list valist;
-int res;
-va_start(valist, format);
-res = MSVCRT_vfwprintf(file, format, valist);
-va_end(valist);
-return res;
-}
-
-/*
- * printf (MSVCRT.@)
- */
-int MSVCRT_printf(const char *format, ...)
-{
-va_list valist;
-int res;
-va_start(valist, format);
-res = MSVCRT_vfprintf(MSVCRT_stdout, format, valist);
-va_end(valist);
-return res;
-}
/*
* ungetc (MSVCRT.@)
@@ -2753,17 +2646,4 @@
return MSVCRT_WEOF;
}
return mwc;
-}
-
-/*
- * wprintf (MSVCRT.@)
- */
-int MSVCRT_wprintf(const MSVCRT_wchar_t *format, ...)
-{
-va_list valist;
-int res;
-va_start(valist, format);
-res = MSVCRT_vwprintf(format, valist);
-va_end(valist);
-return res;
}
Index: