| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
#ifndef _UNIXPORT |
| 18 |
#define _UNIXPORT |
| 19 |
|
| 20 |
#define __UNIX__ 1 |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
#ifndef VOID |
| 30 |
# ifdef __STDC__ |
| 31 |
# define VOID void |
| 32 |
# else |
| 33 |
# define VOID char |
| 34 |
# endif |
| 35 |
#endif |
| 36 |
|
| 37 |
#include <ctype.h> |
| 38 |
#include <fcntl.h> |
| 39 |
#ifdef HAVE_LIMITS_H |
| 40 |
# include <limits.h> |
| 41 |
#else |
| 42 |
# include "compat/limits.h" |
| 43 |
#endif |
| 44 |
#include <math.h> |
| 45 |
#include <pwd.h> |
| 46 |
#ifdef NO_STDLIB_H |
| 47 |
# include "compat/stdlib.h" |
| 48 |
#else |
| 49 |
# include <stdlib.h> |
| 50 |
#endif |
| 51 |
#include <string.h> |
| 52 |
#include <sys/types.h> |
| 53 |
#include <sys/file.h> |
| 54 |
#ifdef HAVE_SYS_SELECT_H |
| 55 |
# include <sys/select.h> |
| 56 |
#endif |
| 57 |
#include <sys/stat.h> |
| 58 |
#ifdef HAVE_SYS_TIME_H |
| 59 |
#include <sys/time.h> |
| 60 |
#endif |
| 61 |
#ifndef _LANG |
| 62 |
# include "Lang.h" |
| 63 |
#endif |
| 64 |
#if 0 |
| 65 |
#if TIME_WITH_SYS_TIME |
| 66 |
# include <sys/time.h> |
| 67 |
# include <time.h> |
| 68 |
#else |
| 69 |
# if HAVE_SYS_TIME_H |
| 70 |
# include <sys/time.h> |
| 71 |
# else |
| 72 |
# include <time.h> |
| 73 |
# endif |
| 74 |
#endif |
| 75 |
#endif |
| 76 |
#if TIME_WITH_SYS_TIME |
| 77 |
# include <sys/time.h> |
| 78 |
# include <time.h> |
| 79 |
#else |
| 80 |
# if HAVE_SYS_TIME_H |
| 81 |
# include <sys/time.h> |
| 82 |
# else |
| 83 |
# include <time.h> |
| 84 |
# endif |
| 85 |
#endif |
| 86 |
#ifdef HAVE_UNISTD_H |
| 87 |
# include <unistd.h> |
| 88 |
#else |
| 89 |
# include "compat/unistd.h" |
| 90 |
#endif |
| 91 |
#include <X11/Xlib.h> |
| 92 |
#include <X11/cursorfont.h> |
| 93 |
#include <X11/keysym.h> |
| 94 |
#include <X11/Xatom.h> |
| 95 |
#include <X11/Xproto.h> |
| 96 |
#include <X11/Xresource.h> |
| 97 |
#include <X11/Xutil.h> |
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
#ifndef NO_FD_SET |
| 105 |
# define SELECT_MASK fd_set |
| 106 |
#else |
| 107 |
# ifndef _AIX |
| 108 |
typedef long fd_mask; |
| 109 |
# endif |
| 110 |
# if defined(_IBMR2) |
| 111 |
# define SELECT_MASK void |
| 112 |
# else |
| 113 |
# define SELECT_MASK int |
| 114 |
# endif |
| 115 |
#endif |
| 116 |
|
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
#ifndef FD_SETSIZE |
| 122 |
# ifdef OPEN_MAX |
| 123 |
# define FD_SETSIZE OPEN_MAX |
| 124 |
# else |
| 125 |
# define FD_SETSIZE 256 |
| 126 |
# endif |
| 127 |
#endif |
| 128 |
#if !defined(howmany) |
| 129 |
# define howmany(x, y) (((x)+((y)-1))/(y)) |
| 130 |
#endif |
| 131 |
#ifndef NFDBITS |
| 132 |
# define NFDBITS NBBY*sizeof(fd_mask) |
| 133 |
#endif |
| 134 |
#define MASK_SIZE howmany(FD_SETSIZE, NFDBITS) |
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
#include <errno.h> |
| 142 |
#ifndef errno |
| 143 |
extern int errno; |
| 144 |
#endif |
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
#ifndef NBBY |
| 151 |
# define NBBY 8 |
| 152 |
#endif |
| 153 |
|
| 154 |
|
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect) |
| 159 |
#define TkCreateRegion() (TkRegion) XCreateRegion() |
| 160 |
#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn) |
| 161 |
#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \ |
| 162 |
(Region) b, (Region) r) |
| 163 |
#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h) |
| 164 |
#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn) |
| 165 |
#define TkSubtractRegion(a, b, r) XSubtractRegion((Region) a, \ |
| 166 |
(Region) b, (Region) r) |
| 167 |
#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \ |
| 168 |
(Region) src, (Region) ret) |
| 169 |
|
| 170 |
|
| 171 |
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
#define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \ |
| 176 |
XPutImage(display, pixels, gc, image, destx, desty, srcx, \ |
| 177 |
srcy, width, height); |
| 178 |
|
| 179 |
|
| 180 |
|
| 181 |
|
| 182 |
|
| 183 |
|
| 184 |
#ifndef SEEK_SET |
| 185 |
# define SEEK_SET 0 |
| 186 |
#endif |
| 187 |
|
| 188 |
#ifndef SEEK_CUR |
| 189 |
# define SEEK_CUR 1 |
| 190 |
#endif |
| 191 |
|
| 192 |
#ifndef SEEK_END |
| 193 |
# define SEEK_END 2 |
| 194 |
#endif |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
|
| 200 |
|
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
#define TkpButtonSetDefaults(specPtr) {} |
| 207 |
#define TkpDestroyButton(butPtr) {} |
| 208 |
#define TkSelUpdateClipboard(a,b) {} |
| 209 |
#define TkSetPixmapColormap(p,c) {} |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
#define TkpDefineNativeBitmaps() |
| 217 |
#define TkpCreateNativeBitmap(display, source) None |
| 218 |
#define TkpGetNativeAppBitmap(display, name, w, h) None |
| 219 |
|
| 220 |
|
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
|
| 225 |
#define TkpPrintWindowId(buf,w) \ |
| 226 |
sprintf((buf), "%#08lx", (unsigned long) (w)) |
| 227 |
|
| 228 |
|
| 229 |
|
| 230 |
|
| 231 |
|
| 232 |
|
| 233 |
#define ALWAYS_SHOW_SELECTION |
| 234 |
|
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
#ifndef _TCLINT |
| 241 |
#include <tclInt.h> |
| 242 |
#endif |
| 243 |
|
| 244 |
#endif |
| 245 |
|