DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Header

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
// ===========================================================================
//	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;
}