summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
Diffstat (limited to 'winsup')
-rw-r--r--winsup/mingw/ChangeLog13
-rw-r--r--winsup/mingw/include/io.h297
-rw-r--r--winsup/mingw/include/signal.h108
-rw-r--r--winsup/mingw/include/stdio.h2
-rw-r--r--winsup/mingw/include/string.h204
-rw-r--r--winsup/mingw/include/wchar.h210
6 files changed, 754 insertions, 80 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog
index db18b76f61a..8822eee9687 100644
--- a/winsup/mingw/ChangeLog
+++ b/winsup/mingw/ChangeLog
@@ -1,4 +1,15 @@
-2002-09-20 Danny Smith <dannysmith@users.sourceforge.net>
+2002-09-24 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * include/io.h: Move wide char prototypes together.
+ * include/string.h: Untangle wide char protototypes.
+ Use C++ c-header compatability defines.
+ *include/wchar.h: Copy wide char string prototypes from
+ string.h.
+ Resync with io.h.
+ * include/signal.h: Use C++ c-header compatability defines.
+ * include/stdio.h: Add __HAVE_STD_CXX guard.
+
+2002-09-21 Danny Smith <dannysmith@users.sourceforge.net>
* include/stdio.h: Reorder ANSI vs non-ANSI declarations
Use C++ c-header compatability defines.
diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h
new file mode 100644
index 00000000000..98e3f1355c5
--- /dev/null
+++ b/winsup/mingw/include/io.h
@@ -0,0 +1,297 @@
+/*
+ * io.h
+ *
+ * System level I/O functions and types.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision$
+ * $Author$
+ * $Date$
+ *
+ */
+
+#ifndef __STRICT_ANSI__
+
+#ifndef _IO_H_
+#define _IO_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+/* We need the definition of FILE anyway... */
+#include <stdio.h>
+
+/* MSVC's io.h contains the stuff from dir.h, so I will too.
+ * NOTE: This also defines off_t, the file offset type, through
+ * an inclusion of sys/types.h */
+
+#include <sys/types.h> /* To get time_t. */
+
+/*
+ * Attributes of files as returned by _findfirst et al.
+ */
+#define _A_NORMAL 0x00000000
+#define _A_RDONLY 0x00000001
+#define _A_HIDDEN 0x00000002
+#define _A_SYSTEM 0x00000004
+#define _A_VOLID 0x00000008
+#define _A_SUBDIR 0x00000010
+#define _A_ARCH 0x00000020
+
+
+#ifndef RC_INVOKED
+
+#ifndef _FSIZE_T_DEFINED
+typedef unsigned long _fsize_t;
+#define _FSIZE_T_DEFINED
+#endif
+
+/*
+ * The following structure is filled in by _findfirst or _findnext when
+ * they succeed in finding a match.
+ */
+struct _finddata_t
+{
+ unsigned attrib; /* Attributes, see constants above. */
+ time_t time_create;
+ time_t time_access; /* always midnight local time */
+ time_t time_write;
+ _fsize_t size;
+ char name[FILENAME_MAX]; /* may include spaces. */
+};
+
+struct _finddatai64_t {
+ unsigned attrib;
+ time_t time_create;
+ time_t time_access;
+ time_t time_write;
+ __int64 size;
+ char name[FILENAME_MAX];
+};
+
+
+#ifndef _WFINDDATA_T_DEFINED
+struct _wfinddata_t {
+ unsigned attrib;
+ time_t time_create; /* -1 for FAT file systems */
+ time_t time_access; /* -1 for FAT file systems */
+ time_t time_write;
+ _fsize_t size;
+ wchar_t name[FILENAME_MAX]; /* may include spaces. */
+};
+struct _wfinddatai64_t {
+ unsigned attrib;
+ time_t time_create;
+ time_t time_access;
+ time_t time_write;
+ __int64 size;
+ wchar_t name[FILENAME_MAX];
+};
+
+#define _WFINDDATA_T_DEFINED
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Functions for searching for files. _findfirst returns -1 if no match
+ * is found. Otherwise it returns a handle to be used in _findnext and
+ * _findclose calls. _findnext also returns -1 if no match could be found,
+ * and 0 if a match was found. Call _findclose when you are finished.
+ */
+int _findfirst (const char*, struct _finddata_t*);
+int _findnext (int, struct _finddata_t*);
+int _findclose (int);
+
+int _chdir (const char*);
+char* _getcwd (char*, int);
+int _mkdir (const char*);
+char* _mktemp (char*);
+int _rmdir (const char*);
+int _chmod (const char*, int);
+
+
+#ifdef __MSVCRT__
+__int64 _filelengthi64(int);
+long _findfirsti64(const char*, struct _finddatai64_t*);
+int _findnexti64(long, struct _finddatai64_t*);
+__int64 _lseeki64(int, __int64, int);
+__int64 _telli64(int);
+#endif /* __MSVCRT__ */
+
+
+#ifndef _NO_OLDNAMES
+
+#ifndef _UWIN
+int chdir (const char*);
+char* getcwd (char*, int);
+int mkdir (const char*);
+char* mktemp (char*);
+int rmdir (const char*);
+int chmod (const char*, int);
+#endif /* _UWIN */
+
+#endif /* Not _NO_OLDNAMES */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not RC_INVOKED */
+
+
+/* TODO: Maximum number of open handles has not been tested, I just set
+ * it the same as FOPEN_MAX. */
+#define HANDLE_MAX FOPEN_MAX
+
+
+/* Some defines for _access nAccessMode (MS doesn't define them, but
+ * it doesn't seem to hurt to add them). */
+#define F_OK 0 /* Check for file existence */
+#define X_OK 1 /* Check for execute permission. */
+#define W_OK 2 /* Check for write permission */
+#define R_OK 4 /* Check for read permission */
+
+#ifndef RC_INVOKED
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int _access (const char*, int);
+int _chsize (int, long);
+int _close (int);
+int _commit(int);
+
+/* NOTE: The only significant bit in unPermissions appears to be bit 7 (0x80),
+ * the "owner write permission" bit (on FAT). */
+int _creat (const char*, int);
+
+int _dup (int);
+int _dup2 (int, int);
+long _filelength (int);
+int _fileno (FILE*);
+long _get_osfhandle (int);
+int _isatty (int);
+
+/* In a very odd turn of events this function is excluded from those
+ * files which define _STREAM_COMPAT. This is required in order to
+ * build GNU libio because of a conflict with _eof in streambuf.h
+ * line 107. Actually I might just be able to change the name of
+ * the enum member in streambuf.h... we'll see. TODO */
+#ifndef _STREAM_COMPAT
+int _eof (int);
+#endif
+
+/* LK_... locking commands defined in sys/locking.h. */
+int _locking (int, int, long);
+
+long _lseek (int, long, int);
+
+/* Optional third argument is unsigned unPermissions. */
+int _open (const char*, int, ...);
+
+int _open_osfhandle (long, int);
+int _pipe (int *, unsigned int, int);
+int _read (int, void*, unsigned int);
+
+/* SH_... flags for nShFlags defined in share.h
+ * Optional fourth argument is unsigned unPermissions */
+int _sopen (const char*, int, int, ...);
+
+long _tell (int);
+/* Should umask be in sys/stat.h and/or sys/types.h instead? */
+int _umask (int);
+int _unlink (const char*);
+int _write (int, const void*, unsigned int);
+
+#ifndef _NO_OLDNAMES
+/*
+ * Non-underscored versions of non-ANSI functions to improve portability.
+ * These functions live in libmoldname.a.
+ */
+
+#ifndef _UWIN
+int access (const char*, int);
+int chsize (int, long );
+int close (int);
+int creat (const char*, int);
+int dup (int);
+int dup2 (int, int);
+int eof (int);
+long filelength (int);
+int fileno (FILE*);
+int isatty (int);
+long lseek (int, long, int);
+int open (const char*, int, ...);
+int read (int, void*, unsigned int);
+int sopen (const char*, int, int, ...);
+long tell (int);
+int umask (int);
+int unlink (const char*);
+int write (int, const void*, unsigned int);
+#endif /* _UWIN */
+#endif /* Not _NO_OLDNAMES */
+
+/* Wide character versions. Also declared in wchar.h. */
+/* Not in crtdll.dll */
+#if !defined (_WIO_DEFINED)
+#if defined (__MSVCRT__)
+int _waccess(const wchar_t*, int);
+int _wchmod(const wchar_t*, int);
+int _wcreat(const wchar_t*, int);
+long _wfindfirst(const wchar_t*, struct _wfinddata_t*);
+int _wfindnext(long, struct _wfinddata_t *);
+int _wunlink(const wchar_t*);
+int _wopen(const wchar_t*, int, ...);
+int _wsopen(const wchar_t*, int, int, ...);
+wchar_t * _wmktemp(wchar_t*);
+long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+int _wfindnexti64(long, struct _wfinddatai64_t*);
+
+#ifndef __NO_OLDNAMES
+/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
+#if 0
+int waccess(const wchar_t *, int);
+int wchmod(const wchar_t *, int);
+int wcreat(const wchar_t *, int);
+long wfindfirst(wchar_t *, struct _wfinddata_t *);
+int wfindnext(long, struct _wfinddata_t *);
+int wunlink(const wchar_t *);
+int wrename(const wchar_t *, const wchar_t *);
+int wopen(const wchar_t *, int, ...);
+int wsopen(const wchar_t *, int, int, ...);
+wchar_t * wmktemp(wchar_t *);
+#endif
+#endif
+#endif /* defined (__MSVCRT__) */
+
+#define _WIO_DEFINED
+#endif /* _WIO_DEFINED */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* Not RC_INVOKED */
+
+#endif /* _IO_H_ not defined */
+
+#endif /* Not strict ANSI */
+
diff --git a/winsup/mingw/include/signal.h b/winsup/mingw/include/signal.h
new file mode 100644
index 00000000000..51979b838d9
--- /dev/null
+++ b/winsup/mingw/include/signal.h
@@ -0,0 +1,108 @@
+/*
+ * signal.h
+ *
+ * A way to set handlers for exceptional conditions (also known as signals).
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision$
+ * $Author$
+ * $Date$
+ *
+ */
+
+#ifndef _SIGNAL_H_
+#define _SIGNAL_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+/*
+ * The actual signal values. Using other values with signal
+ * produces a SIG_ERR return value.
+ *
+ * NOTE: SIGINT is produced when the user presses Ctrl-C.
+ * SIGILL has not been tested.
+ * SIGFPE doesn't seem to work?
+ * SIGSEGV does not catch writing to a NULL pointer (that shuts down
+ * your app; can you say "segmentation violation core dump"?).
+ * SIGTERM comes from what kind of termination request exactly?
+ * SIGBREAK is indeed produced by pressing Ctrl-Break.
+ * SIGABRT is produced by calling abort.
+ * TODO: The above results may be related to not installing an appropriate
+ * structured exception handling frame. Results may be better if I ever
+ * manage to get the SEH stuff down.
+ */
+#define SIGINT 2 /* Interactive attention */
+#define SIGILL 4 /* Illegal instruction */
+#define SIGFPE 8 /* Floating point error */
+#define SIGSEGV 11 /* Segmentation violation */
+#define SIGTERM 15 /* Termination request */
+#define SIGBREAK 21 /* Control-break */
+#define SIGABRT 22 /* Abnormal termination (abort) */
+
+#define NSIG 23 /* maximum signal number + 1 */
+
+#ifndef RC_INVOKED
+
+/*
+ * The prototypes (below) are the easy part. The hard part is figuring
+ * out what signals are available and what numbers they are assigned
+ * along with appropriate values of SIG_DFL and SIG_IGN.
+ */
+
+/*
+ * A pointer to a signal handler function. A signal handler takes a
+ * single int, which is the signal it handles.
+ */
+typedef void (*__p_sig_fn_t)(int);
+
+/*
+ * These are special values of signal handler pointers which are
+ * used to send a signal to the default handler (SIG_DFL), ignore
+ * the signal (SIG_IGN), or indicate an error return (SIG_ERR).
+ */
+#define SIG_DFL ((__p_sig_fn_t) 0)
+#define SIG_IGN ((__p_sig_fn_t) 1)
+#define SIG_ERR ((__p_sig_fn_t) -1)
+
+__BEGIN_CSTD_NAMESPACE
+
+#ifndef _SIG_ATOMIC_T_DEFINED
+typedef int sig_atomic_t;
+#define _SIG_ATOMIC_T_DEFINED
+#endif
+
+
+/*
+ * Call signal to set the signal handler for signal sig to the
+ * function pointed to by handler. Returns a pointer to the
+ * previous handler, or SIG_ERR if an error occurs. Initially
+ * unhandled signals defined above will return SIG_DFL.
+ */
+__p_sig_fn_t signal(int, __p_sig_fn_t);
+
+/*
+ * Raise the signal indicated by sig. Returns non-zero on success.
+ */
+int raise (int);
+
+__END_CSTD_NAMESPACE
+
+#endif /* Not RC_INVOKED */
+
+#endif /* Not _SIGNAL_H_ */
+
diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h
index cad5e991fad..a1eaa028cfd 100644
--- a/winsup/mingw/include/stdio.h
+++ b/winsup/mingw/include/stdio.h
@@ -173,7 +173,7 @@ typedef long long fpos_t;
typedef long fpos_t;
#endif
-#if defined __cplusplus
+#if defined (__cplusplus) && __HAVE_STD_CXX
namespace std
{
using ::FILE;
diff --git a/winsup/mingw/include/string.h b/winsup/mingw/include/string.h
new file mode 100644
index 00000000000..1d6e91656ce
--- /dev/null
+++ b/winsup/mingw/include/string.h
@@ -0,0 +1,204 @@
+/*
+ * string.h
+ *
+ * Definitions for memory and string functions.
+ *
+ * This file is part of the Mingw32 package.
+ *
+ * Contributors:
+ * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
+ *
+ * THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ * This source code is offered for use in the public domain. You may
+ * use, modify or distribute it freely.
+ *
+ * This code is distributed in the hope that it will be useful but
+ * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ * DISCLAIMED. This includes but is not limited to warranties of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $Revision$
+ * $Author$
+ * $Date$
+ *
+ */
+
+#ifndef _STRING_H_
+#define _STRING_H_
+
+/* All the headers include this file. */
+#include <_mingw.h>
+
+/*
+ * Define size_t, wchar_t and NULL
+ */
+#define __need_size_t
+#define __need_wchar_t
+#define __need_NULL
+#ifndef RC_INVOKED
+#include <stddef.h>
+#endif /* Not RC_INVOKED */
+
+#ifndef RC_INVOKED
+
+__BEGIN_CSTD_NAMESPACE
+/*
+ * Prototypes of the ANSI Standard C library string functions.
+ */
+void* memchr (const void*, int, size_t);
+int memcmp (const void*, const void*, size_t);
+void* memcpy (void*, const void*, size_t);
+void* memmove (void*, const void*, size_t);
+void* memset (void*, int, size_t);
+char* strcat (char*, const char*);
+char* strchr (const char*, int);
+int strcmp (const char*, const char*);
+int strcoll (const char*, const char*); /* Compare using locale */
+char* strcpy (char*, const char*);
+size_t strcspn (const char*, const char*);
+char* strerror (int); /* NOTE: NOT an old name wrapper. */
+
+size_t strlen (const char*);
+char* strncat (char*, const char*, size_t);
+int strncmp (const char*, const char*, size_t);
+char* strncpy (char*, const char*, size_t);
+char* strpbrk (const char*, const char*);
+char* strrchr (const char*, int);
+size_t strspn (const char*, const char*);
+char* strstr (const char*, const char*);
+char* strtok (char*, const char*);
+size_t strxfrm (char*, const char*, size_t);
+__END_CSTD_NAMESPACE
+
+#ifndef __STRICT_ANSI__
+__BEGIN_CGLOBAL_NAMESPACE
+/*
+ * Extra non-ANSI functions provided by the CRTDLL library
+ */
+char* _strerror (const char *);
+void* _memccpy (void*, const void*, int, size_t);
+int _memicmp (const void*, const void*, size_t);
+char* _strdup (const char*);
+int _strcmpi (const char*, const char*);
+int _stricmp (const char*, const char*);
+int _stricoll (const char*, const char*);
+char* _strlwr (char*);
+int _strnicmp (const char*, const char*, size_t);
+char* _strnset (char*, int, size_t);
+char* _strrev (char*);
+char* _strset (char*, int);
+char* _strupr (char*);
+void _swab (const char*, char*, size_t);
+
+#ifdef __MSVCRT__
+int _strncoll(const char*, const char*, size_t);
+int _strnicoll(const char*, const char*, size_t);
+#endif
+
+#ifndef _NO_OLDNAMES
+
+/*
+ * Non-underscored versions of non-ANSI functions. They live in liboldnames.a
+ * and provide a little extra portability. Also a few extra UNIX-isms like
+ * strcasecmp.
+ */
+
+void* memccpy (void*, const void*, int, size_t);
+int memicmp (const void*, const void*, size_t);
+char* strdup (const char*);
+int strcmpi (const char*, const char*);
+int stricmp (const char*, const char*);
+int strcasecmp (const char*, const char*);
+int stricoll (const char*, const char*);
+char* strlwr (char*);
+int strnicmp (const char*, const char*, size_t);
+int strncasecmp (const char*, const char*, size_t);
+char* strnset (char*, int, size_t);
+char* strrev (char*);
+char* strset (char*, int);
+char* strupr (char*);
+#ifndef _UWIN
+void swab (const char*, char*, size_t);
+#endif /* _UWIN */
+
+#endif /* Not _NO_OLDNAMES */
+
+__END_CGLOBAL_NAMESPACE
+
+#endif /* Not strict ANSI */
+
+
+#ifndef _WSTRING_DEFINED
+/*
+ * Unicode versions of the standard calls.
+ * Also in wchar.h, where they really belong.
+ */
+__BEGIN_CSTD_NAMESPACE
+wchar_t* wcscat (wchar_t*, const wchar_t*);
+wchar_t* wcschr (const wchar_t*, wchar_t);
+int wcscmp (const wchar_t*, const wchar_t*);
+int wcscoll (const wchar_t*, const wchar_t*);
+wchar_t* wcscpy (wchar_t*, const wchar_t*);
+size_t wcscspn (const wchar_t*, const wchar_t*);
+/* Note: No wcserror in CRTDLL. */
+size_t wcslen (const wchar_t*);
+wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
+int wcsncmp(const wchar_t*, const wchar_t*, size_t);
+wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
+wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
+wchar_t* wcsrchr(const wchar_t*, wchar_t);
+size_t wcsspn(const wchar_t*, const wchar_t*);
+wchar_t* wcsstr(const wchar_t*, const wchar_t*);
+wchar_t* wcstok(wchar_t*, const wchar_t*);
+size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+__END_CSTD_NAMESPACE
+
+#ifndef __STRICT_ANSI__
+__BEGIN_CGLOBAL_NAMESPACE
+/*
+ * Unicode versions of non-ANSI functions provided by CRTDLL.
+ */
+
+/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
+#define _wcscmpi _wcsicmp
+
+wchar_t* _wcsdup (const wchar_t*);
+int _wcsicmp (const wchar_t*, const wchar_t*);
+int _wcsicoll (const wchar_t*, const wchar_t*);
+wchar_t* _wcslwr (wchar_t*);
+int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
+wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
+wchar_t* _wcsrev (wchar_t*);
+wchar_t* _wcsset (wchar_t*, wchar_t);
+wchar_t* _wcsupr (wchar_t*);
+
+#ifdef __MSVCRT__
+int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
+int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
+#endif
+
+#ifndef __NO_OLDNAMES
+/* NOTE: There is no _wcscmpi, but this is for compatibility. */
+int wcscmpi (const wchar_t*, const wchar_t*);
+wchar_t* wcsdup (wchar_t*);
+int wcsicmp (const wchar_t*, const wchar_t*);
+int wcsicoll (const wchar_t*, const wchar_t*);
+wchar_t* wcslwr (wchar_t*);
+int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
+wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
+wchar_t* wcsrev (wchar_t*);
+wchar_t* wcsset (wchar_t*, wchar_t);
+wchar_t* wcsupr (wchar_t*);
+#endif /* Not _NO_OLDNAMES */
+
+__END_CGLOBAL_NAMESPACE
+
+#endif /* Not strict ANSI */
+#define _WSTRING_DEFINED
+#endif /* _WSTRING_DEFINED */
+
+#endif /* Not RC_INVOKED */
+
+#endif /* Not _STRING_H_ */
+
diff --git a/winsup/mingw/include/wchar.h b/winsup/mingw/include/wchar.h
index 01c584e88e0..fe27a07fe13 100644
--- a/winsup/mingw/include/wchar.h
+++ b/winsup/mingw/include/wchar.h
@@ -47,58 +47,6 @@
#ifndef RC_INVOKED
-__BEGIN_CGLOBAL_NAMESPACE
-
-#ifndef __STRICT_ANSI__
-
-#ifndef _FSIZE_T_DEFINED
-typedef unsigned long _fsize_t;
-#define _FSIZE_T_DEFINED
-#endif
-
-#ifndef _WFINDDATA_T_DEFINED
-struct _wfinddata_t {
- unsigned attrib;
- time_t time_create; /* -1 for FAT file systems */
- time_t time_access; /* -1 for FAT file systems */
- time_t time_write;
- _fsize_t size;
- wchar_t name[FILENAME_MAX]; /* may include spaces. */
-};
-struct _wfinddatai64_t {
- unsigned attrib;
- time_t time_create;
- time_t time_access;
- time_t time_write;
- __int64 size;
- wchar_t name[FILENAME_MAX];
-};
-#define _WFINDDATA_T_DEFINED
-#endif
-
-/* Wide character versions. Also defined in io.h. */
-/* CHECK: I believe these only exist in MSVCRT, and not in CRTDLL. Also
- applies to other wide character versions? */
-#if !defined (_WIO_DEFINED)
-#if defined (__MSVCRT__)
-int _waccess (const wchar_t*, int);
-int _wchmod (const wchar_t*, int);
-int _wcreat (const wchar_t*, int);
-long _wfindfirst (const wchar_t*, struct _wfinddata_t *);
-int _wfindnext (long, struct _wfinddata_t *);
-int _wunlink (const wchar_t*);
-int _wopen (const wchar_t*, int, ...);
-int _wsopen (const wchar_t*, int, int, ...);
-wchar_t* _wmktemp (wchar_t*);
-long _wfindfirsti64 (const wchar_t*, struct _wfinddatai64_t*);
-int _wfindnexti64 (long, struct _wfinddatai64_t*);
-#endif /* defined (__MSVCRT__) */
-#define _WIO_DEFINED
-#endif /* _WIO_DEFINED */
-#endif /* __STRICT_ANSI__ */
-
-__END_CGLOBAL_NAMESPACE
-
#ifndef _WSTDIO_DEFINED
__BEGIN_CSTD_NAMESPACE
/* also in stdio.h - keep in sync */
@@ -153,17 +101,146 @@ vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, __VALIST arg)
{ return _vsnwprintf ( s, n, format, arg);}
#endif
__END_CGLOBAL_NAMESPACE
+
#define _WSTDIO_DEFINED
#endif /* _WSTDIO_DEFINED */
+#ifndef _WSTRING_DEFINED
+/*
+ * Unicode versions of the standard calls.
+ * Also in stdio.h, since MSDN puts them in both headers well */
+ */
+__BEGIN_CSTD_NAMESPACE
+wchar_t* wcscat (wchar_t*, const wchar_t*);
+wchar_t* wcschr (const wchar_t*, wchar_t);
+int wcscmp (const wchar_t*, const wchar_t*);
+int wcscoll (const wchar_t*, const wchar_t*);
+wchar_t* wcscpy (wchar_t*, const wchar_t*);
+size_t wcscspn (const wchar_t*, const wchar_t*);
+/* Note: No wcserror in CRTDLL. */
+size_t wcslen (const wchar_t*);
+wchar_t* wcsncat (wchar_t*, const wchar_t*, size_t);
+int wcsncmp(const wchar_t*, const wchar_t*, size_t);
+wchar_t* wcsncpy(wchar_t*, const wchar_t*, size_t);
+wchar_t* wcspbrk(const wchar_t*, const wchar_t*);
+wchar_t* wcsrchr(const wchar_t*, wchar_t);
+size_t wcsspn(const wchar_t*, const wchar_t*);
+wchar_t* wcsstr(const wchar_t*, const wchar_t*);
+wchar_t* wcstok(wchar_t*, const wchar_t*);
+size_t wcsxfrm(wchar_t*, const wchar_t*, size_t);
+__END_CSTD_NAMESPACE
+#ifndef __STRICT_ANSI__
__BEGIN_CGLOBAL_NAMESPACE
+/*
+ * Unicode versions of non-ANSI functions provided by CRTDLL.
+ */
+
+/* NOTE: _wcscmpi not provided by CRTDLL, this define is for portability */
+#define _wcscmpi _wcsicmp
+
+wchar_t* _wcsdup (const wchar_t*);
+int _wcsicmp (const wchar_t*, const wchar_t*);
+int _wcsicoll (const wchar_t*, const wchar_t*);
+wchar_t* _wcslwr (wchar_t*);
+int _wcsnicmp (const wchar_t*, const wchar_t*, size_t);
+wchar_t* _wcsnset (wchar_t*, wchar_t, size_t);
+wchar_t* _wcsrev (wchar_t*);
+wchar_t* _wcsset (wchar_t*, wchar_t);
+wchar_t* _wcsupr (wchar_t*);
+
+#ifdef __MSVCRT__
+int _wcsncoll(const wchar_t*, const wchar_t*, size_t);
+int _wcsnicoll(const wchar_t*, const wchar_t*, size_t);
+#endif
+
+#ifndef __NO_OLDNAMES
+/* NOTE: There is no _wcscmpi, but this is for compatibility. */
+int wcscmpi (const wchar_t*, const wchar_t*);
+wchar_t* wcsdup (wchar_t*);
+int wcsicmp (const wchar_t*, const wchar_t*);
+int wcsicoll (const wchar_t*, const wchar_t*);
+wchar_t* wcslwr (wchar_t*);
+int wcsnicmp (const wchar_t*, const wchar_t*, size_t);
+wchar_t* wcsnset (wchar_t*, wchar_t, size_t);
+wchar_t* wcsrev (wchar_t*);
+wchar_t* wcsset (wchar_t*, wchar_t);
+wchar_t* wcsupr (wchar_t*);
+#endif /* Not _NO_OLDNAMES */
+
+__END_CGLOBAL_NAMESPACE
+#endif /* Not strict ANSI */
+
+#define _WSTRING_DEFINED
+#endif /* _WSTRING_DEFINED */
+
#ifndef __STRICT_ANSI__
+__BEGIN_CGLOBAL_NAMESPACE
/*
- * wide char functions from direct.h, sys/stat.h and
- * locale.h
+ * non_ANSI wide char functions from io.h, direct.h, sys/stat.h
+ * and locale.h
*/
+#ifndef _FSIZE_T_DEFINED
+typedef unsigned long _fsize_t;
+#define _FSIZE_T_DEFINED
+#endif
+
+#ifndef _WFINDDATA_T_DEFINED
+struct _wfinddata_t {
+ unsigned attrib;
+ time_t time_create; /* -1 for FAT file systems */
+ time_t time_access; /* -1 for FAT file systems */
+ time_t time_write;
+ _fsize_t size;
+ wchar_t name[FILENAME_MAX]; /* may include spaces. */
+};
+struct _wfinddatai64_t {
+ unsigned attrib;
+ time_t time_create;
+ time_t time_access;
+ time_t time_write;
+ __int64 size;
+ wchar_t name[FILENAME_MAX];
+};
+#define _WFINDDATA_T_DEFINED
+#endif
+
+#if !defined (_WIO_DEFINED)
+/* Wide character versions from io.h */
+#if defined (__MSVCRT__)
+int _waccess(const wchar_t*, int);
+int _wchmod(const wchar_t*, int);
+int _wcreat(const wchar_t*, int);
+long _wfindfirst(const wchar_t*, struct _wfinddata_t*);
+int _wfindnext(long, struct _wfinddata_t *);
+int _wunlink(const wchar_t*);
+int _wopen(const wchar_t*, int, ...);
+int _wsopen(const wchar_t*, int, int, ...);
+wchar_t * _wmktemp(wchar_t*);
+long _wfindfirsti64(const wchar_t*, struct _wfinddatai64_t*);
+int _wfindnexti64(long, struct _wfinddatai64_t*);
+
+#ifndef __NO_OLDNAMES
+/* Where do these live? Not in libmoldname.a nor in libmsvcrt.a */
+#if 0
+int waccess(const wchar_t *, int);
+int wchmod(const wchar_t *, int);
+int wcreat(const wchar_t *, int);
+long wfindfirst(wchar_t *, struct _wfinddata_t *);
+int wfindnext(long, struct _wfinddata_t *);
+int wunlink(const wchar_t *);
+int wrename(const wchar_t *, const wchar_t *);
+int wopen(const wchar_t *, int, ...);
+int wsopen(const wchar_t *, int, int, ...);
+wchar_t * wmktemp(wchar_t *);
+#endif
+#endif
+#endif /* defined (__MSVCRT__) */
+
+#define _WIO_DEFINED
+#endif /* _WIO_DEFINED */
+
#ifndef _WDIRECT_DEFINED
/* Also in direct.h */
#ifdef __MSVCRT__
@@ -247,9 +324,9 @@ int _wstati64 (const wchar_t*, struct _stati64*);
wchar_t* _wsetlocale (int, const wchar_t*);
#define _WLOCALE_DEFINED
#endif
+__END_CGLOBAL_NAMESPACE
#endif /* __STRICT_ANSI__ */
-__END_CGLOBAL_NAMESPACE
#ifndef _WTIME_DEFINED
__BEGIN_CGLOBAL_NAMESPACE
@@ -282,29 +359,6 @@ __END_CSTD_NAMESPACE
#define _WSTDLIB_DEFINED
#endif
-__BEGIN_CGLOBAL_NAMESPACE
-#ifndef __STRICT_ANSI__
-#ifndef _NO_OLDNAMES
-
-/* Wide character versions. Also declared in io.h. */
-/* CHECK: Are these in the oldnames??? NO! */
-#if (0)
-int waccess (const wchar_t *, int);
-int wchmod (const wchar_t *, int);
-int wcreat (const wchar_t *, int);
-long wfindfirst (wchar_t *, struct _wfinddata_t *);
-int wfindnext (long, struct _wfinddata_t *);
-int wunlink (const wchar_t *);
-int wrename (const wchar_t *, const wchar_t *);
-int wremove (const wchar_t *);
-int wopen (const wchar_t *, int, ...);
-int wsopen (const wchar_t *, int, int, ...);
-wchar_t* wmktemp (wchar_t *);
-#endif
-#endif /* _NO_OLDNAMES */
-#endif /* not __STRICT_ANSI__ */
-
-__END_CGLOBAL_NAMESPACE
__BEGIN_CSTD_NAMESPACE
/* These are resolved by -lmsvcp60 */