Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 86/CONCURRENT/CCPM-86 3.1 SOURCE/D6/FILEOPEN.C
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

46 lines
1.4 KiB
C
Raw 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 : fileopen |
| CREATED : 19-August-83 LAST MODIFIED: 12-September-83 |
| FUNCTION: Fileopen opens a files specified in the passed FCB, |
| checking for errors. If a password error is detected|
| user is prompted, and open is retried once. After |
| that BDOS extended or physical error is returned. |
| INPUT : fcb -- ptr to FCB for file to open. |
| OUTPUT : Returns BDOS extended or physical error code. |
\*----------------------------------------------------------------------*/
#include <portab.h>
#include "utildef.h"
#include "cpmfunc.h"
/* THESE REFERENCES ARE IN CPMFUNC.H
EXTERN WORD f_dmaget();
EXTERN VOID f_dmaset();
EXTERN WORD f_open();
EXTERN VOID c_writestr();
*/
EXTERN VOID cpmerr();
EXTERN BYTE *err10;
WORD fileopen( fcb )
BYTE fcb[];
{
WORD ret_code;
f_dmaset( &fcb[16] ); /* set DMA to password */
f_open( fcb );
ret_code = _EXTERR;
if( (ret_code & 0x00ff) == 0x00ff ) /* logical error */
if( (ret_code >> 8) == 7 ) /* if password error, */
{
crlf();
cpmerr( err10,0 );
putfname( fcb,0 );
}
ret_code = ret_code >> 8; /* error, return extend-*/
return( ret_code );
}