
 /* SD_SuperVisor.c
    - SuperVising (global exit) Functions for XOR operation -
    (c) 1990-94 by Andreas R. Kleinert
    Last changes : 08.10.1994
 */

#include "svoperator.h"


struct SVOperatorHandle * __saveds __asm SVP_AllocHandle( register __a1 APTR future_a1);
void __saveds __asm SVP_FreeHandle( register __a1 struct SVOperatorHandle *SVOperatorHandle_a1);

/* *************************************************** */
/* *						     * */
/* * SVP_AllocHandle : Free SVOperatorHandle and more  * */
/* *						     * */
/* *************************************************** */

struct SVOperatorHandle * __saveds __asm SVP_AllocHandle( register __a1 APTR future_a1)
{
 APTR future = future_a1;
 struct SVOperatorHandle *handle;

 handle = (APTR) AllocVec(sizeof(struct SVOperatorHandle), (MEMF_CLEAR|MEMF_PUBLIC));

 return(handle);
}

/* *************************************************** */
/* *						     * */
/* * SVP_FreeHandle : Free SVOperatorHandle and more   * */
/* *						     * */
/* *************************************************** */

void __saveds __asm SVP_FreeHandle( register __a1 struct SVOperatorHandle *SVOperatorHandle_a1)
{
 struct SVOperatorHandle *SVOperatorHandle = SVOperatorHandle_a1;

 if(SVOperatorHandle->ah_SV_GfxBuffer)
  {
   if(SVOperatorHandle->ah_SV_GfxBuffer->svgfx_Buffer) FreeVec(SVOperatorHandle->ah_SV_GfxBuffer->svgfx_Buffer);

   FreeVec(SVOperatorHandle->ah_SV_GfxBuffer);
  }

 if(SVOperatorHandle->ah_ramhandle) SVSUP_FreeMemList(SVOperatorHandle->ah_ramhandle);

 FreeVec(SVOperatorHandle);
}
