1998-10-25 09:41:42 +08:00
|
|
|
/* Generic string.h */
|
|
|
|
|
|
|
|
#ifndef _AC_STRING_H
|
|
|
|
#define _AC_STRING_H
|
|
|
|
|
|
|
|
#ifdef STDC_HEADERS
|
|
|
|
# include <string.h>
|
|
|
|
#else
|
1998-11-16 10:02:45 +08:00
|
|
|
# ifdef HAVE_STRING_H
|
|
|
|
# include <string.h>
|
1998-11-17 09:25:45 +08:00
|
|
|
# else
|
|
|
|
# ifdef HAVE_STRINGS_H
|
1998-11-16 10:02:45 +08:00
|
|
|
# include <strings.h>
|
1998-11-17 09:25:45 +08:00
|
|
|
# endif
|
1998-11-16 10:02:45 +08:00
|
|
|
# endif
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
# ifndef HAVE_STRCHR
|
|
|
|
# define strchr index
|
|
|
|
# define strrchr rindex
|
|
|
|
# endif
|
|
|
|
|
|
|
|
# ifndef HAVE_MEMCPY
|
|
|
|
# define memcpy(d, s, n) bcopy ((s), (d), (n))
|
|
|
|
# define memmove(d, s, n) bcopy ((s), (d), (n))
|
|
|
|
# endif
|
1998-11-16 10:02:45 +08:00
|
|
|
|
|
|
|
# if !defined(HAVE_STRING_H) && !defined(HAVE_STRINGS_H)
|
|
|
|
/* define prototypes for string functions */
|
|
|
|
/* this could cause problems on some odd ball systems */
|
|
|
|
char *strchr(), *strrchr();
|
|
|
|
char *strcpy(), *strncpy();
|
|
|
|
char *strcat (), *strncat ();
|
|
|
|
int strcmp(), strncmp();
|
|
|
|
int strcasecmp(), strncasecmp();
|
|
|
|
char *strdup();
|
1998-11-16 13:07:27 +08:00
|
|
|
char *strtok();
|
|
|
|
char *strpbrk();
|
1998-11-16 10:02:45 +08:00
|
|
|
int memcmp();
|
|
|
|
# endif
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SAFEMEMCPY
|
|
|
|
# if defined( HAVE_MEMMOVE )
|
|
|
|
# define SAFEMEMCPY( d, s, n ) memmove((d), (s), (n))
|
1998-11-17 09:25:45 +08:00
|
|
|
# else
|
|
|
|
# if defined( HAVE_BCOPY )
|
1998-10-25 09:41:42 +08:00
|
|
|
# define SAFEMEMCPY( d, s, n ) bcopy((s), (d), (n))
|
1998-11-17 09:25:45 +08:00
|
|
|
# else
|
|
|
|
# if defined( MACOS )
|
1998-10-25 09:41:42 +08:00
|
|
|
# define SAFEMEMCPY( d, s, n ) BlockMoveData((Ptr)(s), (Ptr)(d), (n))
|
1998-11-17 09:25:45 +08:00
|
|
|
# else
|
1998-10-25 09:41:42 +08:00
|
|
|
/* nothing left but memcpy() */
|
|
|
|
# define SAFEMEMCPY( d, s, n ) memcpy((d), (s), (n))
|
1998-11-17 09:25:45 +08:00
|
|
|
# endif
|
|
|
|
# endif
|
1998-10-25 09:41:42 +08:00
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _AC_STRING_H */
|