home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_07
/
LATTIC_3.ZIP
/
HEADERS
/
DOS.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-11
|
5KB
|
210 lines
/*
* dos.h - interface between compiler and OS
*
* Started 27/8/89 Alex G. Kiernan
*
* Copyright (c) 1989 HiSoft
*/
#ifndef _DOS_H
#define _DOS_H
#include <osbind.h>
#include <conio.h>
#include <basepage.h>
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned long int size_t;
#endif
/*
*
* The following definitions specify the particular C compiler being used.
*
* LATTICE Lattice C compiler
*
*/
#define LATTICE 1
#define LATTICE_V4 1
#define LATTICE_V5 1
/*
*
* The following type definitions take care of the particularly nasty
* machine dependency caused by the unspecified handling of sign extension
* in the C language. When converting "char" to "int" some compilers
* will extend the sign, while others will not. Both are correct, and
* the unsuspecting programmer is the loser. For situations where it
* matters, the new type "byte" is equivalent to "unsigned char".
*
*/
typedef unsigned char byte;
/*
*
* Miscellaneous definitions
*
*/
#define SECSIZ 512 /* disk sector size */
/*
*
* OS specific definitions
*
*/
extern short _tos; /* tos version number */
extern enum {USA,FRG,FRA,GBR,SPA,ITA,SWE,SWF,SWG,TUR,FIN,NOR,DEN,SAU,HOL} _country;
/*
*
* The following symbols define the sizes of file names and node names.
*
*/
#define FNSIZE 13 /* maximum file node size */
#define FMSIZE 128 /* maximum file name size */
#define FESIZE 4 /* maximum file extension size */
/*
*
* This structure contains disk size information returned by the getdfs
* function.
*/
struct DISKINFO
{
unsigned long free; /* number of free clusters */
unsigned long cpd; /* clusters per drive */
unsigned long bps; /* bytes per sector */
unsigned long spc; /* sectors per cluster */
};
/*
*
* The following structure is used by the dfind and dnext functions to
* hold file information.
*
*/
struct FILEINFO
{
char resv[21]; /* reserved */
char attr; /* actual file attribute */
long time; /* file time and date */
long size; /* file size in bytes */
char name[14]; /* file name */
};
extern size_t _MSTEP;
extern long _MNEED;
/*
* Ctrl-C checking master switch variable
*/
extern int __chkabort; /* defaults to 0, i.e. OFF */
/*
* I/O services
*/
/* hidden by #defines */
long _dclose(int);
long _dcreat(const char *, int);
long _dopen(const char *, int);
int getcd(int, char *);
int getfa(const char *);
int chgfa(const char *, int);
int getdsk(void);
__regargs long _CXCERR(long); /* always __regargs for efficiency */
#ifndef __NO_DOS_DEFINES
#define _dclose(hand) _CXCERR(Fclose(hand))
#define _dcreat(name,prot) _CXCERR(Fcreate(name,prot))
#define _dopen(name,mode) _CXCERR(Fopen(name,mode))
#define getfa(name) ((int)_CXCERR(Fattrib(name,0,0)))
#define chgfa(name,fa) ((int)_CXCERR(Fattrib(name,1,fa)))
#define getdsk() ((int)_CXCERR(Dgetdrv()))
#endif
long _dcreatx(const char *, int);
long _dread(int, void *, long);
long _dwrite(int, const void *, long);
long _dseek(int, long, int);
int _disatty(int);
int _ddup(int);
int _ddup2(int, int);
#ifndef __NO_DOS_DEFINES
#define _ddup(x) ((int)_CXCERR(Fdup(x)))
#define _ddup2(x,y) ((int)_CXCERR(Fforce(x,y)))
#endif
int chgdsk(int);
void chgdta(struct FILEINFO *);
struct FILEINFO *getdta(void);
#ifndef __NO_DOS_DEFINES
#define chgdsk(a) ((int)Dsetdrv(a))
#define chgdta(a) ((void)(Fsetdta(a)))
#define getdta() ((struct FILEINFO *)_CXCERR(Fgetdta()))
#endif
int dfind(struct FILEINFO *, const char *, int);
int dnext(struct FILEINFO *);
int getdfs(int,struct DISKINFO *);
#ifndef __NO_DOS_DEFINES
#define getdfs(a,b) ((int)_CXCERR(Dfree((long *)b,a)))
#endif
long getft(int);
int chgft(int, long);
/*
*
* Miscellaneous external definitions
*
*/
long ftpack(const char *);
void ftunpk(long, char *);
int getpf(char *,const char *);
int getpfe(char *,const char *);
__stdargs void _stub(void);
__stdargs void _xcovf(void);
void getclk(unsigned char *);
int chgclk(unsigned char *);
int onbreak(int (*)());
void onerror(int);
int poserr(const char *);
extern long volatile _oserr;
extern long volatile _OSERR;
extern unsigned long int _STACK;
#define geta4 __builtin_geta4
extern void geta4(void);
#define getreg __builtin_getreg
extern long getreg(int);
#define putreg __builtin_putreg
extern void putreg(int, long);
#define __emit __builtin_emit
extern void __emit(int);
#define REG_D0 0
#define REG_D1 1
#define REG_D2 2
#define REG_D3 3
#define REG_D4 4
#define REG_D5 5
#define REG_D6 6
#define REG_D7 7
#define REG_A0 8
#define REG_A1 9
#define REG_A2 10
#define REG_A3 11
#define REG_A4 12
#define REG_A5 13
#define REG_A6 14
#define REG_A7 15
#endif