1
0
mirror of https://github.com/RevCurtisP/C02.git synced 2024-11-24 15:31:17 +00:00
C02/include/fileio.h02

170 lines
5.1 KiB
Plaintext

/***************************************
* fileio - File I/O Functions for C02 *
* Non-Functional Template Header *
***************************************/
#define DRIVES 0 //Number of Disk Drives
const char drive[];
#define DISKS 0 //Number of Drives in Disk
const char disk[];
/* File Open Modes */
#define MWRITE $80 //Open File for Write
#define MREAD $00 //Open File for Read
/* File Load Modes */
#define MRELCT $00 //Relocate (Load at Specified Address)
#define MABSLT $80 //Absolute (Load at Address in File Header)
/* File Close *
* Closes File Opened on Channel *
* Args: char f - File Channel *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented */
char fclose();
/* End of File *
* Check for End of File Condition *
* Args: char f - File Channel *
* Returns: char e = EOF Indicator *
* (0 if not at end of file *
* 255 if at end of file *
* or non-zero Error code) */
char feof();
/* File Error *
* Check File Error Indicator *
* Args: char c - channel *
* int &s - error msg buffer *
* Returns: char l - Last Error *
* char e - Error, 0=None *
* 255 = Not Implemented */
char ferror();
/* File Flush *
* Flush File Output Buffer *
* Args: char f - File Channel *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented */
char fflush();
/* File Get Character *
* Args: char f - File Channel *
* Read Character from Fie *
* Returns: char c - Character *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fgetc();
/* File Get String *
* Read line of up to 128 *
* characters from file *
* Args: char f - File Channel *
* int &s - String to Read *
* Returns: char n - Characters Read *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fgets();
/* File Load *
* Loads File into Memory *
* Setup: fsname(&filename) *
* fsaddr(address) *
* Args: char d - Options | Device *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented *
* int la - Load Address */
char fload();
/* File Open *
* Open Specified File *
* Args: char d - Options | Device *
^ int &n - Filename *
* Returns: char c - Channel (0=Error) *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fopen();
/* File Put Character *
* Write Character to File *
* Args: char c - Character *
* char f - File Channel *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented */
char fputc();
/* File Put Line *
* Write string followed by *
* newline to file *
* Args: char f - File Channel *
* int &s - String to Write *
* Returns: char n - Characters Written *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fputln();
/* File Put String *
* Writes up to 128 characters *
* of string to file *
* Args: char f - File Channel *
* int &s - String to Write *
* Returns: char n - Characters Written *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fputs();
/* File Read *
* Read up to n bytes from file *
* Setup: fsaddr(&array) *
* Args: char f - File Channel *
* char n - Number of Bytes *
* Returns: char r - Bytes Read *
* char e - Error, 0=None *
* 255 = Not Implemented */
char fread();
/* File Set Address *
* Set Buffer or Start Address *
* Args: int addr - Address */
char fsaddr();
/* File Save *
* Save File from Memory *
* Setup: fsname(&filename) *
* fsaddr(start) *
* Args: char d - Options | Device *
* int end - End Address *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented */
char fsave();
/* File System Init *
* Initialize File System */
char fsinit();
/* File Set Name *
* Set Filename Address *
* Args: int &name - Filename */
char fsname();
/* File Write *
* Write n nytes to file *
* Setup: fsaddr(&array) *
* Args: char n - Number of Bytes *
* char f - File Channel *
* Returns: char n - Bytes Written *
* Returns: char e - Error, 0=None *
* 255 = Not Implemented */
char fwrite();
/* End of File *
* Check for End of File Condition *
* Args: fp - file pointer *
* Returns: EOF Indicator *
* (0 if not at end of file *
* 255 if not implemented *
* or non-zero EOF value) */
char feof();