#ifndef SUNWINH
#define SUNWINH
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <fcntl.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define GHND            	3
#define GMEM_FIXED        	4
#define MB_ICONSTOP       	7
#define IDNO            	8
#define MB_YESNO          	9
#define _LK_NBLCK          10
#define _LK_UNLCK          11
#define _LK_LOCK           12
//#define _O_CREAT           13
//#define _O_TRUNC           14
//#define _O_BINARY          15
//#define _O_RDWR            16
//#define O_BINARY        	5
//#define _S_IWRITE        	6


#define _O_BINARY    0
#define  O_BINARY    0
#define OF_SHARE_DENY_NONE	0

#define READ_WRITE   O_RDWR        
#define _S_IWRITE    S_IWRITE          
#define _O_CREAT     O_CREAT 
#define _O_TRUNC     O_TRUNC 
#define _O_RDWR      O_RDWR  


#define MB_OK              17
typedef char *LPSTR;
typedef short int INT16;
typedef unsigned short int UINT16;
typedef long INT32;
typedef unsigned long UINT32;
typedef unsigned short int HWND,HINSTANCE,HDC,HANDLE;
typedef unsigned char BYTE;
typedef unsigned short int WORD;
typedef unsigned long ULONG;
HANDLE GlobalAlloc(UINT16,long);
void *GlobalLock(HANDLE);
HANDLE GlobalFree(HANDLE);
UINT16 GlobalUnlock(HANDLE);
int GlobalFreePtr(void *);
UINT16 MessageBox(HWND,char *,char *,UINT16);
char *_getcwd(char *buf,int len);
UINT16 _lwrite(int , void *, UINT16);
UINT16 _lread(int , void *, UINT16);
UINT16 _read(int , void *, UINT16);
long _hread(int , void *, long);
long _hwrite(int , void *, long);
UINT16 _lclose(int);
UINT16 _close(int);
long _lseek(int,int,int);
long _tell(int);
int _lopen(char *FileName,long flags);
int _stricmp(char *,char *);
int _strnicmp(char *,char *,int);
int _lcreat(char *FileName,long createflag);
int _open(char *FileName,long openflag,long permitflag);
int _open(char *FileName,long openflag);
char *_getcwd(char *, int len);
int _chsize(int handle,long);
int _chdir(char *);
int _mkdir(char *);

struct _diskfree_t
 {
  unsigned  long  avail_clusters;
  unsigned  long  total_clusters;
  unsigned  long  sectors_per_cluster;
  unsigned  long  bytes_per_sector;
 } ;
unsigned short int _dos_getdiskfree(int driveno,struct _diskfree_t *);


struct dosdate_t
 {
  unsigned  char day;
  unsigned  char month;
  unsigned  short int year;
  unsigned  char dayofweek;
 } ;
unsigned short int _dos_getdate(struct dosdate_t *);

int _locking(int FileHandle,long flags,long timeout); 
long double _atold(char *);
int _chdrive(int);
#endif
extern int _osmajor; 

