Files
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

44 lines
1.1 KiB
C
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*----------------------------------------------------------------------*\
| NAME : readsect |
| CREATED : 19-August-83 LAST MODIFIED: 16-August-83 |
| FUNCTION: Readsect reads a sector from the file referenced in |
| passed FCB. |
| INPUT : fcb -- ptr to FCB for file to read from. |
| OUTPUT : Returns 0 if successful, F_READ error code otherwise |
\*----------------------------------------------------------------------*/
#include <portab.h>
#include "utildef.h"
#include "cpmfunc.h"
/* THIS REFERENCE IS IN CPMFUNC.H
EXTERN WORD f_read();
*/
EXTERN VOID cpmerr();
EXTERN VOID putfname();
EXTERN VOID crlf();
EXTERN BYTE *err08;
WORD readsect( fcb,buff )
BYTE fcb[];
BYTE *buff;
{
WORD ret_code;
f_dmaset( buff ); /* set input buffer */
f_read( fcb );
ret_code = _EXTERR; /* if phy. or ext err */
if( (ret_code & 0x00ff) == 0x00ff ) /* display message */
{
crlf();
cpmerr( err08,0 );
putfname( fcb,0 );
crlf();
ret_code = ret_code & 0x00ff;
} /* return F_READ error */
return( ret_code ); /* code, 0 = sucecss */
}