home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / C-FDC / GETATI.C < prev    next >
Text File  |  1986-08-01  |  731b  |  36 lines

  1. /*
  2.  *    Get ATI (allocation table information) function
  3.  *
  4.  *     Accepts a disk drive number: 0 = current, 1 = A:, 2 = B, etc.
  5.  *     Returns a pointer to struct ati with the allocation table information.
  6.  *     Subsequent calls to getati() destories the static information 
  7.  *    from the previous call.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <dos.h>
  12. #include "fdc.h"
  13.  
  14. #define GETATIFN 0x1c00
  15.  
  16. struct ati *getati(int drive)
  17. {
  18.  
  19.     extern int errno;
  20.     static struct ati retinfo;
  21.     struct REGVAL r;
  22.  
  23.     r.ax = GETATIFN;
  24.     r.dx = drive;
  25.     sysint21(&r, &r);
  26.     retinfo.media_type = peek(r.ds, r.bx) & 0xff;
  27.     retinfo.sector_au =  (int)(r.ax & 0xff);
  28.     retinfo.au = r.dx;
  29.     retinfo.sector_size = (int)r.cx;
  30.     return(&retinfo);
  31.  
  32. }
  33.  
  34.  
  35.  
  36.