From 36c824864c02f0a3f62c8a1d365d1670835c8c96 Mon Sep 17 00:00:00 2001 From: "Christian A. Weber" Date: Tue, 12 May 1992 22:26:12 +0000 Subject: Initial revision --- Source/CloseIFF.S | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Source/CloseIFF.S (limited to 'Source/CloseIFF.S') diff --git a/Source/CloseIFF.S b/Source/CloseIFF.S new file mode 100644 index 0000000..b463eaa --- /dev/null +++ b/Source/CloseIFF.S @@ -0,0 +1,67 @@ +** +** $Id: $ +** $Revision: $ +** +** $Filename: CloseIFF.S $ +** $Author: Christian A. Weber $ +** $Release: 19.1 $ +** $Date: 92/05/11 21:11:27 $ +** +** iff.library/IFFLib_CloseIFF +** +** COPYRIGHT (C) 1987-1992 BY CHRISTIAN A. WEBER, BRUGGERWEG 2, +** CH-8037 ZUERICH, SWITZERLAND. ALL RIGHTS RESERVED. NO PART +** OF THIS SOFTWARE MAY BE COPIED, REPRODUCED, OR TRANSMITTED +** IN ANY FORM OR BY ANY MEANS, WITHOUT THE PRIOR WRITTEN PER- +** MISSION OF THE AUTHOR. USE AT YOUR OWN RISK. +** + + + IDNT IFFLib_CloseIFF + SECTION text,CODE + + INCLUDE "IffLib.i" + + XREF ClearError + XDEF CloseIFFFunc + + +******* iff.library/IFFLib_CloseIFF ***************************************** +* +* NAME +* IFFLib_CloseIFF -- Close an IFF-file and deallocate buffers +* +* SYNOPSIS +* IFFLib_CloseIFF( ifffile ) +* A1 +* +* void IFFLib_CloseIFF( IFFFILE ) +* +* FUNCTION +* Returns the memory previously allocated by OpenIFF(). +* +* INPUTS +* ifffile - IFF file pointer, from OpenIFF() +* +* RESULTS +* For now, always results TRUE (this may change in the future). +* +* SEE ALSO +* IFFLib_OpenIFF() +* +***************************************************************************** + +CloseIFFFunc: movem.l a5-a6,-(SP) + movea.l a6,a5 ; IFFBase für ClearError() + + move.l a1,d0 ; Ist a1 == NULL ? + beq.s 1$ ; ja ---> don't free anything + move.l -(a1),d0 ; Grösse des reservierten Bereichs + movea.l ib_SysBase(a5),a6 + JSRLIB FreeMem +1$: bsr ClearError ; IFFError zurücksetzen, D0 := 1 + + movem.l (SP)+,a5-a6 + rts + + END -- cgit v1.2.3