baron@runx.OZ (Jason Haines) (04/16/86)
This is one solution to performing a 'shutdown' function in Megamax C
Note: Megamax C performs ctopstr conversions internally in most instances.
If you have another C,just replace the line
char vname[255];
to
stringptr vname;
Any other solutions would be deeply appreciated.
Thanks in advance,
Jason
--------------------------(Cut Here)----------------------------
#include "stdio.h"
shutdown()
{
int drive, vrefnum, err;
char vname[255];
long free;
for (drive = 1; drive <= 2 ; drive++)
{
if (!(err = getvinfo(drive,vname,&vrefnum,&free)))
{
unmountvol(NULL,drive);
eject(NULL,drive);
}
}
asm
{
reset
}
}
--------------------------(Cut Here)----------------------------
/* Jason Haines
* ElecEng Undergraduate
* 73 Davidson Avenue
* Concord NSW 2137
* AUSTRALIA
*
* STD: (02) 73-4444
* ISD: +61 2 73-4444
* ACSnet: baron@runx
* CSNET: baron@runx.oz
* ARPA: baron%runx.oz@seismo.css.gov
* JANET: runx.oz!baron@ukc
* UUCP: {enea,hplabs,mcvax,prlb2,seismo,ubc-vision,ukc}!munnari!runx.oz!baron
*/