home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name drsetdrv -- Select the default disk drive
- *
- * Synopsis no_drives = drsetdrv(drive);
- *
- * int no_drives The number of drives installed
- * int drive The drive to select
- *
- * Description This function selects the drive specified as the default
- * disk drive. The drive number corresponds to 0 = A:,
- * 1 = B:, etc.
- *
- * The total number of logical disk drives (both fixed and
- * diskette) is returned as the function value. For single
- * diskette drive systems, the diskette drive is counted
- * twice because the single physical drive is associated
- * with logical drives A: and B:.
- *
- * If an invalid drive number is given, no action is taken.
- *
- * Returns no_drives The number of logical drives installed
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bdirect.h>
- #include <butility.h>
-
- int drsetdrv(drive)
- int drive;
- {
- DOSREG dos_reg;
-
- dos_reg.ax = 0x0e00; /* DOS function 0xE */
- dos_reg.dx = drive;
- dos(&dos_reg);
-
- return (int) utlobyte(dos_reg.ax);
- }