home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
tcltk805.zip
/
tcl805s.zip
/
tk8.0.5
/
os2
/
tkOS2Port.h
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-01
|
3KB
|
138 lines
/*
* tkOS2Port.h --
*
* This header file handles porting issues that occur because of
* differences between OS/2 and Unix. It should be the only
* file that contains #ifdefs to handle different flavors of OS.
*
* Copyright (c) 1996-2000 Illya Vaes
* Copyright (c) 1995 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
*/
#ifndef _OS2PORT
#define _OS2PORT
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#include <fcntl.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <sys/time.h>
#define strncasecmp strnicmp
#define strcasecmp stricmp
#define NBBY 8
#define OPEN_MAX 32
/*
* Define MAXPATHLEN in terms of MAXPATH if available
*/
#ifndef MAX_PATH
#define MAX_PATH CCHMAXPATH
#endif
#ifndef MAXPATH
#define MAXPATH MAX_PATH
#endif /* MAXPATH */
#ifndef MAXPATHLEN
#define MAXPATHLEN MAXPATH
#endif /* MAXPATHLEN */
/*
* The following define causes Tk to use its internal keysym hash table
*/
#define REDO_KEYSYM_LOOKUP
/*
* The following macro checks to see whether there is buffered
* input data available for a stdio FILE.
*/
#ifdef __EMX__
# define TK_READ_DATA_PENDING(f) ((f)->rcount > 0)
#elif __BORLANDC__
# define TK_READ_DATA_PENDING(f) ((f)->level > 0)
#elif __IBMC__
# define TK_READ_DATA_PENDING(f) ((f)->_count > 0)
#endif /* __EMX__ */
/*
* The following stubs implement various calls that don't do anything
* under OS/2.
*/
#define TkFreeWindowId(dispPtr,w)
#define TkInitXId(dispPtr)
#define TkpCmapStressed(tkwin,colormap) (0)
#define XFlush(display)
#define XGrabServer(display)
#define XUngrabServer(display)
#define TkpSync(display)
/*
* The following X functions are implemented as macros under OS/2.
*/
#define XFree(data) {if ((data) != NULL) ckfree((char *) (data));}
#define XNoOp(display) {display->request++;}
#define XSynchronize(display, bool) {display->request++;}
#define XSync(display, bool) {display->request++;}
#define XVisualIDFromVisual(visual) (visual->visualid)
/*
* The following Tk functions are implemented as macros under OS/2.
*/
#define TkGetNativeProlog(interp) TkGetProlog(interp)
#define TkpGetPixel(p) (((((p)->red >> 8) & 0xff) \
| ((p)->green & 0xff00) | (((p)->blue << 8) & 0xff0000)) | 0x20000000)
/*
* These calls implement native bitmaps which are not currently
* supported under OS/2. The macros eliminate the calls.
*/
#define TkpDefineNativeBitmaps()
#define TkpCreateNativeBitmap(display, source) None
#define TkpGetNativeAppBitmap(display, name, w, h) None
#ifndef __EMX__
/*
* Define timezone for gettimeofday.
*/
struct timezone {
int tz_minuteswest;
int tz_dsttime;
};
extern int gettimeofday(struct timeval *, struct timezone *);
#endif /* __EMX__ */
extern void panic _ANSI_ARGS_(TCL_VARARGS(char *,format));
#endif /* _OS2PORT */