comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tkUnixPort.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 /*
2 * tkUnixPort.h --
3 *
4 * This file is included by all of the Tk C files. It contains
5 * information that may be configuration-dependent, such as
6 * #includes for system include files and a few other things.
7 *
8 * Copyright (c) 1991-1993 The Regents of the University of California.
9 * Copyright (c) 1994-1996 Sun Microsystems, Inc.
10 *
11 * See the file "license.terms" for information on usage and redistribution
12 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 */
14
15 #ifndef _UNIXPORT
16 #define _UNIXPORT
17
18 #define __UNIX__ 1
19
20 #include <stdio.h>
21 #include <pwd.h>
22 #include <assert.h>
23 #include <errno.h>
24 #include <fcntl.h>
25 #include <ctype.h>
26 #include <math.h>
27 #include <string.h>
28 #include <limits.h>
29 #ifdef NO_STDLIB_H
30 # include "../compat/stdlib.h"
31 #else
32 # include <stdlib.h>
33 #endif
34 #include <sys/types.h>
35 #include <sys/file.h>
36 #ifdef HAVE_SYS_SELECT_H
37 # include <sys/select.h>
38 #endif
39 #include <sys/stat.h>
40 #ifndef _TCL
41 # include <tcl.h>
42 #endif
43 #ifdef TIME_WITH_SYS_TIME
44 # include <sys/time.h>
45 # include <time.h>
46 #else
47 # ifdef HAVE_SYS_TIME_H
48 # include <sys/time.h>
49 # else
50 # include <time.h>
51 # endif
52 #endif
53 #ifdef HAVE_INTTYPES_H
54 # include <inttypes.h>
55 #endif
56 #ifndef NO_UNISTD_H
57 # include <unistd.h>
58 #else
59 # include "../compat/unistd.h"
60 #endif
61 #if defined(__GNUC__) && !defined(__cplusplus)
62 # pragma GCC diagnostic ignored "-Wc++-compat"
63 #endif
64 #include <X11/Xlib.h>
65 #include <X11/cursorfont.h>
66 #include <X11/keysym.h>
67 #include <X11/Xatom.h>
68 #include <X11/Xproto.h>
69 #include <X11/Xresource.h>
70 #include <X11/Xutil.h>
71
72 /*
73 * The following macro defines the type of the mask arguments to
74 * select:
75 */
76
77 #ifndef NO_FD_SET
78 # define SELECT_MASK fd_set
79 #else
80 # ifndef _AIX
81 typedef long fd_mask;
82 # endif
83 # if defined(_IBMR2)
84 # define SELECT_MASK void
85 # else
86 # define SELECT_MASK int
87 # endif
88 #endif
89
90 /*
91 * The following macro defines the number of fd_masks in an fd_set:
92 */
93
94 #ifndef FD_SETSIZE
95 # ifdef OPEN_MAX
96 # define FD_SETSIZE OPEN_MAX
97 # else
98 # define FD_SETSIZE 256
99 # endif
100 #endif
101 #if !defined(howmany)
102 # define howmany(x, y) (((x)+((y)-1))/(y))
103 #endif
104 #ifndef NFDBITS
105 # define NFDBITS NBBY*sizeof(fd_mask)
106 #endif
107 #define MASK_SIZE howmany(FD_SETSIZE, NFDBITS)
108
109 /*
110 * Define "NBBY" (number of bits per byte) if it's not already defined.
111 */
112
113 #ifndef NBBY
114 # define NBBY 8
115 #endif
116
117 #ifdef __CYGWIN__
118 # include "tkIntXlibDecls.h"
119 # define UINT unsigned int
120 # define HWND void *
121 # define HDC void *
122 # define HINSTANCE void *
123 # define COLORREF void *
124 # define HMENU void *
125 # define TkWinDCState void
126 # define HPALETTE void *
127 # define WNDPROC void *
128 # define WPARAM void *
129 # define LPARAM void *
130 # define LRESULT void *
131
132 #else /* !__CYGWIN__ */
133 /*
134 * The TkPutImage macro strips off the color table information, which isn't
135 * needed for X.
136 */
137
138 # define TkPutImage(colors, ncolors, display, pixels, gc, image, srcx, srcy, destx, desty, width, height) \
139 XPutImage(display, pixels, gc, image, srcx, srcy, destx, \
140 desty, width, height);
141
142 #endif /* !__CYGWIN__ */
143
144 /*
145 * Supply macros for seek offsets, if they're not already provided by
146 * an include file.
147 */
148
149 #ifndef SEEK_SET
150 # define SEEK_SET 0
151 #endif
152
153 #ifndef SEEK_CUR
154 # define SEEK_CUR 1
155 #endif
156
157 #ifndef SEEK_END
158 # define SEEK_END 2
159 #endif
160
161 /*
162 * Declarations for various library procedures that may not be declared
163 * in any other header file.
164 */
165
166
167 /*
168 * These functions do nothing under Unix, so we just eliminate calls to them.
169 */
170
171 #define TkpButtonSetDefaults() {}
172 #define TkpDestroyButton(butPtr) {}
173 #define TkSelUpdateClipboard(a,b) {}
174 #ifndef __CYGWIN__
175 #define TkSetPixmapColormap(p,c) {}
176 #endif
177
178 /*
179 * These calls implement native bitmaps which are not supported under
180 * UNIX. The macros eliminate the calls.
181 */
182
183 #define TkpDefineNativeBitmaps()
184 #define TkpCreateNativeBitmap(display, source) None
185 #define TkpGetNativeAppBitmap(display, name, w, h) None
186
187 /*
188 * This macro stores a representation of the window handle in a string.
189 * This should perhaps use the real size of an XID.
190 */
191
192 #ifndef __CYGWIN__
193 #define TkpPrintWindowId(buf,w) \
194 sprintf((buf), "0x%08lx", (unsigned long) (w))
195 #endif
196
197 #endif /* _UNIXPORT */