home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
223_01
/
read.c
< prev
next >
Wrap
Text File
|
1979-12-31
|
640b
|
29 lines
/*
** read.c by F. A. Scacchitti 3/22/86
*/
#include <stdio.h>
extern int zzbuf;
static int i, n;
static char *tbuff, flag;
read(fd,buffer,cnt) int fd, cnt; char *buffer; {
tbuff = &zzbuf;
n=0;
while(cnt >0){
if((flag = bdos(20,fd)) != NULL) {
*(fd + 40) = flag;
return(n);
}else
i = 0;
while(i <= 127 && cnt > 0){ buffer[n] = tbuff[i];
i++; cnt--; n++; }
}
return(n);
}