home *** CD-ROM | disk | FTP | other *** search
- {
- ════════════════════════════════════════════════════════════════════════════
-
- Visionix ExitProc Unit (VPROC)
- Copyright 1991,92,93 Visionix
- ALL RIGHTS RESERVED
-
- Manages an ExitProc Stack for easing the halting of a program.
-
- ────────────────────────────────────────────────────────────────────────────
-
- Revision history in reverse chronological order:
-
- Initials Date Comment
-
- ──────── ──────── ────────────────────────────────────────────────────────
-
- lpg 03/16/93 Added Source Documentation
-
- mep 02/11/93 Updated code for release - new names for functions.
- Cleaned up code for beta release
-
- jrt 02/08/93 Sync with beta 0.12 release
-
- mep 01/24/93 Initialized.
-
- ────────────────────────────────────────────────────────────────────────────
- }
-
- Unit VProc;
-
-
- Type
-
- {---------------------------------}
- { Generic types for PROCEDURE and }
- { Pointer to procedure; used by }
- { isolation routines. }
- {---------------------------------}
-
- PProcCall = ^TProcCall;
- TProcCall = PROCEDURE;
-
- {----------------------------------}
- { Procedure stack types, used for }
- { the exit procedure stack at }
- { system shutdown }
- {----------------------------------}
-
- PProcStack = ^TProcStack;
- TProcStack = RECORD
-
- Proc : PProcCall;
- Next : PProcStack;
-
- END;
-
- Var
-
- ProcStack : PProcStack;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure VProcPush( Proc : PProcCall );
-
- Procedure VProcPop( Proc : PProcCall );
-
- Function VProcPopNext : PProcCall;
-
- Procedure VProcRemove( Proc : PProcCall );
-
- Procedure VProcRemoveAll;
-
- Procedure VProcDoExit;
-
- {────────────────────────────────────────────────────────────────────────────}
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure VProcPush( Proc : PProcCall );
-
- [PARAMETERS]
-
- Proc Pointer to a procedure-type.
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This procedure pushs a far procedure onto the exit stack, which will be
- automatically called upon a program halt.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure VProcPop( Proc : PProcCall );
-
- [PARAMETERS]
-
- Proc Pointer to a procedure-type.
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function VProcPopNext : PProcCall;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure VProcRemove( Proc : PProcCall );
-
- [PARAMETERS]
-
- Proc Pointer to a procedure-type.
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure VProcRemoveAll;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure VProcDoExit;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure MyExitProc;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- The procedure begins the execution of the exit procedure stack.
- It also fixes for any other units that might do their own exit stack.
- In addition, if a breakpoint is set on the "ExitProc := SaveExitProc;"
- line, then you can Add a Watch of "SaveMaxAvail - MaxAvail" to see
- if any memory has not been deallocated - a bonus!
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-