
/*  MRARPFile.h
 *  Definitions for ARP extended file support.
 *  Author: Mark R. Rinfret
 */
#ifndef MRARPFILE_H
#define MRARPFILE_H

#include <libraries/arpbase.h>
#include <libraries/dosextens.h>


typedef struct {
    BPTR                fh;             /* AmigaDOS FileHandle pointer */
    struct DefaultTracker *fileTracker;
    struct DefaultTracker *myTracker;   /* this structure's tracker */
    struct DefaultTracker *bufTracker;
    UBYTE               *buf;           /* read/write buffer */
    LONG                bufSize;        /* allocated size of buffer */
    LONG                bufLength;      /* number of bytes in buffer */
    LONG                bufPos;         /* read/write position */
    LONG                mode;           /* how file was opened */
    LONG                lastError;      /* last error code encountered */
    LONG                lastPosition;   /* position of last access */
    WORD                endOfFile;      /* used by FRead, FGets */
    } ARPFileHandle;

/* Function declarations: */

char *FGetsARP ARGs(( char *s, LONG length, ARPFileHandle *file));
LONG FPutsARP  ARGs(( char *s, ARPFileHandle *file ));
LONG ReadARPFile ARGs(( ARPFileHandle *file, UBYTE *buffer, LONG length));
LONG CloseARPFile ARGs(( ARPFileHandle *file ));
ARPFileHandle *OpenARPFile ARGs(( char *name, LONG accessMode, LONG bytes ));
LONG SeekARPFile ARGs(( ARPFileHandle *file, LONG position, LONG mode ));
LONG WriteARPFile ARGs(( ARPFileHandle *file, UBYTE *buffer, LONG length ));
ARPFileHandle *GetFile ARGs(( char *prompt, LONG mode, LONG bufferSize ));

#endif