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

#ifndef _TeXPrt_H
#define _TeXPrt_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_config
{
	long rc, rc2;
	struct {
		long save;
		char *saveas;
	} arg;
};

void rx_config( struct RexxHost *, struct rxd_config **, long, struct RexxMsg * );

struct rxd_copies
{
	long rc, rc2;
	struct {
		long *number;
	} arg;
};

void rx_copies( struct RexxHost *, struct rxd_copies **, long, struct RexxMsg * );

struct rxd_driver
{
	long rc, rc2;
	struct {
		long *number;
	} arg;
};

void rx_driver( struct RexxHost *, struct rxd_driver **, long, struct RexxMsg * );

struct rxd_dvifile
{
	long rc, rc2;
	struct {
		char *file;
	} arg;
};

void rx_dvifile( struct RexxHost *, struct rxd_dvifile **, long, struct RexxMsg * );

struct rxd_from_to
{
	long rc, rc2;
	struct {
		long document;
		long *from;
		long *to;
	} arg;
};

void rx_from_to( struct RexxHost *, struct rxd_from_to **, long, struct RexxMsg * );

struct rxd_hoffset
{
	long rc, rc2;
	struct {
		long *mm;
	} arg;
};

void rx_hoffset( struct RexxHost *, struct rxd_hoffset **, long, struct RexxMsg * );

struct rxd_option1
{
	long rc, rc2;
	struct {
		long on;
		long off;
	} arg;
};

void rx_option1( struct RexxHost *, struct rxd_option1 **, long, struct RexxMsg * );

struct rxd_option2
{
	long rc, rc2;
	struct {
		long on;
		long off;
	} arg;
};

void rx_option2( struct RexxHost *, struct rxd_option2 **, long, struct RexxMsg * );

struct rxd_option3
{
	long rc, rc2;
	struct {
		long on;
		long off;
	} arg;
};

void rx_option3( struct RexxHost *, struct rxd_option3 **, long, struct RexxMsg * );

struct rxd_option4
{
	long rc, rc2;
	struct {
		long on;
		long off;
	} arg;
};

void rx_option4( struct RexxHost *, struct rxd_option4 **, long, struct RexxMsg * );

struct rxd_orientation
{
	long rc, rc2;
	struct {
		long portrait;
		long landscape;
	} arg;
};

void rx_orientation( struct RexxHost *, struct rxd_orientation **, long, struct RexxMsg * );

struct rxd_pages
{
	long rc, rc2;
	struct {
		long all;
		long even;
		long odd;
	} arg;
};

void rx_pages( struct RexxHost *, struct rxd_pages **, long, struct RexxMsg * );

struct rxd_print
{
	long rc, rc2;
};

void rx_print( struct RexxHost *, struct rxd_print **, 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_reverse
{
	long rc, rc2;
	struct {
		long on;
		long off;
	} arg;
};

void rx_reverse( struct RexxHost *, struct rxd_reverse **, long, struct RexxMsg * );

struct rxd_toback
{
	long rc, rc2;
};

void rx_toback( struct RexxHost *, struct rxd_toback **, long, struct RexxMsg * );

struct rxd_tofront
{
	long rc, rc2;
};

void rx_tofront( struct RexxHost *, struct rxd_tofront **, long, struct RexxMsg * );

struct rxd_voffset
{
	long rc, rc2;
	struct {
		long *mm;
	} arg;
};

void rx_voffset( struct RexxHost *, struct rxd_voffset **, long, struct RexxMsg * );

#endif
