Blame lib/Xm/Xmfuncs.h

Packit b099d7
/*
Packit b099d7
 * $TOG: Xmfuncs.h /main/1 1997/03/24 16:25:46 dbl $
Packit b099d7
 * 
Packit b099d7
 * 
Packit b099d7
Copyright (c) 1990  X Consortium
Packit b099d7
Packit b099d7
Permission is hereby granted, free of charge, to any person obtaining a copy
Packit b099d7
of this software and associated documentation files (the "Software"), to deal
Packit b099d7
in the Software without restriction, including without limitation the rights
Packit b099d7
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Packit b099d7
copies of the Software, and to permit persons to whom the Software is
Packit b099d7
furnished to do so, subject to the following conditions:
Packit b099d7
Packit b099d7
The above copyright notice and this permission notice shall be included in
Packit b099d7
all copies or substantial portions of the Software.
Packit b099d7
Packit b099d7
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
Packit b099d7
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
Packit b099d7
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
Packit b099d7
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
Packit b099d7
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
Packit b099d7
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Packit b099d7
Packit b099d7
Except as contained in this notice, the name of the X Consortium shall not be
Packit b099d7
used in advertising or otherwise to promote the sale, use or other dealings
Packit b099d7
in this Software without prior written authorization from the X Consortium.
Packit b099d7
 *
Packit b099d7
 */
Packit b099d7
Packit b099d7
#ifndef _XFUNCS_H_
Packit b099d7
#define _XFUNCS_H_
Packit b099d7
Packit b099d7
#include <X11/Xosdefs.h>
Packit b099d7
Packit b099d7
/* the old Xfuncs.h, for pre-R6 */
Packit b099d7
Packit b099d7
#ifdef X_USEBFUNCS
Packit b099d7
void bcopy();
Packit b099d7
void bzero();
Packit b099d7
int bcmp();
Packit b099d7
#else
Packit b099d7
#if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)
Packit b099d7
#include <string.h>
Packit b099d7
#define _XFUNCS_H_INCLUDED_STRING_H
Packit b099d7
#define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
Packit b099d7
#define bzero(b,len) memset(b, 0, (size_t)(len))
Packit b099d7
#define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
Packit b099d7
#else
Packit b099d7
#ifdef sgi
Packit b099d7
#include <bstring.h>
Packit b099d7
#else
Packit b099d7
#ifdef SYSV
Packit b099d7
#include <memory.h>
Packit b099d7
void bcopy();
Packit b099d7
#define bzero(b,len) memset(b, 0, len)
Packit b099d7
#define bcmp(b1,b2,len) memcmp(b1, b2, len)
Packit b099d7
#else /* bsd */
Packit b099d7
void bcopy();
Packit b099d7
void bzero();
Packit b099d7
int bcmp();
Packit b099d7
#endif /* SYSV */
Packit b099d7
#endif /* sgi */
Packit b099d7
#endif /* __STDC__ and relatives */
Packit b099d7
#endif /* X_USEBFUNCS */
Packit b099d7
Packit b099d7
/* the new Xfuncs.h */
Packit b099d7
Packit b099d7
#if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
Packit b099d7
/* the ANSI C way */
Packit b099d7
#ifndef _XFUNCS_H_INCLUDED_STRING_H
Packit b099d7
#include <string.h>
Packit b099d7
#endif
Packit b099d7
#undef bzero
Packit b099d7
#define bzero(b,len) memset(b,0,len)
Packit b099d7
#else /* else X_NOT_STDC_ENV or SunOS 4 */
Packit b099d7
#if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
Packit b099d7
#include <memory.h>
Packit b099d7
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
Packit b099d7
#if defined(SYSV) && defined(_XBCOPYFUNC)
Packit b099d7
#undef memmove
Packit b099d7
#define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
Packit b099d7
#define _XNEEDBCOPYFUNC
Packit b099d7
#endif
Packit b099d7
#else /* else vanilla BSD */
Packit b099d7
#define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
Packit b099d7
#define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
Packit b099d7
#define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
Packit b099d7
#endif /* SYSV else */
Packit b099d7
#endif /* ! X_NOT_STDC_ENV else */
Packit b099d7
Packit b099d7
#endif /* _XFUNCS_H_ */