/*1* tkUnixPort.h --2*3* This file is included by all of the Tk C files. It contains4* information that may be configuration-dependent, such as5* #includes for system include files and a few other things.6*7* Copyright (c) 1991-1993 The Regents of the University of California.8* Copyright (c) 1994-1995 Sun Microsystems, Inc.9*10* See the file "license.terms" for information on usage and redistribution11* of this file, and for a DISCLAIMER OF ALL WARRANTIES.12*13* SCCS: @(#) tkUnixPort.h 1.19 96/10/02 15:40:3314*/1516#ifndef _UNIXPORT17#define _UNIXPORT1819/*20* Macro to use instead of "void" for arguments that must have21* type "void *" in ANSI C; maps them to type "char *" in22* non-ANSI systems. This macro may be used in some of the include23* files below, which is why it is defined here.24*/2526#ifndef VOID27# ifdef __STDC__28# define VOID void29# else30# define VOID char31# endif32#endif3334#include <stdio.h>35#include <ctype.h>36#include <fcntl.h>37#ifdef HAVE_LIMITS_H38# include <limits.h>39#else40# include "../compat/limits.h"41#endif42#include <math.h>43#include <pwd.h>44#ifdef NO_STDLIB_H45# include "../compat/stdlib.h"46#else47# include <stdlib.h>48#endif49#include <string.h>50#include <sys/types.h>51#include <sys/file.h>52#include <sys/stat.h>53#ifndef _TCL54# include <tcl.h>55#endif56#ifdef HAVE_UNISTD_H57# include <unistd.h>58#else59# include "../compat/unistd.h"60#endif61#if _PACKAGE_ast62# include <Xlib.h>63# include <cursorfont.h>64# include <keysym.h>65# include <Xatom.h>66# include <Xproto.h>67# include <Xresource.h>68# include <Xutil.h>69#else70# include <X11/Xlib.h>71# include <X11/cursorfont.h>72# include <X11/keysym.h>73# include <X11/Xatom.h>74# include <X11/Xproto.h>75# include <X11/Xresource.h>76# include <X11/Xutil.h>77#endif7879/*80* Not all systems declare the errno variable in errno.h. so this81* file does it explicitly.82*/8384extern int errno;8586/*87* Define "NBBY" (number of bits per byte) if it's not already defined.88*/8990#ifndef NBBY91# define NBBY 892#endif9394/*95* These macros are just wrappers for the equivalent X Region calls.96*/9798#define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)99#define TkCreateRegion() (TkRegion) XCreateRegion()100#define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)101#define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \102(Region) b, (Region) r)103#define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)104#define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)105#define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \106(Region) src, (Region) ret)107108/*109* The TkPutImage macro strips off the color table information, which isn't110* needed for X.111*/112113#define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \114XPutImage(display, pixels, gc, image, destx, desty, srcx, \115srcy, width, height);116117/*118* The following Tk functions are implemented as macros under Windows.119*/120121#define TkGetNativeProlog(interp) TkGetProlog(interp)122123/*124* Supply macros for seek offsets, if they're not already provided by125* an include file.126*/127128#ifndef SEEK_SET129# define SEEK_SET 0130#endif131132#ifndef SEEK_CUR133# define SEEK_CUR 1134#endif135136#ifndef SEEK_END137# define SEEK_END 2138#endif139140/*141* Declarations for various library procedures that may not be declared142* in any other header file.143*/144145extern void panic();146147/*148* These functions do nothing under Unix, so we just eliminate calls them.149*/150151#define TkSelUpdateClipboard(a,b) {}152#define TkSetPixmapColormap(p,c) {}153154#endif /* _UNIXPORT */155156157