home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
595.lha
/
MountStuff
/
UnMount.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 */
/* UnMount.c */
/*************************************************************/
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("Error, %ls already 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("Error, %ls not a device!\n",dv);
quit(RETURN_ERROR);
}
InsertDevice(&di->di_Devices,RemoveDevice(&di->di_DevInfo,dl));
quit(RETURN_OK);
}