Converted oleidl.h to IDL.
[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 MSVCRT
15 # ifdef USE_MSVCRT_PREFIX
16 #  define MSVCRT(x)    MSVCRT_##x
17 # else
18 #  define MSVCRT(x)    x
19 # endif
20 #endif
21
22 #ifndef MSVCRT_WCHAR_T_DEFINED
23 #define MSVCRT_WCHAR_T_DEFINED
24 #ifndef __cplusplus
25 typedef unsigned short MSVCRT(wchar_t);
26 #endif
27 #endif
28
29 #ifndef MSVCRT_SIZE_T_DEFINED
30 typedef unsigned int MSVCRT(size_t);
31 #define MSVCRT_SIZE_T_DEFINED
32 #endif
33
34 #ifndef MSVCRT_NLSCMP_DEFINED
35 #define _NLSCMPERROR               ((unsigned int)0x7fffffff)
36 #define MSVCRT_NLSCMP_DEFINED
37 #endif
38
39 #ifndef NULL
40 #ifdef __cplusplus
41 #define NULL  0
42 #else
43 #define NULL  ((void *)0)
44 #endif
45 #endif
46
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50
51 void*       _memccpy(void*,const void*,int,MSVCRT(size_t));
52 int         _memicmp(const void*,const void*,MSVCRT(size_t));
53 int         _strcmpi(const char*,const char*);
54 char*       _strdup(const char*);
55 char*       _strerror(const char*);
56 int         _stricmp(const char*,const char*);
57 int         _stricoll(const char*,const char*);
58 char*       _strlwr(char*);
59 int         _strnicmp(const char*,const char*,MSVCRT(size_t));
60 char*       _strnset(char*,int,MSVCRT(size_t));
61 char*       _strrev(char*);
62 char*       _strset(char*,int);
63 char*       _strupr(char*);
64
65 void*       MSVCRT(memchr)(const void*,int,MSVCRT(size_t));
66 int         MSVCRT(memcmp)(const void*,const void*,MSVCRT(size_t));
67 void*       MSVCRT(memcpy)(void*,const void*,MSVCRT(size_t));
68 void*       MSVCRT(memmove)(void*,const void*,MSVCRT(size_t));
69 void*       MSVCRT(memset)(void*,int,MSVCRT(size_t));
70 char*       MSVCRT(strcat)(char*,const char*);
71 char*       MSVCRT(strchr)(const char*,int);
72 int         MSVCRT(strcmp)(const char*,const char*);
73 int         MSVCRT(strcoll)(const char*,const char*);
74 char*       MSVCRT(strcpy)(char*,const char*);
75 MSVCRT(size_t) MSVCRT(strcspn)(const char*,const char*);
76 char*       MSVCRT(strerror)(int);
77 MSVCRT(size_t) MSVCRT(strlen)(const char*);
78 char*       MSVCRT(strncat)(char*,const char*,MSVCRT(size_t));
79 int         MSVCRT(strncmp)(const char*,const char*,MSVCRT(size_t));
80 char*       MSVCRT(strncpy)(char*,const char*,MSVCRT(size_t));
81 char*       MSVCRT(strpbrk)(const char*,const char*);
82 char*       MSVCRT(strrchr)(const char*,int);
83 MSVCRT(size_t) MSVCRT(strspn)(const char*,const char*);
84 char*       MSVCRT(strstr)(const char*,const char*);
85 char*       MSVCRT(strtok)(char*,const char*);
86 MSVCRT(size_t) MSVCRT(strxfrm)(char*,const char*,MSVCRT(size_t));
87
88 #ifndef MSVCRT_WSTRING_DEFINED
89 #define MSVCRT_WSTRING_DEFINED
90 MSVCRT(wchar_t)*_wcsdup(const MSVCRT(wchar_t)*);
91 int             _wcsicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
92 int             _wcsicoll(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
93 MSVCRT(wchar_t)*_wcslwr(MSVCRT(wchar_t)*);
94 int             _wcsnicmp(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
95 MSVCRT(wchar_t)*_wcsnset(MSVCRT(wchar_t)*,MSVCRT(wchar_t),MSVCRT(size_t));
96 MSVCRT(wchar_t)*_wcsrev(MSVCRT(wchar_t)*);
97 MSVCRT(wchar_t)*_wcsset(MSVCRT(wchar_t)*,MSVCRT(wchar_t));
98 MSVCRT(wchar_t)*_wcsupr(MSVCRT(wchar_t)*);
99
100 MSVCRT(wchar_t)*MSVCRT(wcscat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
101 MSVCRT(wchar_t)*MSVCRT(wcschr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t));
102 int             MSVCRT(wcscmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
103 int             MSVCRT(wcscoll)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
104 MSVCRT(wchar_t)*MSVCRT(wcscpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
105 MSVCRT(size_t)  MSVCRT(wcscspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
106 MSVCRT(size_t)  MSVCRT(wcslen)(const MSVCRT(wchar_t)*);
107 MSVCRT(wchar_t)*MSVCRT(wcsncat)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
108 int             MSVCRT(wcsncmp)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
109 MSVCRT(wchar_t)*MSVCRT(wcsncpy)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
110 MSVCRT(wchar_t)*MSVCRT(wcspbrk)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
111 MSVCRT(wchar_t)*MSVCRT(wcsrchr)(const MSVCRT(wchar_t)*,MSVCRT(wchar_t) wcFor);
112 MSVCRT(size_t)  MSVCRT(wcsspn)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
113 MSVCRT(wchar_t)*MSVCRT(wcsstr)(const MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
114 MSVCRT(wchar_t)*MSVCRT(wcstok)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*);
115 MSVCRT(size_t)  MSVCRT(wcsxfrm)(MSVCRT(wchar_t)*,const MSVCRT(wchar_t)*,MSVCRT(size_t));
116 #endif /* MSVCRT_WSTRING_DEFINED */
117
118 #ifdef __cplusplus
119 }
120 #endif
121
122
123 #ifndef USE_MSVCRT_PREFIX
124 static inline void* memccpy(void *s1, const void *s2, int c, MSVCRT(size_t) n) { return _memccpy(s1, s2, c, n); }
125 static inline int memicmp(const void* s1, const void* s2, MSVCRT(size_t) len) { return _memicmp(s1, s2, len); }
126 static inline int strcasecmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
127 static inline int strcmpi(const char* s1, const char* s2) { return _strcmpi(s1, s2); }
128 static inline char* strdup(const char* buf) { return _strdup(buf); }
129 static inline int stricmp(const char* s1, const char* s2) { return _stricmp(s1, s2); }
130 static inline int stricoll(const char* s1, const char* s2) { return _stricoll(s1, s2); }
131 static inline char* strlwr(char* str) { return _strlwr(str); }
132 static inline int strncasecmp(const char *str1, const char *str2, size_t n) { return _strnicmp(str1, str2, n); }
133 static inline int strnicmp(const char* s1, const char* s2, MSVCRT(size_t) n) { return _strnicmp(s1, s2, n); }
134 static inline char* strnset(char* str, int value, unsigned int len) { return _strnset(str, value, len); }
135 static inline char* strrev(char* str) { return _strrev(str); }
136 static inline char* strset(char* str, int value) { return _strset(str, value); }
137 static inline char* strupr(char* str) { return _strupr(str); }
138
139 static inline MSVCRT(wchar_t)* wcsdup(const MSVCRT(wchar_t)* str) { return _wcsdup(str); }
140 static inline int wcsicoll(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2) { return _wcsicoll(str1, str2); }
141 static inline MSVCRT(wchar_t)* wcslwr(MSVCRT(wchar_t)* str) { return _wcslwr(str); }
142 static inline int wcsnicmp(const MSVCRT(wchar_t)* str1, const MSVCRT(wchar_t)* str2, MSVCRT(size_t) n) { return _wcsnicmp(str1, str2, n); }
143 static inline MSVCRT(wchar_t)* wcsnset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c, MSVCRT(size_t) n) { return _wcsnset(str, c, n); }
144 static inline MSVCRT(wchar_t)* wcsrev(MSVCRT(wchar_t)* str) { return _wcsrev(str); }
145 static inline MSVCRT(wchar_t)* wcsset(MSVCRT(wchar_t)* str, MSVCRT(wchar_t) c) { return _wcsset(str, c); }
146 static inline MSVCRT(wchar_t)* wcsupr(MSVCRT(wchar_t)* str) { return _wcsupr(str); }
147 #endif /* USE_MSVCRT_PREFIX */
148
149 #endif /* __WINE_STRING_H */