/*
 * Source generated with ARexxBox 1.12 (May 18 1993)
 * which is Copyright (c) 1992,1993 Michael Balzer
 */

#ifndef _MPMorph_H
#define _MPMorph_H

#define RXIF_INIT   1
#define RXIF_ACTION 2
#define RXIF_FREE   3

#define ARB_CF_ENABLED     (1L << 0)

#define ARB_HF_CMDSHELL    (1L << 0)
#define ARB_HF_USRMSGPORT  (1L << 1)

struct RexxHost
{
	struct MsgPort *port;
	char portname[ 80 ];
	long replies;
	struct RDArgs *rdargs;
	long flags;
	APTR userdata;
};

struct rxs_command
{
	char *command, *args, *results;
	long resindex;
	void (*function)( struct RexxHost *, void **, long, struct RexxMsg * );
	long flags;
};

struct arb_p_link
{
	char	*str;
	int		dst;
};

struct arb_p_state
{
	int		cmd;
	struct arb_p_link *pa;
};

#ifndef NO_GLOBALS
extern char RexxPortBaseName[80];
extern struct rxs_command rxs_commandlist[];
extern struct arb_p_state arb_p_state[];
extern int command_cnt;
extern char *rexx_extension;
#endif

void ReplyRexxCommand( struct RexxMsg *rxmsg, long prim, long sec, char *res );
void FreeRexxCommand( struct RexxMsg *rxmsg );
struct RexxMsg *CreateRexxCommand( struct RexxHost *host, char *buff, BPTR fh );
struct RexxMsg *CommandToRexx( struct RexxHost *host, struct RexxMsg *rexx_command_message );
struct RexxMsg *SendRexxCommand( struct RexxHost *host, char *buff, BPTR fh );

void CloseDownARexxHost( struct RexxHost *host );
struct RexxHost *SetupARexxHost( char *basename, struct MsgPort *usrport );
struct rxs_command *FindRXCommand( char *com );
char *ExpandRXCommand( struct RexxHost *host, char *command );
char *StrDup( char *s );
void ARexxDispatch( struct RexxHost *host );

/* rxd-Strukturen dürfen nur AM ENDE um lokale Variablen erweitert werden! */

struct rxd_addgrid
{
	long rc, rc2;
	struct {
		long *x;
		long *y;
		long force;
	} arg;
};

void rx_addgrid( struct RexxHost *, struct rxd_addgrid **, long, struct RexxMsg * );

struct rxd_addpoint
{
	long rc, rc2;
	struct {
		long *x1;
		long *y1;
		long *x2;
		long *y2;
	} arg;
};

void rx_addpoint( struct RexxHost *, struct rxd_addpoint **, long, struct RexxMsg * );

struct rxd_clear
{
	long rc, rc2;
	struct {
		long force;
	} arg;
};

void rx_clear( struct RexxHost *, struct rxd_clear **, long, struct RexxMsg * );

struct rxd_deletepoint
{
	long rc, rc2;
	struct {
		long *x;
		long *y;
	} arg;
};

void rx_deletepoint( struct RexxHost *, struct rxd_deletepoint **, long, struct RexxMsg * );

struct rxd_editpoints
{
	long rc, rc2;
};

void rx_editpoints( struct RexxHost *, struct rxd_editpoints **, long, struct RexxMsg * );

struct rxd_exitpoints
{
	long rc, rc2;
};

void rx_exitpoints( struct RexxHost *, struct rxd_exitpoints **, long, struct RexxMsg * );

struct rxd_getattr
{
	long rc, rc2;
	struct {
		char *var, *stem;
		char *name;
	} arg;
	struct {
		char *value;
	} res;
};

void rx_getattr( struct RexxHost *, struct rxd_getattr **, long, struct RexxMsg * );

struct rxd_help
{
	long rc, rc2;
	struct {
		char *var, *stem;
		char *command;
		long prompt;
	} arg;
	struct {
		char *commanddesc;
		char **commandlist;
	} res;
};

