]> git.sesse.net Git - rdpsrv/blob - Xserver/include/Xfuncs.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / include / Xfuncs.h
1 /*
2  * $XConsortium: Xfuncs.h,v 1.16 94/12/01 16:25:53 kaleb Exp $
3  * $XFree86: xc/include/Xfuncs.h,v 3.2 1995/01/28 15:42:03 dawes Exp $
4  * 
5  * 
6 Copyright (c) 1990  X Consortium
7
8 Permission is hereby granted, free of charge, to any person obtaining a copy
9 of this software and associated documentation files (the "Software"), to deal
10 in the Software without restriction, including without limitation the rights
11 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 copies of the Software, and to permit persons to whom the Software is
13 furnished to do so, subject to the following conditions:
14
15 The above copyright notice and this permission notice shall be included in
16 all copies or substantial portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
21 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24
25 Except as contained in this notice, the name of the X Consortium shall not be
26 used in advertising or otherwise to promote the sale, use or other dealings
27 in this Software without prior written authorization from the X Consortium.
28  *
29  */
30
31 #ifndef _XFUNCS_H_
32 #define _XFUNCS_H_
33
34 #include <X11/Xosdefs.h>
35
36 /* the old Xfuncs.h, for pre-R6 */
37
38 #ifdef X_USEBFUNCS
39 void bcopy();
40 void bzero();
41 int bcmp();
42 #else
43 #if (__STDC__ && !defined(X_NOT_STDC_ENV) && !defined(sun) && !defined(macII) && !defined(apollo)) || defined(SVR4) || defined(hpux) || defined(_IBMR2) || defined(_SEQUENT_) || defined(__osf__)
44 #include <string.h>
45 #define _XFUNCS_H_INCLUDED_STRING_H
46 #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
47 #define bzero(b,len) memset(b, 0, (size_t)(len))
48 #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
49 #else
50 #ifdef sgi
51 #include <bstring.h>
52 #else
53 #ifdef SYSV
54 #include <memory.h>
55 void bcopy();
56 #define bzero(b,len) memset(b, 0, len)
57 #define bcmp(b1,b2,len) memcmp(b1, b2, len)
58 #else
59 #ifdef __EMX__
60 #include <strings.h>
61 #define _XFUNCS_H_INCLUDED_STRING_H
62 /* bcopy, bcmp, bzero declared */
63 #else /* bsd */
64 void bcopy();
65 void bzero();
66 int bcmp();
67 #endif
68 #endif /* SYSV */
69 #endif /* sgi */
70 #endif /* __STDC__ and relatives */
71 #endif /* X_USEBFUNCS */
72
73 /* the new Xfuncs.h */
74
75 #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
76 /* the ANSI C way */
77 #ifndef _XFUNCS_H_INCLUDED_STRING_H
78 #include <string.h>
79 #endif
80 #undef bzero
81 #define bzero(b,len) memset(b,0,len)
82 #else /* else X_NOT_STDC_ENV or SunOS 4 */
83 #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
84 #include <memory.h>
85 #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
86 #if defined(SYSV) && defined(_XBCOPYFUNC)
87 #undef memmove
88 #define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
89 #define _XNEEDBCOPYFUNC
90 #endif
91 #else /* else vanilla BSD */
92 #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
93 #define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
94 #define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
95 #endif /* SYSV else */
96 #endif /* ! X_NOT_STDC_ENV else */
97
98 #endif /* _XFUNCS_H_ */