Sync with trunk r43123
[reactos.git] / reactos / include / crt / string.h
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER within this package.
5 */
6 #ifndef _INC_STRING
7 #define _INC_STRING
8
9 #include <crtdefs.h>
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #ifndef _NLSCMP_DEFINED
16 #define _NLSCMP_DEFINED
17 #define _NLSCMPERROR 2147483647
18 #endif
19
20 #ifndef NULL
21 #ifdef __cplusplus
22 #define NULL 0
23 #else
24 #define NULL ((void *)0)
25 #endif
26 #endif
27
28 #ifndef _CRT_MEMORY_DEFINED
29 #define _CRT_MEMORY_DEFINED
30 _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);
31 _CRTIMP _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount);
32 _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
33 _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale);
34 int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size);
35 _CRT_INSECURE_DEPRECATE_MEMORY(memcpy_s) void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size);
36 void *__cdecl memset(void *_Dst,int _Val,size_t _Size);
37 #ifndef NO_OLDNAMES
38 _CRTIMP _CRT_NONSTDC_DEPRECATE(_memccpy) void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size);
39 _CRTIMP _CRT_NONSTDC_DEPRECATE(_memicmp) int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
40 #endif
41 #endif
42
43 char *__cdecl _strset(char *_Str,int _Val);
44 char *__cdecl strcpy(char *_Dest,const char *_Source);
45 char *__cdecl strcat(char *_Dest,const char *_Source);
46 int __cdecl strcmp(const char *_Str1,const char *_Str2);
47 size_t __cdecl strlen(const char *_Str);
48 _CRTIMP size_t __cdecl strnlen(const char *_Str,size_t _MaxCount);
49
50 _CRT_INSECURE_DEPRECATE_MEMORY(memmove_s) void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size);
51 _CRTIMP char *__cdecl _strdup(const char *_Src);
52 _CRTIMP _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val);
53 _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2);
54 _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2);
55 _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
56 _CRTIMP int __cdecl strcoll(const char *_Str1,const char *_Str2);
57 _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
58 _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2);
59 _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
60 _CRTIMP int __cdecl _strncoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
61 _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
62 _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
63 _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
64 _CRTIMP size_t __cdecl strcspn(const char *_Str,const char *_Control);
65 _CRTIMP _CRT_INSECURE_DEPRECATE(_strerror_s) char *__cdecl _strerror(const char *_ErrMsg);
66 _CRTIMP _CRT_INSECURE_DEPRECATE(strerror_s) char *__cdecl strerror(int);
67 _CRTIMP char *__cdecl _strlwr(char *_String);
68 char *strlwr_l(char *_String,_locale_t _Locale);
69 char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count);
70 int __cdecl strncmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
71 _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
72 _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
73 char *strncpy(char *_Dest,const char *_Source,size_t _Count);
74 _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_strnset_s) char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount);
75 _CRTIMP _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);
76 _CRTIMP _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch);
77 _CRTIMP char *__cdecl _strrev(char *_Str);
78 _CRTIMP size_t __cdecl strspn(const char *_Str,const char *_Control);
79 _CRTIMP _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr);
80 _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(strtok_s) char *__cdecl strtok(char *_Str,const char *_Delim);
81 _CRTIMP char *__cdecl _strupr(char *_String);
82 _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale);
83 _CRTIMP size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount);
84 _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
85
86 #ifndef NO_OLDNAMES
87 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strdup) char *__cdecl strdup(const char *_Src);
88 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strcmpi) int __cdecl strcmpi(const char *_Str1,const char *_Str2);
89 _CRTIMP _CRT_NONSTDC_DEPRECATE(_stricmp) int __cdecl stricmp(const char *_Str1,const char *_Str2);
90 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strlwr) char *__cdecl strlwr(char *_Str);
91 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strnicmp) int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount);
92 // __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); }
93 // __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); }
94 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strnset) char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount);
95 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strrev) char *__cdecl strrev(char *_Str);
96 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strset) char *__cdecl strset(char *_Str,int _Val);
97 _CRTIMP _CRT_NONSTDC_DEPRECATE(_strupr) char *__cdecl strupr(char *_Str);
98 #endif
99
100 #ifndef _WSTRING_DEFINED
101 #define _WSTRING_DEFINED
102
103 _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
104 _CRTIMP wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
105 _CRTIMP _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
106 _CRTIMP int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
107 _CRTIMP wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
108 _CRTIMP size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
109 _CRTIMP size_t __cdecl wcslen(const wchar_t *_Str);
110 _CRTIMP size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
111 _CRTIMP wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
112 _CRTIMP int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
113 _CRTIMP wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
114 _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
115 _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
116 _CRTIMP size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
117 _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
118 _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(wcstok_s) wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
119 _CRTIMP _CRT_INSECURE_DEPRECATE(_wcserror_s) wchar_t *__cdecl _wcserror(int _ErrNum);
120 _CRTIMP _CRT_INSECURE_DEPRECATE(__wcserror_s) wchar_t *__cdecl __wcserror(const wchar_t *_Str);
121 _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
122 _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
123 _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
124 _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
125 _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_wcsnset_s) wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
126 _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
127 _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_wcsset_s) wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
128 _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
129 _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
130 _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
131 _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
132 _CRTIMP size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
133 _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
134 _CRTIMP int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
135 _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
136 _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
137 _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
138 _CRTIMP int __cdecl _wcsncoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
139 _CRTIMP int __cdecl _wcsncoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
140 _CRTIMP int __cdecl _wcsnicoll(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
141 _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
142
143 #ifndef NO_OLDNAMES
144 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsdup) wchar_t *__cdecl wcsdup(const wchar_t *_Str);
145 #define wcswcs wcsstr
146 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsicmp) int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
147 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsnicmp) int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
148 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsnset) wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
149 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsrev) wchar_t *__cdecl wcsrev(wchar_t *_Str);
150 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsset) wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
151 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcslwr) wchar_t *__cdecl wcslwr(wchar_t *_Str);
152 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsupr) wchar_t *__cdecl wcsupr(wchar_t *_Str);
153 _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsicoll) int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
154 #endif
155
156 #endif /* !_WSTRING_DEFINED */
157
158 #ifdef __cplusplus
159 }
160 #endif
161
162 #include <sec_api/string_s.h>
163
164 // HACK
165 #define strcasecmp _stricmp
166 #define strncasecmp _strnicmp
167 #define stricmp _stricmp
168 #define wcsicmp _wcsicmp
169
170 #endif