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 / win / tkWinPort.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-14  |  2.0 KB  |  92 lines

  1. /*
  2.  * winPort.h --
  3.  *
  4.  *    This header file handles porting issues that occur because of
  5.  *    differences between Windows and Unix. It should be the only
  6.  *    file that contains #ifdefs to handle different flavors of OS.
  7.  *
  8.  * Copyright (c) 1995 Sun Microsystems, Inc.
  9.  *
  10.  * See the file "license.terms" for information on usage and redistribution
  11.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  12.  *
  13.  * SCCS: @(#) tkWinPort.h 1.9 96/04/12 18:07:38
  14.  */
  15.  
  16. #ifndef _WINPORT
  17. #define _WINPORT
  18.  
  19. #include <X11/Xlib.h>
  20. #include <X11/cursorfont.h>
  21. #include <X11/keysym.h>
  22. #include <X11/Xatom.h>
  23. #include <X11/Xutil.h>
  24.  
  25. #include <malloc.h>
  26. #include <errno.h>
  27. #include <ctype.h>
  28. #include <math.h>
  29. #include <stdlib.h>
  30. #include <string.h>
  31. #include <limits.h>
  32. #include <fcntl.h>
  33. #include <io.h>
  34. #include <sys/stat.h>
  35. #include <time.h>
  36.  
  37. #ifdef _MSC_VER
  38. #    define strncasecmp strnicmp
  39. #    define hypot _hypot
  40. #else /* _MSC_VER */
  41. #    define strncasecmp strncmpi
  42. #endif /* _MSC_VER */
  43.  
  44. #define NBBY 8
  45.  
  46. #define OPEN_MAX 32
  47.  
  48. /*
  49.  * The following define causes Tk to use its internal keysym hash table
  50.  */
  51.  
  52. #define REDO_KEYSYM_LOOKUP
  53.  
  54. /*
  55.  * The following macro checks to see whether there is buffered
  56.  * input data available for a stdio FILE.
  57.  */
  58.  
  59. #ifdef _MSC_VER
  60. #    define TK_READ_DATA_PENDING(f) ((f)->_cnt > 0)
  61. #else /* _MSC_VER */
  62. #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)
  63. #endif /* _MSC_VER */
  64.  
  65. /*
  66.  * The following stubs implement various X calls that don't do anything
  67.  * under Windows.
  68.  */
  69.  
  70. #define XFlush(display)
  71. #define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
  72. #define XGrabServer(display)
  73. #define XNoOp(display) {display->request++;}
  74. #define XUngrabServer(display)
  75. #define XSynchronize(display, bool) {display->request++;}
  76. #define XSync(display, bool) {display->request++;}
  77. #define XVisualIDFromVisual(visual) (visual->visualid)
  78.  
  79. /*
  80.  * Define timezone for gettimeofday.
  81.  */
  82.  
  83. struct timezone {
  84.     int tz_minuteswest;
  85.     int tz_dsttime;
  86. };
  87.  
  88. extern int gettimeofday(struct timeval *, struct timezone *);
  89. extern void panic();
  90.  
  91. #endif /* _WINPORT */
  92.