1 | /*
|
---|
2 | * $Xorg: Xfuncs.h,v 1.4 2001/02/09 02:03:22 xorgcvs Exp $
|
---|
3 | *
|
---|
4 | *
|
---|
5 | Copyright 1990, 1998 The Open Group
|
---|
6 |
|
---|
7 | Permission to use, copy, modify, distribute, and sell this software and its
|
---|
8 | documentation for any purpose is hereby granted without fee, provided that
|
---|
9 | the above copyright notice appear in all copies and that both that
|
---|
10 | copyright notice and this permission notice appear in supporting
|
---|
11 | documentation.
|
---|
12 |
|
---|
13 | The above copyright notice and this permission notice shall be included in
|
---|
14 | all copies or substantial portions of the Software.
|
---|
15 |
|
---|
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
19 | OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
---|
20 | AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
22 |
|
---|
23 | Except as contained in this notice, the name of The Open Group shall not be
|
---|
24 | used in advertising or otherwise to promote the sale, use or other dealings
|
---|
25 | in this Software without prior written authorization from The Open Group.
|
---|
26 | *
|
---|
27 | */
|
---|
28 | /* $XFree86: xc/include/Xfuncs.h,v 3.10 2002/05/31 18:45:38 dawes Exp $ */
|
---|
29 |
|
---|
30 | #ifndef _XFUNCS_H_
|
---|
31 | #define _XFUNCS_H_
|
---|
32 |
|
---|
33 | #include <X11/Xosdefs.h>
|
---|
34 |
|
---|
35 | /* the old Xfuncs.h, for pre-R6 */
|
---|
36 | #if !(defined(XFree86LOADER) && defined(IN_MODULE))
|
---|
37 |
|
---|
38 | #ifdef X_USEBFUNCS
|
---|
39 | void bcopy();
|
---|
40 | void bzero();
|
---|
41 | int bcmp();
|
---|
42 | #else
|
---|
43 | #if defined(SYSV)
|
---|
44 | #include <memory.h>
|
---|
45 | void bcopy();
|
---|
46 | #define bzero(b,len) memset(b, 0, len)
|
---|
47 | #define bcmp(b1,b2,len) memcmp(b1, b2, len)
|
---|
48 | #else
|
---|
49 | #include <string.h>
|
---|
50 | #define _XFUNCS_H_INCLUDED_STRING_H
|
---|
51 | #define bcopy(b1,b2,len) memmove(b2, b1, (size_t)(len))
|
---|
52 | #define bzero(b,len) memset(b, 0, (size_t)(len))
|
---|
53 | #define bcmp(b1,b2,len) memcmp(b1, b2, (size_t)(len))
|
---|
54 | #endif
|
---|
55 | #endif /* X_USEBFUNCS */
|
---|
56 |
|
---|
57 | /* the new Xfuncs.h */
|
---|
58 |
|
---|
59 | #if !defined(X_NOT_STDC_ENV) && (!defined(sun) || defined(SVR4))
|
---|
60 | /* the ANSI C way */
|
---|
61 | #ifndef _XFUNCS_H_INCLUDED_STRING_H
|
---|
62 | #include <string.h>
|
---|
63 | #endif
|
---|
64 | #undef bzero
|
---|
65 | #define bzero(b,len) memset(b,0,len)
|
---|
66 | #else /* else X_NOT_STDC_ENV or SunOS 4 */
|
---|
67 | #if defined(SYSV) || defined(luna) || defined(sun) || defined(__sxg__)
|
---|
68 | #include <memory.h>
|
---|
69 | #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
|
---|
70 | #if defined(SYSV) && defined(_XBCOPYFUNC)
|
---|
71 | #undef memmove
|
---|
72 | #define memmove(dst,src,len) _XBCOPYFUNC((char *)(src),(char *)(dst),(int)(len))
|
---|
73 | #define _XNEEDBCOPYFUNC
|
---|
74 | #endif
|
---|
75 | #else /* else vanilla BSD */
|
---|
76 | #define memmove(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
|
---|
77 | #define memcpy(dst,src,len) bcopy((char *)(src),(char *)(dst),(int)(len))
|
---|
78 | #define memcmp(b1,b2,len) bcmp((char *)(b1),(char *)(b2),(int)(len))
|
---|
79 | #endif /* SYSV else */
|
---|
80 | #endif /* ! X_NOT_STDC_ENV else */
|
---|
81 |
|
---|
82 | #if defined(X_NOT_STDC_ENV) || (defined(sun) && !defined(SVR4))
|
---|
83 | #define atexit(f) on_exit(f, 0)
|
---|
84 | #endif
|
---|
85 |
|
---|
86 | #endif /* !(defined(XFree86LOADER) && defined(IN_MODULE)) */
|
---|
87 |
|
---|
88 | #endif /* _XFUNCS_H_ */
|
---|