home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
595.lha
/
MountStuff
/
IsMount.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-17
|
1KB
|
49 lines
#include <exec/types.h>
#include <libraries/dosextens.h>
#include "hh:moredos.h"
#include "hh:template.h"
/*************************************************************/
/* NeonSoft (C) 06-04-'88 */
/* IsMount.c */
/* */
/* CAL IsMount LN:MoreDos.o */
/*************************************************************/
TEXT *dv;
TEMPLATE Template[] = {
{ A_FLAG, "DEV", &dv },
{ EOTP }
};
extern struct DosLibrary *DOSBase;
VOID
program()
{
struct RootNode *rn;
struct DosInfo *di;
struct DeviceList *dl;
rn = DOSBase->dl_Root;
di = BADDR(rn->rn_Info);
if (!(dl=FindDevice(di->di_DevInfo,dv))) {
if (FindDevice(di->di_Devices,dv)) {
printf("Warning, %ls is unmounted!\n",dv);
quit(RETURN_WARN);
} else {
printf("Error, %ls not found!\n",dv);
quit(RETURN_FAIL);
}
} else if (((struct DeviceList *)BADDR(dl))->dl_Type!=DLT_DEVICE) {
printf("Warning, %ls not a device!\n",dv);
quit(RETURN_ERROR);
}
quit(RETURN_OK);
}