home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tkisrc04.zip / tk / os2 / tkOS2Port.h < prev    next >
C/C++ Source or Header  |  1998-08-07  |  2KB  |  96 lines

  1. /*
  2.  * tkOS2Port.h --
  3.  *
  4.  *    This header file handles porting issues that occur because of
  5.  *    differences between OS/2 and Unix. It should be the only
  6.  *    file that contains #ifdefs to handle different flavors of OS.
  7.  *
  8.  * Copyright (c) 1996-1997 Illya Vaes
  9.  * Copyright (c) 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.  */
  15.  
  16. #ifndef _OS2PORT
  17. #define _OS2PORT
  18.  
  19. #include <stdarg.h>
  20. #include <stdio.h>
  21. #include <stdlib.h>
  22. #include <malloc.h>
  23. #include <ctype.h>
  24. #include <math.h>
  25. #include <string.h>
  26. #include <limits.h>
  27. #include <fcntl.h>
  28. #include <io.h>
  29. #include <sys/types.h>
  30. #include <sys/stat.h>
  31. #include <time.h>
  32. #include <sys/time.h>
  33.  
  34. #include <X11/Xlib.h>
  35. #include <X11/cursorfont.h>
  36. #include <X11/keysym.h>
  37. #include <X11/Xatom.h>
  38. #include <X11/Xutil.h>
  39.  
  40. #define strncasecmp strnicmp
  41.  
  42. #define NBBY 8
  43.  
  44. #define OPEN_MAX 32
  45.  
  46. /*
  47.  * The following define causes Tk to use its internal keysym hash table
  48.  */
  49.  
  50. #define REDO_KEYSYM_LOOKUP
  51.  
  52. /*
  53.  * The following macro checks to see whether there is buffered
  54.  * input data available for a stdio FILE.
  55.  */
  56.  
  57. #ifdef __EMX__
  58. #    define TK_READ_DATA_PENDING(f) ((f)->rcount > 0)
  59. #elif __BORLANDC__
  60. #    define TK_READ_DATA_PENDING(f) ((f)->level > 0)
  61. #elif __IBMC__
  62. #    define TK_READ_DATA_PENDING(f) ((f)->_count > 0)
  63. #endif /* __EMX__ */
  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. /*MM* del #ifndef __EMX__ */
  80. #if !defined(__EMX__) && !defined(__IBMC__)
  81.  
  82. /*
  83.  * Define timezone for gettimeofday.
  84.  */
  85. struct timezone {
  86.     int tz_minuteswest;
  87.     int tz_dsttime;
  88. };
  89. extern int gettimeofday(struct timeval *, struct timezone *);
  90.  
  91. #endif /* __EMX__ */
  92.  
  93. extern void panic();
  94.  
  95. #endif /* _OS2PORT */
  96.