Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:15:31

0001 /*
0002  * $TOG: Xmfuncs.h /main/1 1997/03/24 16:25:46 dbl $
0003  * 
0004  * 
0005 Copyright (c) 1990  X Consortium
0006 
0007 Permission is hereby granted, free of charge, to any person obtaining a copy
0008 of this software and associated documentation files (the "Software"), to deal
0009 in the Software without restriction, including without limitation the rights
0010 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
0011 copies of the Software, and to permit persons to whom the Software is
0012 furnished to do so, subject to the following conditions:
0013 
0014 The above copyright notice and this permission notice shall be included in
0015 all copies or substantial portions of the Software.
0016 
0017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0018 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0019 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
0020 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
0021 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
0022 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
0023 
0024 Except as contained in this notice, the name of the X Consortium shall not be
0025 used in advertising or otherwise to promote the sale, use or other dealings
0026 in this Software without prior written authorization from the X Consortium.
0027  *
0028  */
0029 
0030 #ifndef _XFUNCS_H_
0031 #define _XFUNCS_H_
0032 
0033 #include <X11/Xosdefs.h>
0034 
0035 /* the old Xfuncs.h, for pre-R6 */
0036 
0037 #ifdef X_USEBFUNCS
0038 void bcopy();
0039 void bzero();
0040 int bcmp();
0041 #else
0042 #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_)
0043 #include <string.h>
0044 #define _XFUNCS_H_INCLUDED_STRING_H
0045 #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
0046 #define bzero(b,len) memset(b, 0, (size_t)(len))
0047 #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
0048 #else
0049 #ifdef sgi
0050 #include <bstring.h>
0051 #else
0052 #ifdef SYSV
0053 #include <memory.h>
0054 void bcopy();
0055 #define bzero(b,len) memset(b, 0, len)
0056 #define bcmp(b1,b2,len) memcmp(b1, b2, len)
0057 #else /* bsd */
0058 void bcopy();
0059 void bzero();
0060 int bcmp();
0061 #endif /* SYSV */
0062 #endif /* sgi */
0063 #endif /* __STDC__ and relatives */
0064 #endif /* X_USEBFUNCS */
0065 
0066 /* the new Xfuncs.h */
0067 
0068 #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
0069 /* the ANSI C way */
0070 #ifndef _XFUNCS_H_INCLUDED_STRING_H
0071 #include <string.h>
0072 #endif
0073 #undef bzero
0074 #define bzero(b,len) memset(b,0,len)
0075 #else /* else X_NOT_STDC_ENV or SunOS 4 */
0076 #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
0077 #include <memory.h>
0078 #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
0079 #if defined(SYSV) && defined(_XBCOPYFUNC)
0080 #undef memmove
0081 #define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
0082 #define _XNEEDBCOPYFUNC
0083 #endif
0084 #else /* else vanilla BSD */
0085 #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
0086 #define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
0087 #define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
0088 #endif /* SYSV else */
0089 #endif /* ! X_NOT_STDC_ENV else */
0090 
0091 #endif /* _XFUNCS_H_ */