home *** CD-ROM | disk | FTP | other *** search
-
- /* SD_SuperVisor.c
- - SuperVising (global exit) Functions for AGA-Support -
- (c) 1990-94 by Andreas R. Kleinert
- Last changes : 07.05.1994
- */
-
- #include "svdriver.h"
-
-
- struct SVDriverHandle * __saveds __asm SVD_AllocHandle( register __a1 APTR future_a1);
- void __saveds __asm SVD_FreeHandle( register __a1 struct SVDriverHandle *SVDriverHandle_a1);
- void __saveds __asm SVD_CloseDisplay( register __a1 struct SVDriverHandle *SVDriverHandle_a1);
- void __saveds __asm SVD_FreeResources( register __a1 struct SVDriverHandle *SVDriverHandle_a1);
-
- /* *************************************************** */
- /* * * */
- /* * SVD_AllocHandle : Free SVDriverHandle and more * */
- /* * * */
- /* *************************************************** */
-
- struct SVDriverHandle * __saveds __asm SVD_AllocHandle( register __a1 APTR future_a1)
- {
- APTR future = future_a1;
- struct SVDriverHandle *handle;
-
- handle = (APTR) AllocVec(sizeof(struct SVDriverHandle), (MEMF_CLEAR|MEMF_PUBLIC));
-
- return(handle);
- }
-
- /* *************************************************** */
- /* * * */
- /* * SVD_FreeHandle : Free SVDriverHandle and more * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SVD_FreeHandle( register __a1 struct SVDriverHandle *SVDriverHandle_a1)
- {
- struct SVDriverHandle *SVDriverHandle = SVDriverHandle_a1;
-
- SVD_CloseDisplay(SVDriverHandle);
- SVD_FreeResources(SVDriverHandle);
-
- FreeVec(SVDriverHandle);
- }
-
- /* *************************************************** */
- /* * * */
- /* * SVD_CloseDisplay : Close Display, ... * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SVD_CloseDisplay( register __a1 struct SVDriverHandle *SVDriverHandle_a1)
- {
- struct SVDriverHandle *SVDriverHandle = SVDriverHandle_a1;
- struct SVDriverBase *SVDriverBase = N;
- APTR msg;
-
- if(!SVDriverHandle) return;
-
- if(SVDriverHandle->ah_Screen)
- {
- if(SVDriverHandle->ah_Window)
- {
- while( msg = GetMsg(SVDriverHandle->ah_Window->UserPort) ) ReplyMsg(msg);
-
- CloseWindow(SVDriverHandle->ah_Window);
- }
-
- CloseScreen(SVDriverHandle->ah_Screen);
-
- SVDriverHandle->ah_Window = N;
- SVDriverHandle->ah_Screen = N;
- }
- }
-
- /* *************************************************** */
- /* * * */
- /* * SVD_FreeResources : Free Memory and more * */
- /* * * */
- /* *************************************************** */
-
- void __saveds __asm SVD_FreeResources( register __a1 struct SVDriverHandle *SVDriverHandle_a1)
- {
- struct SVDriverHandle *SVDriverHandle = SVDriverHandle_a1;
- struct SVDriverBase *SVDriverBase = N;
-
- if(!SVDriverHandle) return;
-
- if(SVDriverHandle->ah_ramhandle) SVSUP_FreeMemList(SVDriverHandle->ah_ramhandle);
-
- SVDriverHandle->ah_ramhandle = N;
- }
-