[1/2] include: Add more string types.
Francois Gouget
fgouget at free.fr
Mon Sep 24 09:33:08 CDT 2012
---
They are mostly annotated variations on the standard types to indicate
whether the string is supposed to be aligned or not, nul terminated or
not, etc. We don't care right now but I think it could be useful in the
future. If not for special architectures (ARM?), at least for automated
checkers.
include/winnt.h | 46 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 39 insertions(+), 7 deletions(-)
diff --git a/include/winnt.h b/include/winnt.h
index 7588a7d..c474db0 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -449,6 +449,11 @@ typedef wchar_t WCHAR, *PWCHAR;
typedef unsigned short WCHAR, *PWCHAR;
#endif
+typedef ULONG UCSCHAR;
+#define MIN_UCSCHAR (0)
+#define MAX_UCSCHAR (0x0010ffff)
+#define UCSCHAR_INVALID_CHARACTER (0xffffffff)
+
/* 'Extended/Wide' numerical types */
#ifndef _ULONGLONG_
# define _ULONGLONG_
@@ -471,7 +476,8 @@ typedef ULONGLONG DECLSPEC_ALIGN(8) DWORDLONG, *PDWORDLONG;
#endif
/* ANSI string types */
-typedef CHAR *PCH, *LPCH;
+typedef CHAR *PCH, *LPCH, *PNZCH;
+typedef const CHAR *PCCH, *LPCCH, *PCNZCH;
typedef const CHAR *PCCH, *LPCCH;
typedef CHAR *PSTR, *LPSTR, *NPSTR;
typedef const CHAR *PCSTR, *LPCSTR;
@@ -479,12 +485,18 @@ typedef CHAR *PZZSTR;
typedef const CHAR *PCZZSTR;
/* Unicode string types */
+typedef WCHAR *PWCHAR;
+typedef const WCHAR *PCWCHAR, *LPCUWCHAR, *PCUWCHAR;
typedef WCHAR *PWCH, *LPWCH;
typedef const WCHAR *PCWCH, *LPCWCH;
+typedef WCHAR *PNZWCH, *PUNZWCH;
+typedef const WCHAR *PCNZWCH, *PCUNZWCH;
typedef WCHAR *PWSTR, *LPWSTR, *NWPSTR;
typedef const WCHAR *PCWSTR, *LPCWSTR;
-typedef WCHAR *PZZWSTR;
-typedef const WCHAR *PCZZWSTR;
+typedef WCHAR *PZZWSTR, *PUZZWSTR;
+typedef const WCHAR *PCZZWSTR, *PCUZZWSTR;
+typedef PWSTR *PZPWSTR;
+typedef PCWSTR *PZPCWSTR;
/* Neutral character and string types */
/* These are only defined for Winelib, i.e. _not_ defined for
@@ -497,22 +509,42 @@ typedef const WCHAR *PCZZWSTR;
typedef WCHAR TCHAR, *PTCHAR;
# define _TCHAR_DEFINED
#endif
+typedef LPWCH PTCH, LPTCH;
+typedef LPCWCH PCTCH, LPCTCH;
typedef LPWSTR PTSTR, LPTSTR;
typedef LPCWSTR PCTSTR, LPCTSTR;
-typedef PZZSTR PZZTSTR;
-typedef PCZZSTR PCZZTSTR;
+typedef LPWSTR PUTSTR, LPUTSTR;
+typedef LPCWSTR PCUTSTR, LPCUTSTR;
+typedef PNZWCH PNZTCH;
+typedef PUNZWCH PUNZTCH;
+typedef PCNZWCH PCNZTCH;
+typedef PCUNZWCH PCUNZTCH;
+typedef PZZWSTR PZZTSTR;
+typedef PCZZWSTR PCZZTSTR;
+typedef PUZZWSTR PUZZTSTR;
+typedef PUCZZWSTR PCUZZTSTR;
# else /* UNICODE */
# ifndef _TCHAR_DEFINED
typedef CHAR TCHAR, *PTCHAR;
# define _TCHAR_DEFINED
# endif
+typedef LPCH PTCH, LPTCH;
+typedef LPCCH PCTCH, LPCTCH;
typedef LPSTR PTSTR, LPTSTR;
typedef LPCSTR PCTSTR, LPCTSTR;
-typedef PZZWSTR PZZTSTR;
-typedef PCZZWSTR PCZZTSTR;
+typedef PNZCH PNZTCH, PUNZTCH;
+typedef PCNZCH PCNZTCH, PCUNZTCH;
+typedef PZZSTR PZZTSTR, PUZZTSTR;
+typedef PCZZSTR PCZZTSTR, PCUZZTSTR;
# endif /* UNICODE */
#endif /* WINE_NO_UNICODE_MACROS */
+/* UCS string types */
+typedef UCSCHAR *PUCSCHAR, *PUUCSCHAR;
+typedef const UCSCHAR *PCUCSCHAR, *PCUUCSCHAR;
+typedef UCSCHAR *PUCSSTR, *PUUCSSTR;
+typedef const UCSCHAR *PCUCSSTR, *PCUUCSSTR;
+
/* Misc common WIN32 types */
typedef char CCHAR;
typedef DWORD LCID, *PLCID;
--
1.7.10.4
More information about the wine-patches
mailing list