home *** CD-ROM | disk | FTP | other *** search
-
- /*
- ┌────────────────────────────────────────────────────────────────────────────┐
- │ jzredfil │
- │ Read from a file handle │
- │ Parms │
- │ fhandle Handle to read from │
- │ fbuf Buffer to read into │
- │ famt Number of bytes requested to read │
- │ Returns the number of bytes actually read │
- └────────────────────────────────────────────────────────────────────────────┘
- */
-
- #include <jaz.h>
-
- jzredfil(fhandle,fbuf,famt)
- int fhandle;
- char *fbuf;
- int famt;
- {
- TREG wreg;
-
- wreg.h.ah = 0x3F; /* read file function */
-
- wreg.x.bx = fhandle;
-
- wreg.x.ds = getds();
-
- wreg.x.dx = (int) fbuf;
-
- wreg.x.cx = famt;
-
- msdos(&wreg);
-
- if (wreg.x.flags & 1)
- return(-1);
- else
- return(wreg.x.ax); /* number of bytes actually read */
-
- }
-