/*
* TinyFinder.c - 21-Feb-85
*
* This program is an alternative Finder that is very fast and small,
* and limited in its abilities compared to the real Finder. It is
* written in Aztec 68000 C (version 1.06D).
*
* copyright (c) 1985 by:
* Kent Kersten
* Harrison Systems
* 437 Atlas Drive
* Nashville, TN 37211
* (615) 834-1366
* CompuServe CIS [72277,2726]
*
* To compile & link this file:
* cc TinyFinder.c
* ln -m TinyFinder.o sys:lib/sacroot.o -lc
*/
/*
* Check to see if the file named 'Finder' exists on the default volume.
* If not, then disable the command in the 'File' menu that allows the user to
* launch the Apple Finder. Note that this is fairly dumb, in that if it
* finds ANY file named 'Finder' it thinks it is the one. Could be made
* smarter by checking the type and creator bytes for the file, but I
* didn't feel that I should, in case there is an application by that name.
*/
/*
* This alert takes care of our general error messages. We can
* pass up to four Str255 types (pointers to them, that is), and
* they are combined end to end with a single space between them.
*/
/*
* Launch the Apple Finder. This command is disabled in the menu bar
* if the program does not find the Finder on the default disk when
* we boot up and begin execution.
*/
GoFinder()
{
long zeroes = 0;
Launch("\006Finder", &zeroes);
}
/*
* Come here when the 'Launch' menu command is given.
*/
if(rec.good == 0) /* 'Cancel' button hit */
return;
if(SetVol(nil, rec.vRefNum) < 0) { /* set the new default volume */
hdl = GetString(256);
GeneralError(*hdl, nil, nil, nil);
return;
}
Launch(rec.fName, &zeroes);
}
/*
* This is the equivalent of Apple Finder v4.1's 'Shut Down' command,
* in which the diskettes are ejected from the internal & external
* drives and a system reset is issued. Any other volumes that happen
* to be mounted will NOT be handled.
*/
ShutDown()
{
int vRefNum;
long freeBytes;
char volName[256];