home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_07
/
LATTIC_3.ZIP
/
HEADERS
/
FCNTL.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-21
|
3KB
|
106 lines
/*
* fcntl.h - level 1 I/O interface file
*
* Started 28/8/89 Alex G. Kiernan, based on Lattice source
*
* Copyright (c) 1989 HiSoft and Lattice, Inc.
*/
#ifndef _FCNTL_H
#define _FCNTL_H
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned long int size_t;
#endif
/*
*
* The following symbols are used for the "open" and "creat" functions.
* They are generally UNIX-compatible, except for O_APPEND under MSDOS,
* which has been moved in order to accomodate the file sharing flags
* defined in MSDOS Version 3.
*
*/
#define O_RDONLY 0 /* Read-only value (right byte of mode word) */
#define O_WRONLY 1 /* Write-only value */
#define O_RDWR 2 /* Read-write value */
#define O_NDELAY 0 /* Non-blocking I/O flag (N/A) */
#define O_APPEND 8 /* Append mode flag */
#define O_CREAT 0x0100 /* File creation flag */
#define O_TRUNC 0x0200 /* File truncation flag */
#define O_EXCL 0x0400 /* Exclusive access flag */
#define O_RAW 0x8000 /* Raw I/O flag (Lattice feature) */
#define O_BINARY O_RAW /* popular synonym */
/*
*
* The following flags are used to establish the protection mode.
*
*/
#define S_IREAD 0000400
#define S_IWRITE 0000200
#define S_IEXEC 0000100
/*
*
* The following symbols are used for the "fcntl" function.
*
*/
#define F_DUPFD 0 /* Duplicate file descriptor */
#define F_GETFD 1 /* Get file descriptor flags */
#define F_SETFD 2 /* Set file descriptor flags */
#define F_GETFL 3 /* Get file flags */
#define F_SETFL 4 /* Set file flags */
/*
*
* External definitions
*
*/
int open(const char *, int, ...);
int opene(const char *, int, int, char *);
long read(int, void *, size_t);
long write(int, const void *, size_t);
int creat(const char *, int);
long lseek(int, long, int);
long tell(int);
int close(int);
int iomode(int, int);
int isatty(int);
long filelength(int);
#ifndef __NO_FCNTL_DEFINES
#define creat(name, prot) open(name,O_WRONLY|O_TRUNC|O_CREAT|(prot & O_RAW),(prot & ~O_RAW))
#endif
#undef rename
int rename(const char *,const char *);
#ifndef __NO_FCNTL_DEFINES
long _lgscc(int,int,const char *,const char *);
#pragma inline d0=_lgscc((short),(short),,) {register d2,a2; "4e41";}
#define rename(x,y) _CXCERR(_lgscc(0x56,0,x,y))
#endif
#undef remove
int remove(const char *);
#ifndef __NO_FCNTL_DEFINES
long _lgc(int,const char *);
#pragma inline d0=_lgc((short),) {register d2,a2; "4e41";}
#define remove(x) _CXCERR(_lgc(0x41,x))
#endif
#undef unlink
int unlink(const char *);
#ifndef __NO_FCNTL_DEFINES
#define unlink remove
#endif
#define NULL ((void *)0)
#endif