OSDN Git Service

binding with libharu.
[putex/putex.git] / src / texsourc / c-memstr.h
1 /* c-memstr.h: memcpy, strchr, etc.
2
3    Copyright 1992 Karl Berry
4    Copyright 2007 TeX Users Group
5    Copyright 2014 Clerk Ma
6
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.
11
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.
16
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
20    02110-1301 USA.  */
21
22 #ifndef C_MEMSTR_H
23 #define C_MEMSTR_H
24
25 #include "c-std.h"
26
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
30   #include <string.h>
31   /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
32   #if !STDC_HEADERS && HAVE_MEMORY_H
33     #include <memory.h>
34   #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
35   #define index strchr
36   #define rindex strrchr
37
38   #ifndef bcmp
39     #define bcmp(s1, s2, len) memcmp ((s1), (s2), (len))
40   #endif
41   #ifndef bcopy
42     #define bcopy(from, to, len) memcpy ((to), (from), (len))
43   #endif
44   #ifndef bzero
45     #define bzero(s, len) memset ((s), 0, (len))
46   #endif
47 #else /* not STDC_HEADERS and not HAVE_STRING_H */
48
49   #include <strings.h>
50
51   #define strchr index
52   #define strrchr rindex
53
54   #define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
55   #define memcpy(to, from, len) bcopy ((from), (to), (len))
56
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 */
60
61 #endif /* not C_MEMSTR_H */