-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
arg_check.h
294 lines (260 loc) · 7.05 KB
/
arg_check.h
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
/*
* Defines for malloc string routines...
*
* Copyright 2020 by Gray Watson
*
* This file is part of the dmalloc package.
*
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies, and that the name of Gray Watson not be used in advertising
* or publicity pertaining to distribution of the document or software
* without specific, written prior permission.
*
* Gray Watson makes no representations about the suitability of the
* software described herein for any purpose. It is provided "as is"
* without express or implied warranty.
*
* The author may be contacted via https://dmalloc.com/
*/
#ifndef __ARG_CHECK_H__
#define __ARG_CHECK_H__
#include "conf.h"
#include "dmalloc.h" /* for DMALLOC_SIZE */
/*<<<<<<<<<< The below prototypes are auto-generated by fillproto */
#if HAVE_ATOI
/*
* Dummy function for checking atoi's arguments.
*/
extern
int _dmalloc_atoi(const char *file, const int line, const char *str);
#endif /* if HAVE_ATOI */
#if HAVE_ATOL
/*
* Dummy function for checking atol's arguments.
*/
extern
long _dmalloc_atol(const char *file, const int line, const char *str);
#endif /* if HAVE_ATOL */
#if HAVE_BCMP
/*
* Dummy function for checking bcmp's arguments.
*/
extern
int _dmalloc_bcmp(const char *file, const int line,
const void *b1, const void *b2, const DMALLOC_SIZE len);
#endif /* if HAVE_BCMP */
#if HAVE_BCOPY
/*
* Dummy function for checking bcopy's arguments.
*/
extern
void _dmalloc_bcopy(const char *file, const int line,
const void *from, void *to, const DMALLOC_SIZE len);
#endif /* if HAVE_BCOPY */
#if HAVE_BZERO
/*
* Dummy function for checking bzero's arguments.
*/
extern
void _dmalloc_bzero(const char *file, const int line,
void *buf, const DMALLOC_SIZE len);
#endif /* if HAVE_BZERO */
#if HAVE_INDEX
/*
* Dummy function for checking index's arguments.
*/
extern
char *_dmalloc_index(const char *file, const int line,
const char *str, const char ch);
#endif /* if HAVE_INDEX */
#if HAVE_MEMCCPY
/*
* Dummy function for checking memccpy's arguments.
*/
extern
void *_dmalloc_memccpy(const char *file, const int line,
void *dest, const void *src, const int ch,
const DMALLOC_SIZE len);
#endif /* if HAVE_MEMCCPY */
#if HAVE_MEMCHR
/*
* Dummy function for checking memchr's arguments.
*/
extern
void *_dmalloc_memchr(const char *file, const int line,
const void *s1, const int ch, const DMALLOC_SIZE len);
#endif /* if HAVE_MEMCHR */
#if HAVE_MEMCMP
/*
* Dummy function for checking memcmp's arguments.
*/
extern
int _dmalloc_memcmp(const char *file, const int line,
const void *b1, const void *b2, const DMALLOC_SIZE len);
#endif /* if HAVE_MEMCMP */
#if HAVE_MEMCPY
/*
* Dummy function for checking memcpy's arguments.
*/
extern
void *_dmalloc_memcpy(const char *file, const int line,
void *to, const void *from, const DMALLOC_SIZE len);
#endif /* if HAVE_MEMCPY */
#if HAVE_MEMMOVE
/*
* Dummy function for checking memmove's arguments.
*/
extern
void *_dmalloc_memmove(const char *file, const int line,
void *to, const void *from, const DMALLOC_SIZE len);
#endif /* if HAVE_MEMMOVE */
#if HAVE_MEMSET
/*
* Dummy function for checking memset's arguments.
*/
extern
void *_dmalloc_memset(const char *file, const int line, void *buf,
const int ch, const DMALLOC_SIZE len);
#endif /* if HAVE_MEMSET */
#if HAVE_RINDEX
/*
* Dummy function for checking rindex's arguments.
*/
extern
char *_dmalloc_rindex(const char *file, const int line,
const char *str, const char ch);
#endif /* if HAVE_RINDEX */
#if HAVE_STRCASECMP
/*
* Dummy function for checking strcasecmp's arguments.
*/
extern
int _dmalloc_strcasecmp(const char *file, const int line,
const char *s1, const char *s2);
#endif /* if HAVE_STRCASECMP */
#if HAVE_STRCAT
/*
* Dummy function for checking strcat's arguments.
*/
extern
char *_dmalloc_strcat(const char *file, const int line,
char *to, const char *from);
#endif /* if HAVE_STRCAT */
#if HAVE_STRCHR
/*
* Dummy function for checking strchr's arguments.
*/
extern
char *_dmalloc_strchr(const char *file, const int line,
const char *str, const int ch);
#endif /* if HAVE_STRCHR */
#if HAVE_STRCMP
/*
* Dummy function for checking strcmp's arguments.
*/
extern
int _dmalloc_strcmp(const char *file, const int line,
const char *s1, const char *s2);
#endif /* if HAVE_STRCMP */
#if HAVE_STRCPY
/*
* Dummy function for checking strcpy's arguments.
*/
extern
char *_dmalloc_strcpy(const char *file, const int line,
char *to, const char *from);
#endif /* if HAVE_STRCPY */
#if HAVE_STRCSPN
/*
* Dummy function for checking strcspn's arguments.
*/
extern
int _dmalloc_strcspn(const char *file, const int line,
const char *str, const char *list);
#endif /* if HAVE_STRCSPN */
#if HAVE_STRLEN
/*
* Dummy function for checking strlen's arguments.
*/
extern
DMALLOC_SIZE _dmalloc_strlen(const char *file, const int line,
const char *str);
#endif /* if HAVE_STRLEN */
#if HAVE_STRNCASECMP
/*
* Dummy function for checking strncasecmp's arguments.
*/
extern
int _dmalloc_strncasecmp(const char *file, const int line,
const char *s1, const char *s2,
const DMALLOC_SIZE len);
#endif /* if HAVE_STRNCASECMP */
#if HAVE_STRNCAT
/*
* Dummy function for checking strncat's arguments.
*/
extern
char *_dmalloc_strncat(const char *file, const int line,
char *to, const char *from, const DMALLOC_SIZE len);
#endif /* if HAVE_STRNCAT */
#if HAVE_STRNCMP
/*
* Dummy function for checking strncmp's arguments.
*/
extern
int _dmalloc_strncmp(const char *file, const int line,
const char *s1, const char *s2,
const DMALLOC_SIZE len);
#endif /* if HAVE_STRNCMP */
#if HAVE_STRNCPY
/*
* Dummy function for checking strncpy's arguments.
*/
extern
char *_dmalloc_strncpy(const char *file, const int line,
char *to, const char *from, const DMALLOC_SIZE len);
#endif /* if HAVE_STRNCPY */
#if HAVE_STRPBRK
/*
* Dummy function for checking strpbrk's arguments.
*/
extern
char *_dmalloc_strpbrk(const char *file, const int line,
const char *str, const char *list);
#endif /* if HAVE_STRPBRK */
#if HAVE_STRRCHR
/*
* Dummy function for checking strrchr's arguments.
*/
extern
char *_dmalloc_strrchr(const char *file, const int line,
const char *str, const int ch);
#endif /* if HAVE_STRRCHR */
#if HAVE_STRSPN
/*
* Dummy function for checking strspn's arguments.
*/
extern
int _dmalloc_strspn(const char *file, const int line,
const char *str, const char *list);
#endif /* if HAVE_STRSPN */
#if HAVE_STRSTR
/*
* Dummy function for checking strstr's arguments.
*/
extern
char *_dmalloc_strstr(const char *file, const int line,
const char *str, const char *pat);
#endif /* if HAVE_STRSTR */
#if HAVE_STRTOK
/*
* Dummy function for checking strtok's arguments.
*/
extern
char *_dmalloc_strtok(const char *file, const int line,
char *str, const char *sep);
#endif /* if HAVE_STRTOK */
/*<<<<<<<<<< This is end of the auto-generated output from fillproto. */
#endif /* ! __ARG_CHECK_H__ */