gecko-dev/gc/boehm/MetroNubUtils/MetroNubUtils.c
beard%netscape.com d09ee731d4 First Checked In.
1999-10-08 17:51:45 +00:00

73 lines
1.4 KiB
C

// ===========================================================================
// MetroNubUtils.c ©1996-1998 Metrowerks Inc. All rights reserved.
// ===========================================================================
#ifndef __MetroNubUtils__
#include "MetroNubUtils.h"
#endif
#ifndef __MetroNubUserInterface__
#include "MetroNubUserInterface.h"
#endif
#ifndef __GESTALT__
#include <Gestalt.h>
#endif
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
static MetroNubUserEntryBlock* gMetroNubEntry = NULL;
Boolean IsMetroNubInstalled()
{
static Boolean lookedForMetroNub = false;
if (! lookedForMetroNub)
{
long result;
// look for MetroNub's Gestalt selector
if (Gestalt(kMetroNubUserSignature, &result) == noErr)
{
MetroNubUserEntryBlock* block = (MetroNubUserEntryBlock *)result;
// make sure the version of the API is compatible
if (block->apiLowVersion <= kMetroNubUserAPIVersion &&
kMetroNubUserAPIVersion <= block->apiHiVersion)
gMetroNubEntry = block; // success!
}
lookedForMetroNub = true;
}
return (gMetroNubEntry != NULL);
}
Boolean IsMWDebuggerRunning()
{
if (IsMetroNubInstalled())
return CallIsDebuggerRunningProc(gMetroNubEntry->isDebuggerRunning);
else
return false;
}
Boolean AmIBeingMWDebugged()
{
if (IsMetroNubInstalled())
return CallAmIBeingDebuggedProc(gMetroNubEntry->amIBeingDebugged);
else
return false;
}