home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Audio 4.94 - Over 11,000 Files
/
audio-11000.iso
/
msdos
/
sndbords
/
proaudio
/
pas_sdk1
/
pas-sdk1.arj
/
PAS
/
CDROMAPP
/
CDRESET.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-02
|
1KB
|
72 lines
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#define OKAY 0
#include "cdmaster.h"
char *syntax= "Syntax: cdreset [drive #].\n";
char *nodrives= "No CDROM drives attached.\n";
char *nomscdex= "MSCDEX is not installed.\n";
main(int argc, char **argv)
{
int numcdroms= 0;
int ourdrive= 0;
struct cdtable *cdt;
if (!ismscdex())
{
fprintf(stderr, nomscdex);
return(1);
}
if (!(numcdroms= getnumcdroms()))
{
fprintf(stderr, nodrives);
return(2);
}
switch (argc)
{
case 2:
if (argv[1][0] != '.')
{
if (!(ourdrive= atoi(argv[1])))
{
fprintf(stderr, syntax);
return(3);
}
break;
}
case 1:
if (!(ourdrive= getfirstcdrom()))
{
fprintf(stderr, nodrives);
return(4);
}
break;
default:
fprintf(stderr, syntax);
return(5);
}
printf("reset drive: %2d ", ourdrive);
if (cdt= createaudiotoc(ourdrive))
{
int status= cdreset(ourdrive);
printf("= %X.\n", status);
destroyaudiotoc(ourdrive);
}
else
printf("failed, no initialization.\n");
return(OKAY);
}