1 /* c-memstr.h: memcpy, strchr, etc.
3 Copyright 1992 Karl Berry
4 Copyright 2007 TeX Users Group
5 Copyright 2014 Clerk Ma
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
27 /* Just to be complete, we make both the system V/ANSI and the BSD
28 versions of the string functions available. */
29 #if STDC_HEADERS || HAVE_STRING_H
31 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
32 #if !STDC_HEADERS && HAVE_MEMORY_H
34 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
36 #define rindex strrchr
39 #define bcmp(s1, s2, len) memcmp ((s1), (s2), (len))
42 #define bcopy(from, to, len) memcpy ((to), (from), (len))
45 #define bzero(s, len) memset ((s), 0, (len))
47 #else /* not STDC_HEADERS and not HAVE_STRING_H */
52 #define strrchr rindex
54 #define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
55 #define memcpy(to, from, len) bcopy ((from), (to), (len))
57 extern char *strtok(char *, const char *); /* extern char *strtok(); */
58 extern char *strstr(const char *, const char *); /* extern char *strstr(); */
59 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
61 #endif /* not C_MEMSTR_H */