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

#pragma include_only_once
#pragma force_top_level

#ifndef __load_h
#define __load_h

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  load
 *  load_initBuf
 *  load_killBuf
 *  load_extendBuf
 *  load_doneBuf
 *  load_file
 */

/* --- load --- *
 *
 * On entry:	R0 == pointer to entry point block
 *		R1 == value of R10 to pass to entry points
 *		R2 == value of R12 to pass to entry points
 *
 * On exit:	--
 *
 * Use:		Attempts to load a file after receipt of a Message_DataSave,
 *		Message_DataLoad or Message_DataOpen.  If user entries for
 *		RAM transfer are provided, this is attempted, although the
 *		entries must also be aware that file transfer may be
 *		required.
 */

extern routine load;

/* --- load_initBuf --- *
 *
 * On entry:	R1 == estimated file size
 *		R2 == pointer to flex anchor (unallocated)
 *
 * On exit:	R0 == pointer to buffer start
 *		R1 == buffer size
 *		May return an error
 *
 * Use:		Initialises a flex block for use as a RAM transfer buffer.
 *		This routine is suitable for use as the initBuf routine for
 *		RAM transfer loading.
 */

extern routine load_initBuf;

/* --- load_killBuf --- *
 *
 * On entry:	R2 == pointer to flex anchor
 *
 * On exit:	--
 *
 * Use:		Frees a flex block.  This routine should be used to free
 *		the buffer used for RAM transfer.
 */

extern routine load_killBuf;

/* --- load_extendBuf --- *
 *
 * On entry:	R0 == pointer to previous buffer
 *		R1 == size of previous buffer
 *		R2 == pointer to flex anchor
 *
 * On exit:	R0 == pointer to a new buffer
 *		R1 == size of the new buffer
 *		May return an error
 *
 * Use:		Extends the flex block if it was initially too small.
 *		This routine is designed to be used as the extend routine
 *		during RAM transfer.
 */

extern routine load_extendBuf;

/* --- load_doneBuf --- *
 *
 * On entry:	R1 == actual size of data
 *		R2 == pointer to flex anchor
 *
 * On exit:	--
 *
 * Use:		Sets the block into which the data has been loaded to the
 *		correct exact size.
 */

extern routine load_doneBuf;

/* --- load_file --- *
 *
 * On entry:	R1 == pointer to filename to load
 *		R2 == pointer to flex anchor
 *
 * On exit:	R0 == size of file loaded
 *		May return an error
 *
 * Use:		Loads a named file into a flex block for your delectation.
 */

extern routine load_file;

/*----- User entry points -------------------------------------------------*/

#define lEntry__initBuf 0

#define lEntry__killBuf 4

#define lEntry__extend 8

#define lEntry__doneBuf 12

#define lEntry__file 16

#define lEntry__done 20

#define lEntry__failed 24

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

#endif
