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

#ifndef mat_h
#define mat_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


#define matREAD		0
#define matWRITE	1
#define matAPPEND	2


#ifdef __STDC__
typedef struct matfile MATFile;		/* Incomplete definition of MATFile */
#else
#ifdef __cplusplus
typedef struct matfile MATFile;		/* Incomplete definition of MATFile */
#else
typedef char MATFile;
#endif
#endif


#ifdef VMS
#define matOpen			CmatOpen
#define matClose		CmatClose
#define matGetFp		CmatGetFp
#define matGetDir		CmatGetDir
#define matDeleteMatrix		CmatDeleteMatrix
#define matGetMatrix		CmatGetMatrix
#define matPutMatrix		CmatPutMatrix
#define matGetNextMatrix	CmatGetNextMatrix
#define matGetFull		CmatGetFull
#define matPutFull		CmatPutFull
#define matGetString		CmatGetString
#define matPutString		CmatPutString
#endif


/*
 * Open a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern MATFile *matOpen(char *filename, char *mode);
#else
extern MATFile *matOpen();
#endif


/*
 * Close a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matClose(MATFile *ph);
#else
extern matClose();
#endif


/*
 * Get FILE pointer from a MAT-file handle
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern FILE *matGetFp(MATFile *ph);
#else
extern FILE *matGetFp();
#endif


/*
 * Get a directory of Matrices in a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern char **matGetDir(MATFile *ph, int *num);
#else
extern char **matGetDir();
#endif


/*
 * Delete named Matrix from a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matDeleteMatrix(MATFile *ph, const char *name);
#else
extern int matDeleteMatrix();
#endif


/*
 * Get Matrix from a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern Matrix *matGetMatrix(MATFile *ph, const char *name);
#else
extern Matrix *matGetMatrix();
#endif


/*
 * Put matrix into a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matPutMatrix(MATFile *ph, Matrix *mp);
#else
extern int matPutMatrix();
#endif


/*
 * Get the next matrix in the MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern Matrix *matGetNextMatrix(MATFile *ph);
#else
extern Matrix *matGetNextMatrix();
#endif


/*
 * Get full matrix from MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matGetFull(MATFile *ph, char *name, int *m, int *n, double **pr, double **pi);
#else
extern int matGetFull();
#endif


/*
 * Put full matrix into MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matPutFull(	MATFile	*ph, char *name, int m, int n, double *pr, double *pi);		
#else
extern int matPutFull();
#endif


/*
 * Get a string from a MAT-file matrix
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matGetString(MATFile *ph, char *name, char *string, int str_len);
#else
extern int matGetString();
#endif


/*
 * Put a string into a matrix on a MAT-file
 */
#ifdef USE_FUNCTION_PROTOTYPES
extern int matPutString(MATFile *ph, char *name, char *string);
#else
extern int matPutString();
#endif

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

#endif /* mat_h */
