1 /*
2  * Defines for malloc string routines...
3  *
4  * Copyright 2020 by Gray Watson
5  *
6  * This file is part of the dmalloc package.
7  *
8  * Permission to use, copy, modify, and distribute this software for
9  * any purpose and without fee is hereby granted, provided that the
10  * above copyright notice and this permission notice appear in all
11  * copies, and that the name of Gray Watson not be used in advertising
12  * or publicity pertaining to distribution of the document or software
13  * without specific, written prior permission.
14  *
15  * Gray Watson makes no representations about the suitability of the
16  * software described herein for any purpose.  It is provided "as is"
17  * without express or implied warranty.
18  *
19  * The author may be contacted via http://dmalloc.com/
20  */
21 
22 #ifndef __ARG_CHECK_H__
23 #define __ARG_CHECK_H__
24 
25 #include "conf.h"
26 #include "dmalloc.h"			/* for DMALLOC_SIZE */
27 
28 /*<<<<<<<<<<  The below prototypes are auto-generated by fillproto */
29 
30 #if HAVE_ATOI
31 /*
32  * Dummy function for checking atoi's arguments.
33  */
34 extern
35 int	_dmalloc_atoi(const char *file, const int line, const char *str);
36 #endif /* if HAVE_ATOI */
37 
38 #if HAVE_ATOL
39 /*
40  * Dummy function for checking atol's arguments.
41  */
42 extern
43 long	_dmalloc_atol(const char *file, const int line, const char *str);
44 #endif /* if HAVE_ATOL */
45 
46 #if HAVE_BCMP
47 /*
48  * Dummy function for checking bcmp's arguments.
49  */
50 extern
51 int	_dmalloc_bcmp(const char *file, const int line,
52 		      const void *b1, const void *b2, const DMALLOC_SIZE len);
53 #endif /* if HAVE_BCMP */
54 
55 #if HAVE_BCOPY
56 /*
57  * Dummy function for checking bcopy's arguments.
58  */
59 extern
60 void	_dmalloc_bcopy(const char *file, const int line,
61 		       const void *from, void *to, const DMALLOC_SIZE len);
62 #endif /* if HAVE_BCOPY */
63 
64 #if HAVE_BZERO
65 /*
66  * Dummy function for checking bzero's arguments.
67  */
68 extern
69 void	_dmalloc_bzero(const char *file, const int line,
70 		       void *buf, const DMALLOC_SIZE len);
71 #endif /* if HAVE_BZERO */
72 
73 #if HAVE_INDEX
74 /*
75  * Dummy function for checking index's arguments.
76  */
77 extern
78 char	*_dmalloc_index(const char *file, const int line,
79 			const char *str, const char ch);
80 #endif /* if HAVE_INDEX */
81 
82 #if HAVE_MEMCCPY
83 /*
84  * Dummy function for checking memccpy's arguments.
85  */
86 extern
87 void	*_dmalloc_memccpy(const char *file, const int line,
88 			  void *dest, const void *src, const int ch,
89 			  const DMALLOC_SIZE len);
90 #endif /* if HAVE_MEMCCPY */
91 
92 #if HAVE_MEMCHR
93 /*
94  * Dummy function for checking memchr's arguments.
95  */
96 extern
97 void	*_dmalloc_memchr(const char *file, const int line,
98 			 const void *s1, const int ch, const DMALLOC_SIZE len);
99 #endif /* if HAVE_MEMCHR */
100 
101 #if HAVE_MEMCMP
102 /*
103  * Dummy function for checking memcmp's arguments.
104  */
105 extern
106 int	_dmalloc_memcmp(const char *file, const int line,
107 			const void *b1, const void *b2, const DMALLOC_SIZE len);
108 #endif /* if HAVE_MEMCMP */
109 
110 #if HAVE_MEMCPY
111 /*
112  * Dummy function for checking memcpy's arguments.
113  */
114 extern
115 void	*_dmalloc_memcpy(const char *file, const int line,
116 			 void *to, const void *from, const DMALLOC_SIZE len);
117 #endif /* if HAVE_MEMCPY */
118 
119 #if HAVE_MEMMOVE
120 /*
121  * Dummy function for checking memmove's arguments.
122  */
123 extern
124 void	*_dmalloc_memmove(const char *file, const int line,
125 			  void *to, const void *from, const DMALLOC_SIZE len);
126 #endif /* if HAVE_MEMMOVE */
127 
128 #if HAVE_MEMSET
129 /*
130  * Dummy function for checking memset's arguments.
131  */
132 extern
133 void	*_dmalloc_memset(const char *file, const int line, void *buf,
134 			 const int ch, const DMALLOC_SIZE len);
135 #endif /* if HAVE_MEMSET */
136 
137 #if HAVE_RINDEX
138 /*
139  * Dummy function for checking rindex's arguments.
140  */
141 extern
142 char	*_dmalloc_rindex(const char *file, const int line,
143 			 const char *str, const char ch);
144 #endif /* if HAVE_RINDEX */
145 
146 #if HAVE_STRCASECMP
147 /*
148  * Dummy function for checking strcasecmp's arguments.
149  */
150 extern
151 int	_dmalloc_strcasecmp(const char *file, const int line,
152 			    const char *s1, const char *s2);
153 #endif /* if HAVE_STRCASECMP */
154 
155 #if HAVE_STRCAT
156 /*
157  * Dummy function for checking strcat's arguments.
158  */
159 extern
160 char	*_dmalloc_strcat(const char *file, const int line,
161 			 char *to, const char *from);
162 #endif /* if HAVE_STRCAT */
163 
164 #if HAVE_STRCHR
165 /*
166  * Dummy function for checking strchr's arguments.
167  */
168 extern
169 char	*_dmalloc_strchr(const char *file, const int line,
170 			 const char *str, const int ch);
171 #endif /* if HAVE_STRCHR */
172 
173 #if HAVE_STRCMP
174 /*
175  * Dummy function for checking strcmp's arguments.
176  */
177 extern
178 int	_dmalloc_strcmp(const char *file, const int line,
179 			const char *s1, const char *s2);
180 #endif /* if HAVE_STRCMP */
181 
182 #if HAVE_STRCPY
183 /*
184  * Dummy function for checking strcpy's arguments.
185  */
186 extern
187 char	*_dmalloc_strcpy(const char *file, const int line,
188 			 char *to, const char *from);
189 #endif /* if HAVE_STRCPY */
190 
191 #if HAVE_STRCSPN
192 /*
193  * Dummy function for checking strcspn's arguments.
194  */
195 extern
196 int	_dmalloc_strcspn(const char *file, const int line,
197 			 const char *str, const char *list);
198 #endif /* if HAVE_STRCSPN */
199 
200 #if HAVE_STRLEN
201 /*
202  * Dummy function for checking strlen's arguments.
203  */
204 extern
205 DMALLOC_SIZE	_dmalloc_strlen(const char *file, const int line,
206 				const char *str);
207 #endif /* if HAVE_STRLEN */
208 
209 #if HAVE_STRNCASECMP
210 /*
211  * Dummy function for checking strncasecmp's arguments.
212  */
213 extern
214 int	_dmalloc_strncasecmp(const char *file, const int line,
215 			     const char *s1, const char *s2,
216 			     const DMALLOC_SIZE len);
217 #endif /* if HAVE_STRNCASECMP */
218 
219 #if HAVE_STRNCAT
220 /*
221  * Dummy function for checking strncat's arguments.
222  */
223 extern
224 char	*_dmalloc_strncat(const char *file, const int line,
225 			  char *to, const char *from, const DMALLOC_SIZE len);
226 #endif /* if HAVE_STRNCAT */
227 
228 #if HAVE_STRNCMP
229 /*
230  * Dummy function for checking strncmp's arguments.
231  */
232 extern
233 int	_dmalloc_strncmp(const char *file, const int line,
234 			 const char *s1, const char *s2,
235 			 const DMALLOC_SIZE len);
236 #endif /* if HAVE_STRNCMP */
237 
238 #if HAVE_STRNCPY
239 /*
240  * Dummy function for checking strncpy's arguments.
241  */
242 extern
243 char	*_dmalloc_strncpy(const char *file, const int line,
244 			  char *to, const char *from, const DMALLOC_SIZE len);
245 #endif /* if HAVE_STRNCPY */
246 
247 #if HAVE_STRPBRK
248 /*
249  * Dummy function for checking strpbrk's arguments.
250  */
251 extern
252 char	*_dmalloc_strpbrk(const char *file, const int line,
253 			  const char *str, const char *list);
254 #endif /* if HAVE_STRPBRK */
255 
256 #if HAVE_STRRCHR
257 /*
258  * Dummy function for checking strrchr's arguments.
259  */
260 extern
261 char	*_dmalloc_strrchr(const char *file, const int line,
262 			  const char *str, const int ch);
263 #endif /* if HAVE_STRRCHR */
264 
265 #if HAVE_STRSPN
266 /*
267  * Dummy function for checking strspn's arguments.
268  */
269 extern
270 int	_dmalloc_strspn(const char *file, const int line,
271 			const char *str, const char *list);
272 #endif /* if HAVE_STRSPN */
273 
274 #if HAVE_STRSTR
275 /*
276  * Dummy function for checking strstr's arguments.
277  */
278 extern
279 char	*_dmalloc_strstr(const char *file, const int line,
280 			 const char *str, const char *pat);
281 #endif /* if HAVE_STRSTR */
282 
283 #if HAVE_STRTOK
284 /*
285  * Dummy function for checking strtok's arguments.
286  */
287 extern
288 char	*_dmalloc_strtok(const char *file, const int line,
289 			 char *str, const char *sep);
290 #endif /* if HAVE_STRTOK */
291 
292 /*<<<<<<<<<<   This is end of the auto-generated output from fillproto. */
293 
294 #endif /* ! __ARG_CHECK_H__ */
295