PageRenderTime 23ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/matlab/cstruct/MatlabCStruct.h

http://github.com/Yniold/liftsrc
C Header | 28 lines | 14 code | 7 blank | 7 comment | 0 complexity | 5a9f7e81c42faee590313a38d4dd28b1 MD5 | raw file
 1//--------------------------------------------------------------
 2// file: MatlabCStruct.h - Include file for MatlabCStruct.c
 3//--------------------------------------------------------------
 4
 5//--------------------------------------------------------------
 6// ELEMENT_ATTRIBUTES
 7//--------------------------------------------------------------
 8typedef struct
 9{
10  int ElementSize; // Number of bytes required for storage of a single element in a Matlab array
11  int ElementCount; // Number of elements in array
12  int StorageSize; // Number of bytes required for storage of a single element in a C Structure
13  int Alignment; // 1, 2, 4, or 8 denoting required byte alignment for this structure.
14} ELEMENT_ATTRIBUTES;
15
16extern int MatlabCStruct_DebugFlag;
17
18// Function prototypes
19ELEMENT_ATTRIBUTES MatlabCStruct(const mxArray *pArray, int MemoryAlignment, int NestLevel,
20                                     unsigned char *pDataDest, unsigned char *pDataSource,
21                                     int SwapFlag);
22char *ClassIDText(const mxArray *pArray);
23void SwapBytes(char *p0, int size, int count);
24#define SWAP(x) SwapBytes(&(x), sizeof(x))
25
26
27
28