Mac OS 9
ShutDown.h
Go to the documentation of this file.
1 
19 #ifndef __SHUTDOWN__
20 #define __SHUTDOWN__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __MIXEDMODE__
27 #include <MixedMode.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  enum
52  {
53  sdOnPowerOff = 1,
59  sdRestartOrPower = 3
60  };
61 
62  typedef CALLBACK_API_REGISTER68K(void, ShutDwnProcPtr, (short shutDownStage));
63  typedef REGISTER_UPP_TYPE(ShutDwnProcPtr) ShutDwnUPP;
64 #if CALL_NOT_IN_CARBON
73  ShutDwnUPP
74  NewShutDwnUPP(ShutDwnProcPtr userRoutine);
75 #if !OPAQUE_UPP_TYPES
76  enum
77  {
78  uppShutDwnProcInfo = 0x00001002
79  };
80 #ifdef __cplusplus
81  inline ShutDwnUPP NewShutDwnUPP(ShutDwnProcPtr userRoutine)
82  {
83  return (ShutDwnUPP)NewRoutineDescriptor(
84  (ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture());
85  }
86 #else
87 #define NewShutDwnUPP(userRoutine) \
88  (ShutDwnUPP) NewRoutineDescriptor( \
89  (ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
90 #endif
91 #endif
92 
101  void
102  DisposeShutDwnUPP(ShutDwnUPP userUPP);
103 #if !OPAQUE_UPP_TYPES
104 #ifdef __cplusplus
105  inline void DisposeShutDwnUPP(ShutDwnUPP userUPP)
106  {
107  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
108  }
109 #else
110 #define DisposeShutDwnUPP(userUPP) DisposeRoutineDescriptor(userUPP)
111 #endif
112 #endif
113 
122 #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
123 #pragma parameter InvokeShutDwnUPP(__D0, __A0)
124 #endif
125  void
126  InvokeShutDwnUPP(short shutDownStage, ShutDwnUPP userUPP);
127 #if !OPAQUE_UPP_TYPES && \
128  (!TARGET_OS_MAC || !TARGET_CPU_68K || TARGET_RT_MAC_CFM)
129 #ifdef __cplusplus
130  inline void InvokeShutDwnUPP(short shutDownStage, ShutDwnUPP userUPP)
131  {
132  CALL_ONE_PARAMETER_UPP(userUPP, uppShutDwnProcInfo, shutDownStage);
133  }
134 #else
135 #define InvokeShutDwnUPP(shutDownStage, userUPP) \
136  CALL_ONE_PARAMETER_UPP((userUPP), uppShutDwnProcInfo, (shutDownStage))
137 #endif
138 #endif
139 
140 #endif
142 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
144 #define NewShutDwnProc(userRoutine) NewShutDwnUPP(userRoutine)
145 #define CallShutDwnProc(userRoutine, shutDownStage) \
146  InvokeShutDwnUPP(shutDownStage, userRoutine)
147 #endif
149 #if CALL_NOT_IN_CARBON
150 
165  void
167 
182  void
184 
193  void
194  ShutDwnInstall(ShutDwnUPP shutDownProc, short flags);
195 
204  void
205  ShutDwnRemove(ShutDwnUPP shutDownProc);
206 
207 #endif
209 #if PRAGMA_STRUCT_ALIGN
210 #pragma options align = reset
211 #elif PRAGMA_STRUCT_PACKPUSH
212 #pragma pack(pop)
213 #elif PRAGMA_STRUCT_PACK
214 #pragma pack()
215 #endif
216 
217 #ifdef PRAGMA_IMPORT_OFF
218 #pragma import off
219 #elif PRAGMA_IMPORT
220 #pragma import reset
221 #endif
222 
223 #ifdef __cplusplus
224 }
225 #endif
226 
227 #endif
228 */*/
Basic Macintosh data types.
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
void DisposeShutDwnUPP(ShutDwnUPP userUPP)
void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
@ sdOnUnmount
Definition: ShutDown.h:55
@ sdOnBootVolUnmount
Definition: ShutDown.h:57
@ sdRestartOrPower
Definition: ShutDown.h:59
@ sdOnDrivers
Definition: ShutDown.h:56
@ sdOnRestart
Definition: ShutDown.h:54
void ShutDwnRemove(ShutDwnUPP shutDownProc)
void ShutDwnPower(void)
Perform housekeeping and turn off the power.
void ShutDwnStart(void)
Perform housekeeping and reboot.
#define NewShutDwnUPP(userRoutine)
Definition: ShutDown.h:87
void InvokeShutDwnUPP(short shutDownStage, ShutDwnUPP userUPP)
typedef CALLBACK_API_REGISTER68K(void, SIInterruptProcPtr,(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize))
typedef REGISTER_UPP_TYPE(HighHookProcPtr) HighHookUPP