summaryrefslogtreecommitdiffstats
path: root/private/crt32/h/string.h
blob: 7d3fe1e9ab99b0e3f8e67f07f43e80d90f4b2bf4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
/***
*string.h - declarations for string manipulation functions
*
*	Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
*
*Purpose:
*	This file contains the function declarations for the string
*	manipulation functions.
*	[ANSI/System V]
*
*Revision History:
*	10/20/87  JCR	Removed "MSC40_ONLY" entries
*	12-11-87  JCR	Added "_loadds" functionality
*	12-18-87  JCR	Added _FAR_ to declarations
*	02-10-88  JCR	Cleaned up white space
*	08-19-88  GJF	Modified to also work for the 386 (small model only)
*	03-22-88  JCR	Added strcoll and strxfrm
*	05-03-89  JCR	Added _INTERNAL_IFSTRIP for relinc usage
*	08-03-89  GJF	Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
*	10-30-89  GJF	Fixed copyright, removed dummy args from strcoll and
*			strxfrm
*	11-02-89  JCR	Changed "DLL" to "_DLL"
*	11-17-89  GJF	Added const to appropriate arg types for memccpy(),
*			memicmp() and _strerror().
*	02-27-90  GJF	Added #ifndef _INC_STRING, #include <cruntime.h>
*			and _CALLTYPE1 stuff. Also, some cleanup.
*	03-21-90  GJF	Got rid of movedata() prototype.
*	08-14-90  SBM	Added NULL definition for ANSI compliance
*	11-12-90  GJF	Changed NULL to (void *)0.
*	01-18-91  GJF	ANSI naming.
*	02-12-91  GJF	Only #define NULL if it isn't #define-d.
*	03-21-91  KRS	Added wchar_t type, also in stdlib.h and stddef.h.
*	08-20-91  JCR	C++ and ANSI naming
*	09-28-91  JCR	ANSI names: DOSX32=prototypes, WIN32=#defines for now
*	10-07-91  ETC	Prototypes for wcs functions and _stricoll under _INTL.
*	04-06-92  KRS	Rip out _INTL switches again.
*	06-23-92  GJF	// is non-ANSI comment limiter.
*	08-05-92  GJF	Function calling type and variable type macros.
*	08-18-92  KRS	Activate wcstok.
*	08-21-92  GJF	Merged last two changes.
*	01-21-93  GJF	Removed support for C6-386's _cdecl.
*
****/

#ifndef _INC_STRING

