mirror of
https://github.com/RevCurtisP/C02.git
synced 2024-12-01 14:51:52 +00:00
108 lines
3.3 KiB
Plaintext
108 lines
3.3 KiB
Plaintext
|
/******************************************
|
||
|
* file - Standard File Functions for C02 *
|
||
|
******************************************/
|
||
|
|
||
|
/* Initialize File System *
|
||
|
char fsinit();
|
||
|
|
||
|
/* Get Next Available File Pointer *
|
||
|
* Returns: file pointer *
|
||
|
0 if none available */
|
||
|
char fsptr();
|
||
|
|
||
|
/* Check File Pointer *
|
||
|
* Args: fp - file pointer *
|
||
|
* Returns: 0 if valid *
|
||
|
255 if invalid */
|
||
|
char fschk();
|
||
|
|
||
|
/* Get File Pointer Status *
|
||
|
* Args: fp - file pointer *
|
||
|
* Returns: last READST result if fp = 0 *
|
||
|
* 255 if fp > FOMAX *
|
||
|
* file table entry, otherwise */
|
||
|
char fstat();
|
||
|
|
||
|
/* Open File *
|
||
|
* Args: fd - device number *
|
||
|
* &f - string containing filename *
|
||
|
* Returns: file pointer if successful *
|
||
|
0 if an error occurs */
|
||
|
char fopen();
|
||
|
|
||
|
/* Close File *
|
||
|
* Args: fp - file pointer *
|
||
|
* Returns: 0 if successful *
|
||
|
255 if an error occurred */
|
||
|
char fclose();
|
||
|
|
||
|
/* Close All Files *
|
||
|
* Returns: system dependent error number *
|
||
|
0 if no error */
|
||
|
char fclall();
|
||
|
|
||
|
/* End of File *
|
||
|
* Args: fp - file pointer *
|
||
|
* Returns: 0 if not at end of file *
|
||
|
255 if end of file reached */
|
||
|
char feof();
|
||
|
|
||
|
/* File Error *
|
||
|
* Returns: system dependent error number *
|
||
|
0 if no error */
|
||
|
char ferror();
|
||
|
|
||
|
/* Read Character from File *
|
||
|
* Args: fp - file pointer *
|
||
|
* Returns: ASCII value of character *
|
||
|
* system dependent garbage *
|
||
|
character if past end of file */
|
||
|
char fgetc();
|
||
|
|
||
|
/* Write Character to File *
|
||
|
* Args: fp - file pointer *
|
||
|
* c - ASCII character to write *
|
||
|
* Returns: ASCII value of character */
|
||
|
char fputc();
|
||
|
|
||
|
/* Read String from File *
|
||
|
* Args: fp - file pointer *
|
||
|
* &s - string read from file *
|
||
|
* Returns: length of string *
|
||
|
* 255 if error during write */
|
||
|
char fgets();
|
||
|
|
||
|
/* Write String to File *
|
||
|
* Args: fp - file pointer *
|
||
|
* &s - string to print from *
|
||
|
* Returns: ending position in string *
|
||
|
* 255 if error during write */
|
||
|
char fputs();
|
||
|
|
||
|
/* Write Line to File *
|
||
|
* Args: fp - file pointer *
|
||
|
* &s - string to print from *
|
||
|
* Returns: ending position in string *
|
||
|
* 255 if error during write */
|
||
|
char fputln();
|
||
|
|
||
|
/* Set Array for fread() *
|
||
|
* Args: &s - Destination string */
|
||
|
void fsdst();
|
||
|
|
||
|
/* Read Bytes from File *
|
||
|
* Args: fp - file pointer *
|
||
|
* n - number of bytes to read *
|
||
|
* Returns: number of bytes read */
|
||
|
char fread();
|
||
|
|
||
|
/* Set Array for fwrite() *
|
||
|
* Args: &s - Destination string */
|
||
|
void fssrc();
|
||
|
|
||
|
/* Write Bytes to File *
|
||
|
* Args: fp - file pointer *
|
||
|
* n - number of bytes to write *
|
||
|
* Returns: number of bytes written */
|
||
|
char fwrite();
|
||
|
|