git-svn-id: http://moon:8086/svn/software/trunk/libsrc/_to_be_added@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
47 lines
1.3 KiB
C
Executable File
47 lines
1.3 KiB
C
Executable File
// -----------------------------------------------------------------------------------------
|
|
// mlio.h
|
|
// Input/output for Matlab matrices
|
|
// 26.02.2005, J. Ahrensfeld
|
|
//
|
|
// -----------------------------------------------------------------------------------------
|
|
#ifndef MLIO_H
|
|
#define MLIO_H
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
#define MLIO_READ 1
|
|
#define MLIO_WRITE 2
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
typedef struct _data_hdr_t
|
|
{
|
|
unsigned num_row, num_col;
|
|
unsigned size;
|
|
|
|
} data_hdr_t;
|
|
|
|
typedef struct _file_hdr_t
|
|
{
|
|
unsigned version;
|
|
char prec_typename[32];
|
|
|
|
} file_hdr_t;
|
|
|
|
typedef struct _mlio_t
|
|
{
|
|
FILE *pFile;
|
|
unsigned io_mode;
|
|
|
|
file_hdr_t hdr_file;
|
|
data_hdr_t hdr_data;
|
|
} mlio_t;
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
int mlio_open(mlio_t *pObj, char *pName, unsigned mode);
|
|
int mlio_close(mlio_t *pObj);
|
|
int mlio_read(mlio_t *pObj, double *pData);
|
|
int mlio_write(mlio_t *pObj, double *pData, unsigned num_rows, unsigned num_cols);
|
|
|
|
// -----------------------------------------------------------------------------------------
|
|
#endif //MLIO_H
|
|
|