home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / actlib12.zip / TOOLS.ZIP / DRVREADY.C < prev    next >
C/C++ Source or Header  |  1993-02-25  |  579b  |  29 lines

  1. /*  Copyright (C) 1993   Marc Stern  (internet: stern@mble.philips.be)  */
  2.  
  3. #include "tools.h"
  4. #include <bios.h>
  5.  
  6.  
  7. /***
  8.  *
  9.  *  Function   :    is_drive_ready
  10.  *
  11.  *  Topics     :    Returns if a floppy drive is ready or not.
  12.  *
  13.  *  Parameters :    in    int drive         0 = A:, 1 = B:
  14.  *
  15.  *  Return code:    0 if not ready (or invalid)
  16.  *                  1 if ready
  17.  ***/
  18.  
  19. int is_drive_ready( int drive )
  20.  
  21. { int result;
  22.   char buffer[512];
  23.  
  24.   do result = biosdisk( 4, drive, 0, 0, 0, 1, buffer );
  25.   while ( result == 0x06 );
  26.  
  27.   return (! result);
  28. }
  29.