user32: Moved win.h to the user32 directory.
[wine] / include / msvcrt / string.h
1 /*
2  * String definitions
3  *
4  * Derived from the mingw header written by Colin Peters.
5  * Modified for Wine use by Jon Griffiths and Francois Gouget.
6  * This file is in the public domain.
7  */
8 #ifndef __WINE_STRING_H
9 #define __WINE_STRING_H
10 #ifndef __WINE_USE_MSVCRT
11 #define __WINE_USE_MSVCRT
12 #endif
13
14 #ifndef _WCHAR_T_DEFINED
15 #define _WCHAR_T_DEFINED
16 #ifndef __cplusplus
17 typedef unsigned short wchar_t;
18 #endif
19 #endif
20
21 #if defined(__x86_64__) && !defined(_WIN64)
22 #define _WIN64
23 #endif
24
25 #if !defined(_MSC_VER) && !defined(__int64)
26 # ifdef _WIN64
27 #   define __int64 long
28 # else
29 #   define __int64 long long
30 # endif
31 #endif
32
33 #ifndef _SIZE_T_DEFINED
34 #ifdef _WIN64
35 typedef unsigned __int64 size_t;
36 #else
37 typedef unsigned int size_t;
38 #endif
39 #define _SIZE_T_DEFINED
40 #endif
41
42 #ifndef _NLSCMP_DEFINED
43 #define _NLSCMPERROR               ((unsigned int)0x7fffffff)
44 #define _NLSCMP_DEFINED
45 #endif
46
47 #ifndef NULL
48 #ifdef __cplusplus
49 #define NULL  0
50 #else
51 #define NULL  ((void *)0)
52 #endif
53 #endif
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59 void*       _memccpy(void*,const void*,int,unsigned int);
60 int         _memicmp(const void*,const void*,unsigned int);
61 int         _strcmpi(const char*,const char*);
62 char*       _strdup(const char*);
63 char*       _strerror(const char*);
64 int         _stricmp(const char*,const char*);
65 int         _stricoll(const char*,const char*);
66 char*       _strlwr(char*);
67 int         _strnicmp(const char*,const char*,size_t);
68 char*       _strnset(char*,int,size_t);
69 char*       _strrev(char*);
70 char*       _strset(char*,int);
71 char*       _strupr(char*);
72
73 void*       memchr(const void*,int,size_t);
74 int         memcmp(const void*,const void*,size_t);
75 void*       memcpy(void*,const void*,size_t);
76 void*       memmove(void*,const void*,size_t);
77 void*       memset(void*,int,size_t);
78 char*       strcat(char*,const char*);
79 char*       strchr(const char*,int);
80 int         strcmp(const char*,const char*);
81 int         strcoll(const char*,const char*);
82 char*       strcpy(char*,const char*);
83 size_t strcspn(const char*,const char*);
84 char*       strerror(int);
85 size_t strlen(const char*);
86 char*       strncat(char*,const char*,size_t);
87 int         strncmp(const char*,const char*,size_t);
88 char*       strncpy(char*,const char*,size_t);
89 char*       strpbrk(const char*,const char*);
90 char*       strrchr(const char*,int);
91 size_t strspn(const char*,const char*);
92 char*       strstr(const char*,const char*);
93 char*       strtok(char*,const char*);
94 size_t strxfrm(char*,const char*,size_t);
95
96 #ifndef _WSTRING_DEFINED
97 #define _WSTRING_DEFINED
98 wchar_t*_wcsdup(const wchar_t*);
99 int             _wcsicmp(const wchar_t*,const wchar_t*);
100 int             _wcsicoll(const wchar_t*,const wchar_t*);
101 wchar_t*_wcslwr(wchar_t*);
102 int             _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
103 wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
104 wchar_t*_wcsrev(wchar_t*);
105 wchar_t*_wcsset(wchar_t*,wchar_t);
106 wchar_t*_wcsupr(wchar_t*);
107
108 wchar_t*wcscat(wchar_t*,const wchar_t*);
109 wchar_t*wcschr(const wchar_t*,wchar_t);
110 int             wcscmp(const wchar_t*,const wchar_t*);
111 int             wcscoll(const wchar_t*,const wchar_t*);
112 wchar_t*wcscpy(wchar_t*,const wchar_t*);
113 size_t  wcscspn(const wchar_t*,const wchar_t*);
114 size_t  wcslen(const wchar_t*);
115 wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
116 int             wcsncmp(const wchar_t*,const wchar_t*,size_t);
117 wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
118 wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
119 wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
120 size_t  wcsspn(const wchar_t*,const wchar_t*);
121 wchar_t*wcsstr(const wchar_t*,const wchar_t*);
122 wchar_t*wcstok(wchar_t*,const wchar_t*);
123 size_t  wcsxfrm(wchar_t*,const wchar_t*,size_t);
124 #endif /* _WSTRING_DEFINED */
125
126 #ifdef __cplusplus
127 }
128 #endif
129
130
131 static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
132 static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); }
133 static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
134 static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
135 static inline char* strdup(const char* buf) { return _strdup(buf); }
136 static inline int stricmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
137 static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
138 static inline char* strlwr(char* str) { return _strlwr(str); }
139 static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
140 static inline int strnicmp(const char* s1, const char* s2, size_t n) { return _strnicmp(s1, s2, n); }
141 static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
142 static inline char* strrev(char* str) { return _strrev(str); }
143 static inline char* strset(char* str, int value) { return _strset(str, value); }
144 static inline char* strupr(char* str) { return _strupr(str); }
145
146 static inline wchar_t* wcsdup(const wchar_t* str) { return _wcsdup(str); }
147 static inline int wcsicoll(const wchar_t* str1, const wchar_t* str2) { return _wcsicoll(str1, str2); }
148 static inline wchar_t* wcslwr(wchar_t* str) { return _wcslwr(str); }
149 static inline int wcsnicmp(const wchar_t* str1, const wchar_t* str2, size_t n) { return _wcsnicmp(str1, str2, n); }
150 static inline wchar_t* wcsnset(wchar_t* str, wchar_t c, size_t n) { return _wcsnset(str, c, n); }
151 static inline wchar_t* wcsrev(wchar_t* str) { return _wcsrev(str); }
152 static inline wchar_t* wcsset(wchar_t* str, wchar_t c) { return _wcsset(str, c); }
153 static inline wchar_t* wcsupr(wchar_t* str) { return _wcsupr(str); }
154
155 #endif /* __WINE_STRING_H */