/*
 * xsave.h
 *
 * [Generated from xsave, 08 November 1995]
 */

#pragma include_only_once
#pragma force_top_level

#ifndef __xsave_h
#define __xsave_h

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  xsave_save
 *  xsave_send
 *  xsave_done
 *  xsave_failed
 *  xsave_byte
 *  xsave_word
 *  xsave_string
 *  xsave_block
 */

/* --- xsave_save --- *
 *
 * On entry:	R0 == pointer to saver routine
 *		R1 == R10 value to pass to saver
 *		R2 == R12 value to pass to saver
 *		R3 == pointer to filename to save to
 *		R4 == filetype of file to save
 *
 * On exit:	May return an error
 *
 * Use:		Calls a generalised saver routine to write data to a file.
 */

extern routine xsave_save;

/* --- xsave_send --- *
 *
 * On entry:	R0 == pointer to saver routine
 *		R1 == R10 value to pass to saver
 *		R2 == R12 value to pass to saver
 *
 * On exit:	R0 == pointer to block to send
 *		R1 == size of block
 *		CS if this is the last block, else CC
 *		May return an error
 *
 * Use:		Calls a generalised saver routine to write data to another
 *		application, using RAM transfer.  Note that you must call
 *		this routine from your send entry point throughout the
 *		save operation.
 */

extern routine xsave_send;

/* --- xsave_done --- *
 *
 * On entry:	--
 *
 * On exit:	--
 *
 * Use:		Tidies up after a successful save job.
 */

extern routine xsave_done;

/* --- xsave_failed --- *
 *
 * On entry:	R0 == pointer to error block
 *
 * On exit:	--
 *
 * Use:		Tidies up a RAM transfer after an error.
 */

extern routine xsave_failed;

/* --- xsave_byte --- *
 *
 * On entry:	R0 == byte to write in lowest 8 bits
 *
 * On exit:	May return an error
 *
 * Use:		Writes a single byte to the current output.
 */

extern routine xsave_byte;

/* --- xsave_word --- *
 *
 * On entry:	R0 == word to write
 *
 * On exit:	May return an error
 *
 * Use:		Writes a single word to the current output.
 */

extern routine xsave_word;

/* --- xsave_string --- *
 *
 * On entry:	R0 == pointer to a control-terminated string
 *
 * On exit:	May return an error
 *
 * Use:		Writes a control-terminated string to the current output.
 *		The string is null terminated in the output file.
 */

extern routine xsave_string;

/* --- xsave_block --- *
 *
 * On entry:	R0 == pointer to buffer to write
 *		R1 == size of buffer to write
 *
 * On exit:	May return an error
 *
 * Use:		Writes out a block of data.  Data is buffered, so this is
 *		fairly quick for reading small objects.  Large data blocks
 *		are sent directly to avoid buffering overhead.
 */

extern routine xsave_block;

/*----- That's all, folks -------------------------------------------------*/

#endif
