include: Add the msvcrt/crtdefs.h header and include it where needed.
[wine/wine64.git] / include / msvcrt / string.h
blob0a9a7a2b83ad93ebcee088e719d1dbf123178327
1 /*
2 * String definitions
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
11 #include <crtdefs.h>
13 #ifndef _NLSCMP_DEFINED
14 #define _NLSCMPERROR ((unsigned int)0x7fffffff)
15 #define _NLSCMP_DEFINED
16 #endif
18 #ifndef NULL
19 #ifdef __cplusplus
20 #define NULL 0
21 #else
22 #define NULL ((void *)0)
23 #endif
24 #endif
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
30 #ifndef _CRT_MEMORY_DEFINED
31 #define _CRT_MEMORY_DEFINED
32 void* memchr(const void*,int,size_t);
33 int memcmp(const void*,const void*,size_t);
34 void* memcpy(void*,const void*,size_t);
35 void* memset(void*,int,size_t);
36 void* _memccpy(void*,const void*,int,unsigned int);
37 int _memicmp(const void*,const void*,unsigned int);
39 static inline int memicmp(const void* s1, const void* s2, size_t len) { return _memicmp(s1, s2, len); }
40 static inline void* memccpy(void *s1, const void *s2, int c, size_t n) { return _memccpy(s1, s2, c, n); }
41 #endif /* _CRT_MEMORY_DEFINED */
43 int _strcmpi(const char*,const char*);
44 char* _strdup(const char*);
45 char* _strerror(const char*);
46 int _stricmp(const char*,const char*);
47 int _stricoll(const char*,const char*);
48 char* _strlwr(char*);
49 int _strnicmp(const char*,const char*,size_t);
50 char* _strnset(char*,int,size_t);
51 char* _strrev(char*);
52 char* _strset(char*,int);
53 char* _strupr(char*);
55 void* memmove(void*,const void*,size_t);
56 char* strcat(char*,const char*);
57 char* strchr(const char*,int);
58 int strcmp(const char*,const char*);
59 int strcoll(const char*,const char*);
60 char* strcpy(char*,const char*);
61 size_t strcspn(const char*,const char*);
62 char* strerror(int);
63 size_t strlen(const char*);
64 char* strncat(char*,const char*,size_t);
65 int strncmp(const char*,const char*,size_t);
66 char* strncpy(char*,const char*,size_t);
67 char* strpbrk(const char*,const char*);
68 char* strrchr(const char*,int);
69 size_t strspn(const char*,const char*);
70 char* strstr(const char*,const char*);
71 char* strtok(char*,const char*);
72 size_t strxfrm(char*,const char*,size_t);
74 #ifndef _WSTRING_DEFINED
75 #define _WSTRING_DEFINED
76 wchar_t*_wcsdup(const wchar_t*);
77 int _wcsicmp(const wchar_t*,const wchar_t*);
78 int _wcsicoll(const wchar_t*,const wchar_t*);
79 wchar_t*_wcslwr(wchar_t*);
80 int _wcsnicmp(const wchar_t*,const wchar_t*,size_t);
81 wchar_t*_wcsnset(wchar_t*,wchar_t,size_t);
82 wchar_t*_wcsrev(wchar_t*);
83 wchar_t*_wcsset(wchar_t*,wchar_t);
84 wchar_t*_wcsupr(wchar_t*);
86 wchar_t*wcscat(wchar_t*,const wchar_t*);
87 wchar_t*wcschr(const wchar_t*,wchar_t);
88 int wcscmp(const wchar_t*,const wchar_t*);
89 int wcscoll(const wchar_t*,const wchar_t*);
90 wchar_t*wcscpy(wchar_t*,const wchar_t*);
91 size_t wcscspn(const wchar_t*,const wchar_t*);
92 size_t wcslen(const wchar_t*);
93 wchar_t*wcsncat(wchar_t*,const wchar_t*,size_t);
94 int wcsncmp(const wchar_t*,const wchar_t*,size_t);
95 wchar_t*wcsncpy(wchar_t*,const wchar_t*,size_t);
96 wchar_t*wcspbrk(const wchar_t*,const wchar_t*);
97 wchar_t*wcsrchr(const wchar_t*,wchar_t wcFor);
98 size_t wcsspn(const wchar_t*,const wchar_t*);
99 wchar_t*wcsstr(const wchar_t*,const wchar_t*);
100 wchar_t*wcstok(wchar_t*,const wchar_t*);
101 size_t wcsxfrm(wchar_t*,const wchar_t*,size_t);
102 #endif /* _WSTRING_DEFINED */
104 #ifdef __cplusplus
106 #endif
109 static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
110 static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
111 static inline char* strdup(const char* buf) { return _strdup(buf); }
112 static inline int stricmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
113 static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
114 static inline char* strlwr(char* str) { return _strlwr(str); }
115 static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
116 static inline int strnicmp(const char* s1, const char* s2, size_t n) { return _strnicmp(s1, s2, n); }
117 static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
118 static inline char* strrev(char* str) { return _strrev(str); }
119 static inline char* strset(char* str, int value) { return _strset(str, value); }
120 static inline char* strupr(char* str) { return _strupr(str); }
122 static inline wchar_t* wcsdup(const wchar_t* str) { return _wcsdup(str); }
123 static inline int wcsicoll(const wchar_t* str1, const wchar_t* str2) { return _wcsicoll(str1, str2); }
124 static inline wchar_t* wcslwr(wchar_t* str) { return _wcslwr(str); }
125 static inline int wcsnicmp(const wchar_t* str1, const wchar_t* str2, size_t n) { return _wcsnicmp(str1, str2, n); }
126 static inline wchar_t* wcsnset(wchar_t* str, wchar_t c, size_t n) { return _wcsnset(str, c, n); }
127 static inline wchar_t* wcsrev(wchar_t* str) { return _wcsrev(str); }
128 static inline wchar_t* wcsset(wchar_t* str, wchar_t c) { return _wcsset(str, c); }
129 static inline wchar_t* wcsupr(wchar_t* str) { return _wcsupr(str); }
131 #endif /* __WINE_STRING_H */