home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
new
/
amigalibdisks
/
d984
/
forceicon
/
source
/
checktooltypes.h
next >
Wrap
C/C++ Source or Header
|
1994-04-04
|
1KB
|
64 lines
/**********************************************************************/
/* Check for tooltypes or commandline args, */
/* returning TRUE for FlushMemory */
/**********************************************************************/
#ifdef PREFSRUN
static char *Template = "FLUSH=FLUSHMEMORY/S";
#endif
static void CheckToolTypes(struct WBStartup *WBenchMsg)
{
ObtainSemaphore(&FIconSema->FIconSema);
// Launched from WB ???
if(WBenchMsg)
{
struct DiskObject *MyDObj;
struct WBArg *MyWBArg;
BPTR OldDir;
MyWBArg = WBenchMsg->sm_ArgList;
OldDir = CurrentDir(MyWBArg->wa_Lock);
if((MyDObj = GetDiskObjectNew(MyWBArg->wa_Name)))
{
#ifdef PREFSRUN
FlushMemory = (FindToolType(MyDObj->do_ToolTypes, "FLUSHMEMORY") != NULL);
#endif
FreeDiskObject(MyDObj);
}
CurrentDir(OldDir);
}
// Check command line
else
{
APTR *Args;
struct RDArgs *MyRDArgs;
if((Args = AllocVec(2 * sizeof(ULONG), MEMF_CLEAR)))
{
if((MyRDArgs = ReadArgs(Template, (LONG *)Args, NULL)))
{
#ifdef PREFSRUN
FlushMemory = (Args[0] != NULL);
#endif
FreeArgs(MyRDArgs);
}
else
DisplayError(IoErr(), NULL);
FreeVec(Args);
}
else
DisplayError(ERR_NOMEM, NULL);
}
ReleaseSemaphore(&FIconSema->FIconSema);
}