FreeBSD 10 clang port
[oweals/cde.git] / cde / lib / DtTerm / TermPrim / TermHeader.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  * $TOG: TermHeader.h /main/3 1999/10/14 16:34:46 mgreess $";
25  */
26
27 /*                                                                      *
28  * (c) Copyright 1993, 1994, 1996 Hewlett-Packard Company               *
29  * (c) Copyright 1993, 1994, 1996 International Business Machines Corp. *
30  * (c) Copyright 1993, 1994, 1996 Sun Microsystems, Inc.                *
31  * (c) Copyright 1993, 1994, 1996 Novell, Inc.                          *
32  * (c) Copyright 1996 Digital Equipment Corporation.                    *
33  * (c) Copyright 1996 FUJITSU LIMITED.                                  *
34  * (c) Copyright 1996 Hitachi.                                          *
35  */
36
37 #ifndef _Dt_TermHeader_h
38 #define _Dt_TermHeader_h
39 #include <stdio.h>
40 #include <unistd.h>
41 #include <stdlib.h>
42 #include <ctype.h>
43 #include <sys/param.h>  /* for MIN, MAX macros */
44 #include <Xm/Xm.h>
45 #include <X11/Xos.h>
46
47 #if defined(linux) || defined(UXPArchitecture) || (defined(USL) && (OSMAJORVERSION > 1)) || defined(CSRG_BASED)
48 #define _NFILE   FOPEN_MAX
49 #endif
50
51 #ifndef MIN
52 #define MIN(a,b)        (((a) > (b)) ? (b) : (a))
53 #endif  /* MIN */
54 #ifndef MAX
55 #define MAX(a,b)        (((a) < (b)) ? (b) : (a))
56 #endif  /* MAX */
57
58 /********    Conditionally defined macros for thread_safe DtTerm ******/
59 #ifdef XTHREADS
60 #define _DtTermWidgetToAppContext(w) \
61         XtAppContext app = XtWidgetToApplicationContext(w)
62 #define _DtTermDisplayToAppContext(d) \
63         XtAppContext app = XtDisplayToApplicationContext(d)
64 #define _DtTermAppLock(app) XtAppLock(app)
65 #define _DtTermAppUnlock(app) XtAppUnlock(app)
66 #define _DtTermProcessLock() XtProcessLock()
67 #define _DtTermProcessUnlock() XtProcessUnlock()
68 #else /* XTHREADS */
69 #define _DtTermWidgetToAppContext(w)
70 #define _DtTermDisplayToAppContext(d)
71 #define _DtTermAppLock(app)
72 #define _DtTermAppUnlock(app)
73 #define _DtTermProcessLock()
74 #define _DtTermProcessUnlock()
75 #endif /* XTHREADS */
76
77 #endif  /* _Dt_TermHeader_h */
78 /* DON'T ADD ANYTHING AFTER THIS #endif... */