home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / lisp / stk-3.002 / stk-3 / STk-3.1 / Tk / unix / tkUnixPort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-31  |  3.2 KB  |  140 lines

  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-1995 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.  * SCCS: @(#) tkUnixPort.h 1.18 96/03/14 10:22:47
  15.  */
  16.  
  17. #ifndef _UNIXPORT
  18. #define _UNIXPORT
  19.  
  20. /*
  21.  * Macro to use instead of "void" for arguments that must have
  22.  * type "void *" in ANSI C;  maps them to type "char *" in
  23.  * non-ANSI systems.  This macro may be used in some of the include
  24.  * files below, which is why it is defined here.
  25.  */
  26.  
  27. #ifndef VOID
  28. #   ifdef __STDC__
  29. #       define VOID void
  30. #   else
  31. #       define VOID char
  32. #   endif
  33. #endif
  34.  
  35. #include <stdio.h>
  36. #include <ctype.h>
  37. #include <fcntl.h>
  38. #ifdef HAVE_LIMITS_H
  39. #   include <limits.h>
  40. #else
  41. #   include "../compat/limits.h"
  42. #endif
  43. #include <math.h>
  44. #include <pwd.h>
  45. #ifdef NO_STDLIB_H
  46. #   include "../compat/stdlib.h"
  47. #else
  48. #   include <stdlib.h>
  49. #endif
  50. #include <string.h>
  51. #include <sys/types.h>
  52. #include <sys/file.h>
  53. #include <sys/stat.h>
  54. #ifndef _TCL
  55. #   include <tcl.h>
  56. #endif
  57. #ifdef HAVE_UNISTD_H
  58. #   include <unistd.h>
  59. #else
  60. #   include "../compat/unistd.h"
  61. #endif
  62. #include <X11/Xlib.h>
  63. #include <X11/cursorfont.h>
  64. #include <X11/keysym.h>
  65. #include <X11/Xatom.h>
  66. #include <X11/Xproto.h>
  67. #include <X11/Xresource.h>
  68. #include <X11/Xutil.h>
  69.  
  70. /*
  71.  * Not all systems declare the errno variable in errno.h. so this
  72.  * file does it explicitly.
  73.  */
  74.  
  75. extern int errno;
  76.  
  77. /*
  78.  * Define "NBBY" (number of bits per byte) if it's not already defined.
  79.  */
  80.  
  81. #ifndef NBBY
  82. #   define NBBY 8
  83. #endif
  84.  
  85. /*
  86.  * These macros are just wrappers for the equivalent X Region calls.
  87.  */
  88.  
  89. #define TkClipBox(rgn, rect) XClipBox((Region) rgn, rect)
  90. #define TkCreateRegion() (TkRegion) XCreateRegion()
  91. #define TkDestroyRegion(rgn) XDestroyRegion((Region) rgn)
  92. #define TkIntersectRegion(a, b, r) XIntersectRegion((Region) a, \
  93.     (Region) b, (Region) r)
  94. #define TkRectInRegion(r, x, y, w, h) XRectInRegion((Region) r, x, y, w, h)
  95. #define TkSetRegion(d, gc, rgn) XSetRegion(d, gc, (Region) rgn)
  96. #define TkUnionRectWithRegion(rect, src, ret) XUnionRectWithRegion(rect, \
  97.     (Region) src, (Region) ret)
  98.  
  99. /*
  100.  * The TkPutImage macro strips off the color table information, which isn't
  101.  * needed for X.
  102.  */
  103.  
  104. #define TkPutImage(colors, ncolors, display, pixels, gc, image, destx, desty, srcx, srcy, width, height) \
  105.     XPutImage(display, pixels, gc, image, destx, desty, srcx, \
  106.     srcy, width, height);
  107.  
  108. /*
  109.  * Supply macros for seek offsets, if they're not already provided by
  110.  * an include file.
  111.  */
  112.  
  113. #ifndef SEEK_SET
  114. #   define SEEK_SET 0
  115. #endif
  116.  
  117. #ifndef SEEK_CUR
  118. #   define SEEK_CUR 1
  119. #endif
  120.  
  121. #ifndef SEEK_END
  122. #   define SEEK_END 2
  123. #endif
  124.  
  125. /*
  126.  * Declarations for various library procedures that may not be declared
  127.  * in any other header file.
  128.  */
  129.  
  130. extern void        panic();
  131.  
  132. /*
  133.  * These functions do nothing under Unix, so we just eliminate calls them.
  134.  */
  135.  
  136. #define TkSelUpdateClipboard(a,b) {}
  137. #define TkSetPixmapColormap(p,c) {}
  138.  
  139. #endif /* _UNIXPORT */
  140.