home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / PInterfaces / ShutDown.p < prev    next >
Encoding:
Text File  |  1994-11-11  |  2.4 KB  |  106 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ShutDown.p
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. }
  16.  
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT ShutDown;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __SHUTDOWN__}
  27. {$SETC __SHUTDOWN__ := 1}
  28.  
  29. {$I+}
  30. {$SETC ShutDownIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33.  
  34. {$IFC UNDEFINED __TYPES__}
  35. {$I Types.p}
  36. {$ENDC}
  37. {    ConditionalMacros.p                                            }
  38.  
  39. {$IFC UNDEFINED __MIXEDMODE__}
  40. {$I MixedMode.p}
  41. {$ENDC}
  42.  
  43. {$PUSH}
  44. {$ALIGN MAC68K}
  45. {$LibExport+}
  46.  
  47. CONST
  48.     sdOnPowerOff                = 1;                            {call procedure before power off.}
  49.     sdOnRestart                    = 2;                            {call procedure before restart.}
  50.     sdOnUnmount                    = 4;                            {call procedure before unmounting.}
  51.     sdOnDrivers                    = 8;                            {call procedure before closing drivers.}
  52.     sdRestartOrPower            = 3;                            {call before either power off or restart.}
  53.  
  54. TYPE
  55.     {
  56.         ShutDwnProcPtr uses register based parameters on the 68k and cannot
  57.         be written in or called from a high-level language without the help of
  58.         mixed mode or assembly glue.
  59.  
  60.         In:
  61.          => shutDownStage    D0.W
  62.     }
  63.     ShutDwnProcPtr = ProcPtr;  { PROCEDURE ShutDwn(shutDownStage: INTEGER); }
  64.     ShutDwnUPP = UniversalProcPtr;
  65.  
  66. CONST
  67.     uppShutDwnProcInfo = $00001002; { Register PROCEDURE (2 bytes in D0); }
  68.  
  69. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  70.     {$IFC NOT GENERATINGCFM }
  71.     INLINE $2E9F;
  72.     {$ENDC}
  73.  
  74. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  75.     {$IFC NOT GENERATINGCFM}
  76.     {To be implemented:  Glue to move parameters into registers.}
  77.     {$ENDC}
  78.  
  79. PROCEDURE ShutDwnPower;
  80.     {$IFC NOT GENERATINGCFM}
  81.     INLINE $3F3C, $0001, $A895;
  82.     {$ENDC}
  83. PROCEDURE ShutDwnStart;
  84.     {$IFC NOT GENERATINGCFM}
  85.     INLINE $3F3C, $0002, $A895;
  86.     {$ENDC}
  87. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  88.     {$IFC NOT GENERATINGCFM}
  89.     INLINE $3F3C, $0003, $A895;
  90.     {$ENDC}
  91. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  92.     {$IFC NOT GENERATINGCFM}
  93.     INLINE $3F3C, $0004, $A895;
  94.     {$ENDC}
  95.  
  96. {$ALIGN RESET}
  97. {$POP}
  98.  
  99. {$SETC UsingIncludes := ShutDownIncludes}
  100.  
  101. {$ENDC} {__SHUTDOWN__}
  102.  
  103. {$IFC NOT UsingIncludes}
  104.  END.
  105. {$ENDC}
  106.