void rx_help( struct RexxHost *, struct rxd_help **, long, struct RexxMsg * );

struct rxd_linkpoints
{
	long rc, rc2;
	struct {
		long *x1;
		long *y1;
		long *x2;
		long *y2;
	} arg;
};

void rx_linkpoints( struct RexxHost *, struct rxd_linkpoints **, long, struct RexxMsg * );

struct rxd_lockgui
{
	long rc, rc2;
};

void rx_lockgui( struct RexxHost *, struct rxd_lockgui **, long, struct RexxMsg * );

struct rxd_movepoint
{
	long rc, rc2;
	struct {
		long *x;
		long *y;
		long *x1;
		long *y1;
		long *x2;
		long *y2;
	} arg;
};

void rx_movepoint( struct RexxHost *, struct rxd_movepoint **, long, struct RexxMsg * );

struct rxd_newpoints
{
	long rc, rc2;
	struct {
		long force;
	} arg;
};

void rx_newpoints( struct RexxHost *, struct rxd_newpoints **, long, struct RexxMsg * );

struct rxd_open
{
	long rc, rc2;
	struct {
		char *filename;
		long force;
	} arg;
};

void rx_open( struct RexxHost *, struct rxd_open **, long, struct RexxMsg * );

struct rxd_openpoints
{
	long rc, rc2;
	struct {
		char *filename;
		long force;
	} arg;
};

void rx_openpoints( struct RexxHost *, struct rxd_openpoints **, long, struct RexxMsg * );

struct rxd_quit
{
	long rc, rc2;
	struct {
		long force;
	} arg;
};

void rx_quit( struct RexxHost *, struct rxd_quit **, long, struct RexxMsg * );

struct rxd_save
{
	long rc, rc2;
};

void rx_save( struct RexxHost *, struct rxd_save **, long, struct RexxMsg * );

struct rxd_saveas
{
	long rc, rc2;
	struct {
		char *filename;
		long copy;
	} arg;
};

void rx_saveas( struct RexxHost *, struct rxd_saveas **, long, struct RexxMsg * );

struct rxd_scale
{
	long rc, rc2;
	struct {
		long *x;
		long *y;
		long force;
	} arg;
};

void rx_scale( struct RexxHost *, struct rxd_scale **, long, struct RexxMsg * );

struct rxd_setattr
{
	long rc, rc2;
	struct {
		char *name;
		char *value;
	} arg;
};

void rx_setattr( struct RexxHost *, struct rxd_setattr **, long, struct RexxMsg * );

struct rxd_setcurr
{
	long rc, rc2;
	struct {
		long *n;
	} arg;
};

void rx_setcurr( struct RexxHost *, struct rxd_setcurr **, long, struct RexxMsg * );

struct rxd_setmax
{
	long rc, rc2;
	struct {
		long *n;
	} arg;
};

void rx_setmax( struct RexxHost *, struct rxd_setmax **, long, struct RexxMsg * );

struct rxd_setmessage
{
	long rc, rc2;
	struct {
		char *message;
	} arg;
};

void rx_setmessage( struct RexxHost *, struct rxd_setmessage **, long, struct RexxMsg * );

struct rxd_setsize
{
	long rc, rc2;
	struct {
		long *x;
		long *y;
		long force;
	} arg;
};

void rx_setsize( struct RexxHost *, struct rxd_setsize **, long, struct RexxMsg * );

struct rxd_triangulate
{
	long rc, rc2;
	struct {
		long force;
	} arg;
};

void rx_triangulate( struct RexxHost *, struct rxd_triangulate **, long, struct RexxMsg * );

struct rxd_unlinkpoints
{
	long rc, rc2;
	struct {
		long *x1;
		long *y1;
		long *x2;
		long *y2;
	} arg;
};

void rx_unlinkpoints( struct RexxHost *, struct rxd_unlinkpoints **, long, struct RexxMsg * );

struct rxd_unlockgui
{
	long rc, rc2;
};

void rx_unlockgui( struct RexxHost *, struct rxd_unlockgui **, long, struct RexxMsg * );

#endif
