Back to index

lightning-sunbird  0.9+nobinonly
MetroNubUserInterface.h
Go to the documentation of this file.
00001 // ===========================================================================
00002 //     MetroNubUserInterface.h            1996-1998 Metrowerks Inc. All rights reserved.
00003 // ===========================================================================
00004 
00005 #ifndef __MetroNubUserInterface__
00006 #define __MetroNubUserInterface__
00007 #pragma once
00008 
00009 #include <CodeFragments.h>
00010 
00011 #if PRAGMA_ALIGN_SUPPORTED
00012 #pragma options align=mac68k
00013 #endif
00014 
00015 #ifdef __cplusplus
00016        extern "C" {
00017 #endif
00018 
00019 
00020 // ---------------------------------------------------------------------------
00021 //             Constants
00022 // ---------------------------------------------------------------------------
00023 
00024 const short kMetroNubUserAPIVersion = 1;         // current User API version
00025 const OSType kMetroNubUserSignature = 'MnUI';
00026 
00027 
00028 // ---------------------------------------------------------------------------
00029 //             IsDebuggerRunning
00030 // ---------------------------------------------------------------------------
00031 
00032 // pascal Boolean IsDebuggerRunning ();
00033 
00034 typedef pascal Boolean (*IsDebuggerRunningProcPtr)();
00035 
00036 #if GENERATINGCFM
00037 typedef UniversalProcPtr IsDebuggerRunningUPP;
00038 #else
00039 typedef IsDebuggerRunningProcPtr IsDebuggerRunningUPP;
00040 #endif
00041 
00042 enum {
00043        uppIsDebuggerRunningProcInfo = kPascalStackBased
00044                | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
00045 };
00046 
00047 #if GENERATINGCFM
00048 #define NewIsDebuggerRunningProc(userRoutine)           \
00049               (IsDebuggerRunningUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIsDebuggerRunningProcInfo, GetCurrentArchitecture())
00050 #else
00051 #define NewIsDebuggerRunningProc(userRoutine)           \
00052               ((IsDebuggerRunningUPP) (userRoutine))
00053 #endif
00054 
00055 #if GENERATINGCFM
00056 #define CallIsDebuggerRunningProc(userRoutine)          \
00057               CallUniversalProc((UniversalProcPtr)(userRoutine), uppIsDebuggerRunningProcInfo)
00058 #else
00059 #define CallIsDebuggerRunningProc(userRoutine)          \
00060                      (*(userRoutine))()
00061 #endif
00062 
00063 
00064 // ---------------------------------------------------------------------------
00065 //             AmIBeingDebugged
00066 // ---------------------------------------------------------------------------
00067 
00068 // pascal Boolean AmIBeingDebugged ();
00069 
00070 typedef pascal Boolean (*AmIBeingDebuggedProcPtr)();
00071 
00072 #if GENERATINGCFM
00073 typedef UniversalProcPtr AmIBeingDebuggedUPP;
00074 #else
00075 typedef AmIBeingDebuggedProcPtr AmIBeingDebuggedUPP;
00076 #endif
00077 
00078 enum {
00079        uppAmIBeingDebuggedProcInfo = kPascalStackBased
00080                | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
00081 };
00082 
00083 #if GENERATINGCFM
00084 #define NewAmIBeingDebuggedProc(userRoutine)            \
00085               (AmIBeingDebuggedUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppAmIBeingDebuggedProcInfo, GetCurrentArchitecture())
00086 #else
00087 #define NewAmIBeingDebuggedProc(userRoutine)            \
00088               ((AmIBeingDebuggedUPP) (userRoutine))
00089 #endif
00090 
00091 #if GENERATINGCFM
00092 #define CallAmIBeingDebuggedProc(userRoutine)           \
00093               CallUniversalProc((UniversalProcPtr)(userRoutine), uppAmIBeingDebuggedProcInfo)
00094 #else
00095 #define CallAmIBeingDebuggedProc(userRoutine)           \
00096                      (*(userRoutine))()
00097 #endif
00098 
00099 
00100 // ---------------------------------------------------------------------------
00101 //             MetroNubUserEntryBlock
00102 // ---------------------------------------------------------------------------
00103 
00104 struct MetroNubUserEntryBlock
00105 {
00106        long                               blockLength;         // length of this block
00107        short                              apiLowVersion;              // lowest supported version of the Nub API
00108        short                              apiHiVersion;        // highest supported version of the Nub API
00109        Str31                              nubVersion;                 // short version string from 'vers' 1 resource
00110               
00111        IsDebuggerRunningUPP isDebuggerRunning;
00112        AmIBeingDebuggedUPP         amIBeingDebugged;
00113 };
00114 typedef struct MetroNubUserEntryBlock MetroNubUserEntryBlock;
00115 
00116 #ifdef __cplusplus
00117        }
00118 #endif
00119 
00120 #if PRAGMA_ALIGN_SUPPORTED
00121 #pragma options align=reset
00122 #endif
00123 
00124 #endif