#ifdef __cplusplus
extern "C" {
#endif

#ifndef _INTERNAL_IFSTRIP_
#include <cruntime.h>
#endif	/* _INTERNAL_IFSTRIP_ */

/*
 * Conditional macro definition for function calling type and variable type
 * qualifiers.
 */
#if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )

/*
 * Definitions for MS C8-32 (386/486) compiler
 */
#define _CRTAPI1 __cdecl
#define _CRTAPI2 __cdecl

#else

/*
 * Other compilers (e.g., MIPS)
 */
#define _CRTAPI1
#define _CRTAPI2

#endif


#ifndef _SIZE_T_DEFINED
typedef unsigned int size_t;
#define _SIZE_T_DEFINED
#endif


#ifndef _WCHAR_T_DEFINED
typedef unsigned short wchar_t;
#define _WCHAR_T_DEFINED
#endif


/* define NULL pointer value */

#ifndef NULL
#ifdef __cplusplus
#define NULL	0
#else
#define NULL	((void *)0)
#endif
#endif


/* function prototypes */

void * _CRTAPI1 _memccpy(void *, const void *, int, unsigned int);
void * _CRTAPI1 memchr(const void *, int, size_t);
int _CRTAPI1 memcmp(const void *, const void *, size_t);
int _CRTAPI1 _memicmp(const void *, const void *, unsigned int);
void * _CRTAPI1 memcpy(void *, const void *, size_t);
void * _CRTAPI1 memmove(void *, const void *, size_t);
void * _CRTAPI1 memset(void *, int, size_t);
char * _CRTAPI1 strcat(char *, const char *);
char * _CRTAPI1 strchr(const char *, int);
int _CRTAPI1 strcmp(const char *, const char *);
int _CRTAPI1 _strcmpi(const char *, const char *);
int _CRTAPI1 _stricmp(const char *, const char *);
int _CRTAPI1 strcoll(const char *, const char *);
#ifdef _MAC_
char * _CRTAPI1 _c2pstr(const char *);
char * _CRTAPI1 _p2cstr(const char *);
#endif
int _CRTAPI1 _stricoll(const char *, const char *);
char * _CRTAPI1 strcpy(char *, const char *);
size_t _CRTAPI1 strcspn(const char *, const char *);
char * _CRTAPI1 _strdup(const char *);
char * _CRTAPI1 _strerror(const char *);
char * _CRTAPI1 strerror(int);
size_t _CRTAPI1 strlen(const char *);
char * _CRTAPI1 _strlwr(char *);
char * _CRTAPI1 strncat(char *, const char *, size_t);
int _CRTAPI1 strncmp(const char *, const char *, size_t);
int _CRTAPI1 _strnicmp(const char *, const char *, size_t);
char * _CRTAPI1 strncpy(char *, const char *, size_t);
char * _CRTAPI1 _strnset(char *, int, size_t);
char * _CRTAPI1 strpbrk(const char *, const char *);
char * _CRTAPI1 strrchr(const char *, int);
char * _CRTAPI1 _strrev(char *);
char * _CRTAPI1 _strset(char *, int);
size_t _CRTAPI1 strspn(const char *, const char *);
char * _CRTAPI1 strstr(const char *, const char *);
char * _CRTAPI1 strtok(char *, const char *);
char * _CRTAPI1 _strupr(char *);
size_t _CRTAPI1 strxfrm (char *, const char *, size_t);

#ifndef _WSTRING_DEFINED
wchar_t * _CRTAPI1 wcscat(wchar_t *, const wchar_t *);
wchar_t * _CRTAPI1 wcschr(const wchar_t *, wchar_t);
int _CRTAPI1 wcscmp(const wchar_t *, const wchar_t *);
wchar_t * _CRTAPI1 wcscpy(wchar_t *, const wchar_t *);
size_t _CRTAPI1 wcscspn(const wchar_t *, const wchar_t *);
size_t _CRTAPI1 wcslen(const wchar_t *);
wchar_t * _CRTAPI1 wcsncat(wchar_t *, const wchar_t *, size_t);
int _CRTAPI1 wcsncmp(const wchar_t *, const wchar_t *, size_t);
wchar_t * _CRTAPI1 wcsncpy(wchar_t *, const wchar_t *, size_t);
wchar_t * _CRTAPI1 wcspbrk(const wchar_t *, const wchar_t *);
wchar_t * _CRTAPI1 wcsrchr(const wchar_t *, wchar_t);
size_t _CRTAPI1 wcsspn(const wchar_t *, const wchar_t *);
wchar_t * _CRTAPI1 wcsstr(const wchar_t *, const wchar_t *);
wchar_t * _CRTAPI1 wcstok(wchar_t *, const wchar_t *);

wchar_t * _CRTAPI1 _wcsdup(const wchar_t *);
int _CRTAPI1 _wcsicmp(const wchar_t *, const wchar_t *);
int _CRTAPI1 _wcsnicmp(const wchar_t *, const wchar_t *, size_t);
wchar_t * _CRTAPI1 _wcsnset(wchar_t *, wchar_t, size_t);
wchar_t * _CRTAPI1 _wcsrev(wchar_t *);
wchar_t * _CRTAPI1 _wcsset(wchar_t *, wchar_t);

wchar_t * _CRTAPI1 _wcslwr(wchar_t *);
wchar_t * _CRTAPI1 _wcsupr(wchar_t *);
size_t _CRTAPI1 wcsxfrm(wchar_t *, const wchar_t *, size_t);
int _CRTAPI1 wcscoll(const wchar_t *, const wchar_t *);
int _CRTAPI1 _wcsicoll(const wchar_t *, const wchar_t *);

/* old names */
#define wcswcs wcsstr

#define _WSTRING_DEFINED
#endif

#if !__STDC__
/* Non-ANSI names for compatibility */
#ifndef _DOSX32_
#define memccpy  _memccpy
#define memicmp  _memicmp
#define strcmpi  _strcmpi
#define stricmp  _stricmp
#define strdup	 _strdup
#define strlwr	 _strlwr
#define strnicmp _strnicmp
#define strnset  _strnset
#define strrev	 _strrev
#define strset	 _strset
#define strupr	 _strupr
#define stricoll _stricoll

#ifdef _MAC_
#define c2pstr _c2pstr
#define p2cstr _p2cstr
#endif
#else
void * _CRTAPI1 memccpy(void *, const void *, int, unsigned int);
int _CRTAPI1 memicmp(const void *, const void *, unsigned int);
int _CRTAPI1 strcmpi(const char *, const char *);
int _CRTAPI1 stricmp(const char *, const char *);
char * _CRTAPI1 strdup(const char *);
char * _CRTAPI1 strlwr(char *);
int _CRTAPI1 strnicmp(const char *, const char *, size_t);
char * _CRTAPI1 strnset(char *, int, size_t);
char * _CRTAPI1 strrev(char *);
char * _CRTAPI1 strset(char *, int);
char * _CRTAPI1 strupr(char *);
#endif	/* !_DOSX32_ */

#define wcsdup	_wcsdup
#define wcsicmp	_wcsicmp
#define wcsnicmp _wcsnicmp
#define wcsnset	_wcsnset
#define wcsrev	_wcsrev
#define wcsset	_wcsset
#define wcslwr	_wcslwr
#define wcsupr	_wcsupr
#define wcsicoll _wcsicoll
#endif	/* !__STDC__ */

#ifdef __cplusplus
}
#endif

#define _INC_STRING
#endif	/* _INC_STRING */