****************************************************************************
*
*	This Amiga shared library is based on example source code
*	written by Gary Samad & Bill Hawes. It also employs basic
*	library concepts introduced by Jimm Mackraz (ELib) and
*	Edwin Hoogerbeets (MkLib). This library was generated using
*	a customized version of the MkLib utility.
*
****************************************************************************
*
*	This is the skeleton for an Amiga Exec library.
*	This version is written for Aztec C. It is based on the example
*	library by Jimm Mackraz who got some stuff from Neil Katin.
*
****************************************************************************

	INCLUDE	'exec/types.i'

Setup	MACRO
	MOVEM.L	D2/D3/D4-D7/A2-A6,-(SP)
	JSR	_geta4
	ENDM

Push	MACRO
	MOVE.L	\1,-(SP)
	ENDM

Fix	MACRO
	IFC	'\1',''
		MEXIT
	ENDC
	IFLE	\1-8
		ADDQ.L	#\1,SP
	ENDC
	IFGT	\1-8
		LEA	\1(SP),SP
	ENDC
	ENDM

Restore	MACRO
	Fix	\1
	MOVEM.L	(SP)+,D2/D3/D4-D7/A2-A6
	RTS
	ENDM

	DSEG

	PUBLIC	_LibFuncTab

_LibFuncTab:
	DC.L	LibOpen
	DC.L	LibClose
	DC.L	LibExpunge
	DC.L	0
	DC.L	XCreateRexxHost
	DC.L	XDeleteRexxHost
	DC.L	XSendRexxCommand
	DC.L	XFreeRexxCommand
	DC.L	XReplyRexxCommand
	DC.L	XGetRexxCommand
	DC.L	XGetRexxArg
	DC.L	XGetRexxResult1
	DC.L	XGetRexxResult2
	DC.L	XGetToken
	DC.L	XGetStringValue
	DC.L	XBuildValueString
	DC.L	-1

	CSEG

	PUBLIC	_RealOpen
	PUBLIC	_RealClose
	PUBLIC	_RealExpunge
	PUBLIC	_CreateRexxHost
	PUBLIC	_DeleteRexxHost
	PUBLIC	_SendRexxCommand
	PUBLIC	_FreeRexxCommand
	PUBLIC	_ReplyRexxCommand
	PUBLIC	_GetRexxCommand
	PUBLIC	_GetRexxArg
	PUBLIC	_GetRexxResult1
	PUBLIC	_GetRexxResult2
	PUBLIC	_GetToken
	PUBLIC	_GetStringValue
	PUBLIC	_BuildValueString

	PUBLIC	_geta4

LibOpen:
	Setup
	Push	A6
	JSR	_RealOpen
	Restore	4

LibClose:
	Setup
	Push	A6
	JSR	_RealClose
	Restore	4

LibExpunge:
	Setup
	Push	A6
	JSR	_RealExpunge
	Restore	4

XCreateRexxHost:
	Setup
	Push	D0
	JSR	_CreateRexxHost
	Restore 4

XDeleteRexxHost:
	Setup
	Push	D0
	JSR	_DeleteRexxHost
	Restore 4

XSendRexxCommand:
	Setup
	Push	A1
	Push	A0
	Push	D1
	Push	D0
	JSR	_SendRexxCommand
	Restore 16

XFreeRexxCommand:
	Setup
	Push	D0
	JSR	_FreeRexxCommand
	Restore 4

XReplyRexxCommand:
	Setup
	Push	A1
	Push	A0
	Push	D1
	Push	D0
	JSR	_ReplyRexxCommand
	Restore 16

XGetRexxCommand:
	Setup
	Push	D0
	JSR	_GetRexxCommand
	Restore 4

XGetRexxArg:
	Setup
	Push	D0
	JSR	_GetRexxArg
	Restore 4

XGetRexxResult1:
	Setup
	Push	D0
	JSR	_GetRexxResult1
	Restore 4

XGetRexxResult2:
	Setup
	Push	D0
	JSR	_GetRexxResult2
	Restore 4

XGetToken:
	Setup
	Push	A1
	Push	A0
	Push	D1
	Push	D0
	JSR	_GetToken
	Restore 16

XGetStringValue:
	Setup
	Push	D0
	JSR	_GetStringValue
	Restore 4

XBuildValueString:
	Setup
	Push	D1
	Push	D0
	JSR	_BuildValueString
	Restore 8

	END
