/*
 * @(#)engine.h    generated by: makeheader    Mon Aug 22 12:51:22 1994
 *
 *		built from:	/rel/test42/bld/u2/extern/../matlab/platforms/sun4.ansi/src/extern/engintrf.c
 */

#ifndef engine_h
#define engine_h

#ifdef __cplusplus
    extern "C" {
#endif


#include <stdio.h>


#include "matrix.h"


/*
 * Decide when to use function prototypes.
 */
#ifdef __STDC__
#define USE_FUNCTION_PROTOTYPES
#endif
#ifdef __cplusplus
#define USE_FUNCTION_PROTOTYPES
#endif


#ifdef __STDC__
typedef struct engine Engine;	/* Incomplete definition for Engine */
#else
#ifdef __cplusplus
typedef struct engine Engine;	/* Incomplete definition for Engine */
#else
typedef char Engine;
#endif
#endif


#ifdef VMS
#define engOpen         CengOpen
#define engEvalString   CengEvalString
#define engClose        CengClose
#define engGetMatrix    CengGetMatrix
#define engPutMatrix    CengPutMatrix
#define engGetFull      CengGetFull
#define engPutFull      CengPutFull
#define engOutputBuffer CengOutputBuffer
#endif


/*
 * Execute matlab statement
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engEvalString(
	Engine	*ep,		/* engine pointer */
	char	*string		/* string for matlab t execute */
	);
#else
extern int engEvalString();
#endif


/*
 * Start remote matlab process
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern Engine *engOpen(
	char	*cmdstr		/* exec command string used to start matlab */
	);
#else
extern Engine *engOpen();
#endif


/*
 * Close down matlab server
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engClose(
	Engine	*ep         /* engine pointer */
	);
#else
extern int engClose();
#endif


/*
 * get a matrix from matlabs workspace
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern Matrix *engGetMatrix(
	Engine	*ep,		/* engine pointer */
	char	*name		/* name of matrix to get */
	);
#else
extern Matrix *engGetMatrix();
#endif


/*
 * put a matrix in matlabs workspace
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engPutMatrix(
	Engine	*ep,        /* engine pointer */
	Matrix	*mp         /* matrix pointer */
	);
#else
extern int engPutMatrix();
#endif


/*
 * get a full matrix from matlabs workspace
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engGetFull(
	Engine	*ep,		/* engine pointer */
	char	*name,		/* full matrix name */
	int     *m,         /* returned number of rows */
	int     *n,         /* returned number of columns */
	Real	**pr,		/* returned pointer to real part */
	Real	**pi		/* returned pointer to imaginary part */
	);
#else
extern int engGetFull();
#endif


/*
 * put a full matrix in matlabs workspace
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engPutFull(
	Engine	*ep,		/* engine pointer */
	char	*name,		/* full matrix name */
	int     m,          /* number of rows */
	int     n,          /* number of columns */
	Real	*pr,		/* pointer to real part */
	Real	*pi 		/* pointer to imaginary part */
	);
#else
extern int engPutFull();
#endif


/*
 * register a buffer to hold matlab text output
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int engOutputBuffer(
	Engine	*ep,		/* engine pointer */
	char	*buffer,	/* character array to hold output */
	int     buflen		/* buffer array length */
	);
#else
extern int engOutputBuffer();
#endif

#ifdef __cplusplus
    }	/* extern "C" */
#endif

#endif /* engine_h */
