comparison h/strings.h @ 0:bce86c4163a3

Initial revision
author kono
date Mon, 18 Apr 2005 23:46:02 +0900
parents
children a6481689f99c
comparison
equal deleted inserted replaced
-1:000000000000 0:bce86c4163a3
1 /* strings.h - define standard string functions */
2 /* @(#)$Id$ */
3
4 #ifndef _STRINGS /* once-only... */
5 #define _STRINGS
6
7 #ifdef AUX
8 #include <stdlib.h>
9 #endif
10
11 #ifdef _AIX
12 #include <string.h>
13 #include <stdlib.h>
14
15 #define bcmp(b1,b2,length) memcmp(b1, b2, length)
16 #define bcopy(b1,b2,length) (void) memcpy (b2, b1, length)
17 #define bcpy(b1,b2,length) memcmp (b1, b2, length)
18 #define bzero(b,length) (void) memset (b, 0, length)
19
20 #else /* _AIX */
21
22 #if defined(SYS5) && !defined(hpux)
23 #define index strchr
24 #define rindex strrchr
25 #endif /* SYS5 */
26
27 #if defined(BSD42) || defined(SVR4) || defined(hpux) || defined(__osf__)
28 #if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44)
29 #include <strings.h>
30 #else
31 #include <string.h>
32 #include <stdlib.h>
33 #endif
34 #else /* not BSD42 || SVR4 */
35 char *index ();
36 char *mktemp ();
37 char *rindex ();
38 #ifndef SPRINTFTYPE
39 #ifndef ncr /* NCR compiler complains about re-declaration */
40 char *sprintf (); /* I guess this is the new standard */
41 #endif
42 #else
43 #if !defined(hpux) && !defined(sgi) && !defined(linux) && !defined(__CYGWIN32__)
44 SPRINTFTYPE sprintf ();
45 #endif
46 #endif
47 char *strcat ();
48 int strcmp ();
49 char *strcpy ();
50 #ifndef hpux
51 int strlen ();
52 #endif
53 char *strncat ();
54 int strncmp ();
55 char *strncpy ();
56 #endif
57
58 #if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44)
59 char *getenv ();
60 char *calloc (), *malloc (), *realloc ();
61 #endif /* SVR4 */
62
63 #ifdef SYS5
64 #include <memory.h>
65 #define bcmp(b1,b2,length) memcmp(b1, b2, length)
66 #define bcopy(b1,b2,length) (void) memcpy (b2, b1, length)
67 #define bcpy(b1,b2,length) memcmp (b1, b2, length)
68 #define bzero(b,length) (void) memset (b, 0, length)
69 #endif /* SYS5 */
70 #endif /* _AIX */
71 #endif /* not _STRINGS */
72
73 #if !defined(bcopy) && (defined(__HIGHC__) || __GNUC__ == 2)
74 #define bcopy(s,d,l) memcpy(d,s,l)
75 #endif