/** * translate_error - translate an EEFS error code into a Commodore error message * @res: EEFS error code to be translated * * This function sets the error channel according to the problem given in * @res. */ static void translate_error(eefs_error_t res) { switch (res) { case EEFS_ERROR_OK: set_error(ERROR_OK); break; case EEFS_ERROR_FILENOTFOUND: set_error(ERROR_FILE_NOT_FOUND); break; case EEFS_ERROR_FILEEXISTS: set_error(ERROR_FILE_EXISTS); break; case EEFS_ERROR_DIRFULL: case EEFS_ERROR_DISKFULL: set_error_ts(ERROR_DISK_FULL, res, 0); break; case EEFS_ERROR_INVALID: set_error(ERROR_SYNTAX_UNABLE); break; case EEFS_ERROR_UNIMPLEMENTED: set_error(ERROR_SYNTAX_UNKNOWN); break; default: set_error_ts(ERROR_SYNTAX_UNABLE, res, 99); break; } }
void set_error(uint8_t errornum) { set_error_ts(errornum,0,0); }
static void eefs_write_sector(buffer_t *buf, uint8_t part, uint8_t track, uint8_t sector) { set_error_ts(ERROR_READ_NOHEADER, track, sector); }