home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
595.lha
/
MountStuff
/
ReMount.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-10-17
|
1KB
|
52 lines
#include <exec/types.h>
#include <libraries/dosextens.h>
#include "HH:MoreDos.h"
#include "HH:Template.h"
/*************************************************************/
/* NeonSoft (C) 16-08-'88 */
/* ReMount.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_Devices,dv))) {
if (dl=FindDevice(di->di_DevInfo,dv)) {
if (((struct DeviceList *)BADDR(dl))->dl_Type!=DLT_DEVICE) {
printf("Error, %ls not a device!\n",dv);
quit(RETURN_ERROR);
} else {
printf("Error, %ls already mounted!\n",dv);
quit(RETURN_WARN);
}
} else {
printf("Error, %ls not found!\n",dv);
quit(RETURN_FAIL);
}
}
InsertDevice(&di->di_DevInfo,RemoveDevice(&di->di_Devices,dl));
quit(RETURN_OK);
}