#ifndef _KSFILE_H_
#define _KSFILE_H_

#define KS_FILE_BUFSIZE	128

#define KS_FILE_READ	0
#define KS_FILE_WRITE	1

#define KS_FILE_CRLF	2

typedef struct{
	int fd;
	int mode;
	int perm;

	long filesize;
	long location;

	int eof;

	int size;
	unsigned char *pos;
	unsigned char buf[KS_FILE_BUFSIZE];
}KSFile;


KSFile *KSFileOpen( unsigned char far *path, int mode );
void KSFileClose( KSFile *fp );
unsigned KSFileWrite( KSFile *fp, unsigned far *buf, unsigned len );
unsigned KSFileRead( KSFile *fp, unsigned far *buf, unsigned len);
int KSFileEOF( KSFile *fp );

#endif
