** ** $Id: WriteChunkBytes.S,v 21.2 92/05/18 02:19:53 chris Exp $ ** $Revision: 21.2 $ ** ** $Filename: WriteChunkBytes.S $ ** $Author: chris $ ** $Date: 92/05/18 02:19:53 $ ** ** iff.library/IFFL_WriteChunkBytes ** ** 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 IFFL_WriteChunkBytes SECTION text,CODE INCLUDE "IffLib.i" XREF SetError,ClearError XDEF WriteChunkBytesFunc ******* iff.library/IFFL_WriteChunkBytes ************************************ * * NAME * IFFL_WriteChunkBytes -- Write data into the current chunk * * SYNOPSIS * success = IFFL_WriteChunkBytes( iff, buf, size ) * D0 A0 A1 D0 * * LONG IFFL_WriteChunkBytes( IFFL_HANDLE, APTR, LONG ) * * FUNCTION * Writes "size" bytes from the specified buffer into the current chunk. * * INPUTS * iff - IFF file handle, from IFFL_OpenIFF(). * buf - pointer to buffer area with bytes to be written. * size - number of bytes to write. * * RESULT * Non-NULL if the write was successful, or NULL if an error * occurred. Call IFFL_IFFError() to know what's going on. * * SEE ALSO * IFFL_PushChunk(), IFFL_PopChunk(), IFFL_IFFError() * ***************************************************************************** WriteChunkBytesFunc: movem.l d2-d3/a2/a5-a6,-(SP) movea.l a6,a5 ; IFFBase für ClearError() movea.l a0,a2 ; A2 : IFF-Handle movea.l iffb_DOSBase(a5),a6 ; A6 : DOSBase *** Daten in Chunk schreiben (Seek-Position ist schon richtig) move.l ifffh_File(a2),d1 move.l a1,d2 ; Adresse move.l d0,d3 ; Länge JSRLIB Write cmp.l d3,d0 bne.b .WriteError *** Chunk-Grösse updaten add.l d3,ifffh_ChunkSize(a2) *** Okay bsr ClearError ; Setzt auch D0 auf TRUE bra.b .End *** Schreibfehler oder Seekfehler .SeekError: .WriteError: moveq.l #IFFL_ERROR_WRITE,d0 bsr SetError ; Setzt auch D0 auf FALSE *** Routine beenden .End: movem.l (SP)+,d2-d3/a2/a5-a6 rts END