home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / ShutDown.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-31  |  2.1 KB  |  85 lines  |  [TEXT/MMCC]

  1. /*
  2.     File:        ShutDown.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __SHUTDOWN__
  13. #define __SHUTDOWN__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. enum  {
  23.     sdOnPowerOff                = 1,                            /*call procedure before power off.*/
  24.     sdOnRestart                    = 2,                            /*call procedure before restart.*/
  25.     sdOnUnmount                    = 4,                            /*call procedure before unmounting.*/
  26.     sdOnDrivers                    = 8,                            /*call procedure before closing drivers.*/
  27.     sdRestartOrPower            = 3                                /*call before either power off or restart.*/
  28. };
  29.  
  30.  
  31. /*
  32.     ShutDownProcs cannot be written in or called from a high-level 
  33.     language without the help of mixed mode or assembly glue because they 
  34.     use the following parameter-passing convention:
  35.  
  36.     typedef pascal void (*ShutDwnProcPtr)(short shutDownStage);
  37.  
  38.         In:
  39.             =>     shutDownStage            D0.W
  40.         Out:
  41.             none
  42. */
  43.  
  44. enum  {
  45.     uppShutDwnProcInfo            = kRegisterBased|REGISTER_ROUTINE_PARAMETER(1,kRegisterD0,kTwoByteCode)
  46. };
  47.  
  48. #if USESROUTINEDESCRIPTORS
  49. typedef pascal void (*ShutDwnProcPtr)(short shutDownStage);
  50.  
  51. typedef UniversalProcPtr ShutDwnUPP;
  52.  
  53. #define CallShutDwnProc(userRoutine, shutDownStage)  \
  54.     CallUniversalProc((UniversalProcPtr)(userRoutine), uppShutDwnProcInfo, (shutDownStage))
  55.  
  56. #define NewShutDwnProc(userRoutine)  \
  57.     (ShutDwnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentISA())
  58.  
  59. #else
  60. typedef ProcPtr ShutDwnUPP;
  61.  
  62. #define NewShutDwnProc(userRoutine)  \
  63.     (ShutDwnUPP)(userRoutine)
  64.  
  65. #endif
  66.  
  67. #ifdef __cplusplus
  68. extern "C" {
  69. #endif
  70.  
  71. extern pascal void ShutDwnPower(void)
  72.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
  73. extern pascal void ShutDwnStart(void)
  74.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
  75. extern pascal void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
  76.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
  77. extern pascal void ShutDwnRemove(ShutDwnUPP shutDownProc)
  78.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82.  
  83. #endif
  84.  
  85.