view h/strings.h @ 12:441a2190cfae

Lion fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 21 Apr 2012 13:10:49 +0900
parents a6481689f99c
children
line wrap: on
line source

/* strings.h - define standard string functions */
/* @(#)$Id: strings.h,v 1.2 2006/12/05 18:17:58 kono Exp $ */

#ifndef	_STRINGS		/* once-only... */
#define	_STRINGS

#ifdef AUX
#include <stdlib.h>
#endif

#ifdef _AIX
#include <string.h>
#include <stdlib.h>

#define bcmp(b1,b2,length)	memcmp(b1, b2, length)
#define	bcopy(b1,b2,length)	(void) memcpy (b2, b1, length)
#define	bcpy(b1,b2,length)	memcmp (b1, b2, length)
#define	bzero(b,length)		(void) memset (b, 0, length)

#else /* _AIX */

#if defined(SYS5) && !defined(hpux)
#define	index	strchr
#define	rindex	strrchr
#endif /* SYS5 */

#if defined(BSD42) || defined(SVR4) || defined(hpux) || defined(__osf__) || defined(linux)
#if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44)
#include <strings.h>
#else
#include <string.h>
#include <stdlib.h>
#endif
#else	/* not BSD42 || SVR4 */
char   *index ();
char   *mktemp ();
char   *rindex ();
#ifndef	SPRINTFTYPE
#ifndef	ncr		/* NCR compiler complains about re-declaration */
char   *sprintf ();		/* I guess this is the new standard */
#endif
#else
#if !defined(hpux) && !defined(sgi) && !defined(linux) && !defined(__CYGWIN32__)
SPRINTFTYPE sprintf ();
#endif
#endif
char   *strcat ();
int     strcmp ();
char   *strcpy ();
#ifndef hpux
int	strlen ();
#endif
char   *strncat ();
int     strncmp ();
char   *strncpy ();
#endif

#if !defined(SVR4) && !defined(__386BSD__) && !defined(BSD44) && !defined(linux)
char   *getenv ();
char   *calloc (), *malloc (), *realloc ();
#endif	/* SVR4 */

#ifdef	SYS5
#include <memory.h>
#define bcmp(b1,b2,length)	memcmp(b1, b2, length)
#define	bcopy(b1,b2,length)	(void) memcpy (b2, b1, length)
#define	bcpy(b1,b2,length)	memcmp (b1, b2, length)
#define	bzero(b,length)		(void) memset (b, 0, length)
#endif /* SYS5 */
#endif	/* _AIX */
#endif /* not _STRINGS */

#if !defined(bcopy) && (defined(__HIGHC__) || __GNUC__ == 2)
#define	bcopy(s,d,l)	memcpy(d,s,l)
#endif