	*««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««*
	*
	*   Example name
	*	DFSaveBuffer.s -- 1.0
	*
	*   Function
	*	With this function you can save a memory buffer as raw data
	*	to disk. Buffer may be byte aligned.
	*
	*   Inputs
	*	filename - pointer to a (null) string for filename
	*	buffer - pointer to a buffer/memory area
	*	size - size of buffer/file
	*
	*   Outputs
	*	0 = couldn't save to file
	*
	*   Notes
	*	You may need to modify some of the include paths.
	*	You will of course also need the dfunc package which should
	*	contain includes and macros for the dfunc.library.
	*
	*	Also set UCASE = LCASE for my sources.
	*
	*   Bugs
	*	
	*   Created	: 24.2.96
	*   Last change	: 24.2.96
	*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*

*## For the Startup.asm:

StartSkip	=	0		;0=WB/CLI, 1=CLI only  (AsmOne)
Processor	=	0		;0/680x0/0x0
MathProc	=	0		;0/68881/68882/68040/68060

*## Default includes:

		Incdir	""

** includes from our DFuncXXXX.library archive:

		Include	lvo:dfunc.lvo

		Incdir	inc:

		Include	digital.macs
		Include	digital.i
		Include	dfunc/dfunc.i

		Include	startup.asm

		Incdir	""

	dc.b	"$VER: DFSaveBuffer 1.0 (24.2.96)",0
	even
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Init	DefLib	dfunc,38		;open our library (newstartup macro)
	DefEnd

Start	LibBase	dfunc

*** This is the dfunc.library function we demostrate:

	lea	FileName(pc),a0		;pointer to filename
	lea	Buffer(pc),a1		;pointer to buffer
	move.l	#BufferSize,d0		;size of buffer
	DCall	SaveBuffer		;call function
	tst.l	d0			;test
	bne.b	Close			;if not =0 then goodbye

***
*	You need a filename for your file
*	You need a pointer to a buffer
*	You need the size of the buffer to save = file size
***

	lea	Error(pc),a0		;if error then
	DCall	WriteStd		;print error message to std I/O.

*·············································································*
Close	Return	0			;Exit
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
Buffer	dc.b	"Hi! This file is made with the dfunc.library function ",10
	dc.b	"DFSaveBuffer(). You can save any buffer raw to file.. ",10
	dc.b	"This time it was text ;-)",10

BufferSize	= *-Buffer	;* means 'from here'

Error		dc.b	"Couldn't save file!",10,0

FileName	dc.b	"Ram:Buffer.text",0
*»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»»*
