51 #if ! defined (octave_mexproto_h)
52 #define octave_mexproto_h 1
54 #include "octave-config.h"
56 #if defined (__cplusplus)
65 #if ! defined (MX_HAS_INTERLEAVED_COMPLEX)
66 # define MX_HAS_INTERLEAVED_COMPLEX 0
69 #define MXARRAY_TYPEDEFS_ONLY
71 #undef MXARRAY_TYPEDEFS_ONLY
76 int nrhs,
const mxArray *prhs[]);
101 extern OCTINTERP_API
int mexPrintf (
const char *fmt, ...);
108 extern OCTINTERP_API
int mexPutVariable (
const char *space,
const char *name,
111 #if MX_HAS_INTERLEAVED_COMPLEX
112 # define mexGet mexGet_interleaved
115 const char *property);
117 extern OCTINTERP_API
int mexSet (
double handle,
const char *property,
123 extern OCTINTERP_API
void mexLock (
void);
124 extern OCTINTERP_API
void mexUnlock (
void);
129 extern OCTINTERP_API
int mexAtExit (
void (*
f) (
void));
132 extern OCTINTERP_API
bool mxIsFinite (
double v);
133 extern OCTINTERP_API
bool mxIsInf (
double v);
134 extern OCTINTERP_API
bool mxIsNaN (
double v);
137 extern OCTINTERP_API
double mxGetEps (
void);
138 extern OCTINTERP_API
double mxGetInf (
void);
139 extern OCTINTERP_API
double mxGetNaN (
void);
142 extern OCTINTERP_API
void *
mxCalloc (
size_t n,
size_t size);
144 extern OCTINTERP_API
void *
mxRealloc (
void *ptr,
size_t size);
145 extern OCTINTERP_API
void mxFree (
void *ptr);
148 #if MX_HAS_INTERLEAVED_COMPLEX
149 # define mxCreateCellArray mxCreateCellArray_interleaved
150 # define mxCreateCellMatrix mxCreateCellMatrix_interleaved
151 # define mxCreateCharArray mxCreateCharArray_interleaved
152 # define mxCreateCharMatrixFromStrings mxCreateCharMatrixFromStrings_interleaved
153 # define mxCreateDoubleMatrix mxCreateDoubleMatrix_interleaved
154 # define mxCreateDoubleScalar mxCreateDoubleScalar_interleaved
155 # define mxCreateLogicalArray mxCreateLogicalArray_interleaved
156 # define mxCreateLogicalMatrix mxCreateLogicalMatrix_interleaved
157 # define mxCreateLogicalScalar mxCreateLogicalScalar_interleaved
158 # define mxCreateNumericArray mxCreateNumericArray_interleaved
159 # define mxCreateNumericMatrix mxCreateNumericMatrix_interleaved
160 # define mxCreateUninitNumericArray mxCreateUninitNumericArray_interleaved
161 # define mxCreateUninitNumericMatrix mxCreateUninitNumericMatrix_interleaved
162 # define mxCreateSparse mxCreateSparse_interleaved
163 # define mxCreateSparseLogicalMatrix mxCreateSparseLogicalMatrix_interleaved
164 # define mxCreateString mxCreateString_interleaved
165 # define mxCreateStructArray mxCreateStructArray_interleaved
166 # define mxCreateStructMatrix mxCreateStructMatrix_interleaved
265 #if MX_HAS_INTERLEAVED_COMPLEX
276 #if MX_HAS_INTERLEAVED_COMPLEX
292 extern OCTINTERP_API mxComplexInt8 * mxGetComplexInt8s (
const mxArray *p);
293 extern OCTINTERP_API mxComplexInt16 * mxGetComplexInt16s (
const mxArray *p);
294 extern OCTINTERP_API mxComplexInt32 * mxGetComplexInt32s (
const mxArray *p);
295 extern OCTINTERP_API mxComplexInt64 * mxGetComplexInt64s (
const mxArray *p);
296 extern OCTINTERP_API mxComplexUint8 * mxGetComplexUint8s (
const mxArray *p);
297 extern OCTINTERP_API mxComplexUint16 * mxGetComplexUint16s (
const mxArray *p);
298 extern OCTINTERP_API mxComplexUint32 * mxGetComplexUint32s (
const mxArray *p);
299 extern OCTINTERP_API mxComplexUint64 * mxGetComplexUint64s (
const mxArray *p);
309 #if MX_HAS_INTERLEAVED_COMPLEX
325 extern OCTINTERP_API
int mxSetComplexInt8s (
mxArray *p, mxComplexInt8 *
d);
326 extern OCTINTERP_API
int mxSetComplexInt16s (
mxArray *p, mxComplexInt16 *
d);
327 extern OCTINTERP_API
int mxSetComplexInt32s (
mxArray *p, mxComplexInt32 *
d);
328 extern OCTINTERP_API
int mxSetComplexInt64s (
mxArray *p, mxComplexInt64 *
d);
329 extern OCTINTERP_API
int mxSetComplexUint8s (
mxArray *p, mxComplexUint8 *
d);
330 extern OCTINTERP_API
int mxSetComplexUint16s (
mxArray *p, mxComplexUint16 *
d);
331 extern OCTINTERP_API
int mxSetComplexUint32s (
mxArray *p, mxComplexUint32 *
d);
332 extern OCTINTERP_API
int mxSetComplexUint64s (
mxArray *p, mxComplexUint64 *
d);
344 const char *property_name);
346 const char *property_name,
347 const mxArray *property_value);
371 mwIndex index,
int key_num);
374 const char *key,
mxArray *val);
395 #if defined (MEX_DEBUG)
397 # define mxAssert(expr, msg) \
405 "Assertion failed: %s, at line %d of file \"%s\".\n%s\n", \
406 #expr, __LINE__, __FILE__, msg); \
410 "Assertion failed: %s, at line %d of file \"%s\".\n", \
411 #expr, __LINE__, __FILE__); \
416 # define mxAssertS(expr, msg) \
424 "Assertion failed at line %d of file \"%s\".\n%s\n", \
425 __LINE__, __FILE__, msg); \
429 "Assertion failed at line %d of file \"%s\".\n", \
430 __LINE__, __FILE__); \
436 # define mxAssert(expr, msg)
437 # define mxAssertS(expr, msg)
440 #if defined (__cplusplus)
F77_RET_T const F77_INT & N
F77_RET_T const F77_INT const F77_INT const F77_INT const F77_DBLE const F77_DBLE F77_INT & M
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
F77_RET_T const F77_DBLE const F77_DBLE * f
OCTINTERP_API mxUint16 * mxGetUint16s(const mxArray *p)
OCTINTERP_API int mxSetDoubles(mxArray *p, mxDouble *d)
OCTINTERP_API mxDouble * mxGetDoubles(const mxArray *p)
OCTINTERP_API int mxSetUint8s(mxArray *p, mxUint8 *d)
OCTINTERP_API int mxSetInt16s(mxArray *p, mxInt16 *d)
OCTINTERP_API mxInt64 * mxGetInt64s(const mxArray *p)
OCTINTERP_API int mxSetComplexDoubles(mxArray *p, mxComplexDouble *d)
OCTINTERP_API mxUint64 * mxGetUint64s(const mxArray *p)
OCTINTERP_API mxComplexDouble * mxGetComplexDoubles(const mxArray *p)
OCTINTERP_API int mxSetUint32s(mxArray *p, mxUint32 *d)
OCTINTERP_API int mxSetInt8s(mxArray *p, mxInt8 *d)
OCTINTERP_API int mxSetUint16s(mxArray *p, mxUint16 *d)
OCTINTERP_API mxSingle * mxGetSingles(const mxArray *p)
OCTINTERP_API int mxSetInt32s(mxArray *p, mxInt32 *d)
OCTINTERP_API mxInt16 * mxGetInt16s(const mxArray *p)
OCTINTERP_API int mxSetUint64s(mxArray *p, mxUint64 *d)
OCTINTERP_API mxInt8 * mxGetInt8s(const mxArray *p)
OCTINTERP_API mxComplexSingle * mxGetComplexSingles(const mxArray *p)
OCTINTERP_API mxUint8 * mxGetUint8s(const mxArray *p)
OCTINTERP_API mxInt32 * mxGetInt32s(const mxArray *p)
OCTINTERP_API int mxSetInt64s(mxArray *p, mxInt64 *d)
OCTINTERP_API int mxSetComplexSingles(mxArray *p, mxComplexSingle *d)
OCTINTERP_API mxUint32 * mxGetUint32s(const mxArray *p)
OCTINTERP_API int mxMakeArrayComplex(mxArray *ptr)
OCTINTERP_API int mxMakeArrayReal(mxArray *ptr)
OCTINTERP_API int mxSetSingles(mxArray *p, mxSingle *d)
OCTINTERP_API double mxGetNaN(void)
OCTINTERP_API bool mxIsStruct(const mxArray *ptr)
OCTINTERP_API bool mxIsScalar(const mxArray *ptr)
OCTINTERP_API mwSize mxGetNumberOfDimensions(const mxArray *ptr)
OCTINTERP_API mxArray * mexEvalStringWithTrap(const char *s)
OCTINTERP_API double mxGetScalar(const mxArray *ptr)
OCTINTERP_API int mxGetNumberOfFields(const mxArray *ptr)
OCTINTERP_API double * mxGetPr(const mxArray *ptr)
OCTINTERP_API mxArray * mxCreateStructMatrix(mwSize rows, mwSize cols, int num_keys, const char **keys)
OCTINTERP_API mxLogical * mxGetLogicals(const mxArray *ptr)
OCTINTERP_API void * mxMalloc(size_t n)
OCTINTERP_API bool mxIsSparse(const mxArray *ptr)
OCTINTERP_API const mxArray * mexGetVariablePtr(const char *space, const char *name)
OCTINTERP_API bool mxIsLogicalScalarTrue(const mxArray *ptr)
OCTINTERP_API void mxSetData(mxArray *ptr, void *data)
OCTINTERP_API mxArray * mxGetFieldByNumber(const mxArray *ptr, mwIndex index, int key_num)
OCTINTERP_API bool mxIsUint16(const mxArray *ptr)
OCTINTERP_API size_t mxGetElementSize(const mxArray *ptr)
OCTINTERP_API size_t mxGetNumberOfElements(const mxArray *ptr)
OCTINTERP_API mxArray * mxCreateSparse(mwSize m, mwSize n, mwSize nzmax, mxComplexity flag)
OCTINTERP_API mxArray * mexGetVariable(const char *space, const char *name)
OCTINTERP_API void mxSetNzmax(mxArray *ptr, mwSize nzmax)
OCTINTERP_API mxArray * mxCreateUninitNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
OCTINTERP_API mwIndex * mxGetJc(const mxArray *ptr)
OCTINTERP_API bool mxIsComplex(const mxArray *ptr)
OCTINTERP_API bool mxIsLogicalScalar(const mxArray *ptr)
OCTINTERP_API bool mxIsInf(double v)
OCTINTERP_API mxArray * mxDuplicateArray(const mxArray *v)
OCTINTERP_API mwSize mxGetNzmax(const mxArray *ptr)
OCTINTERP_API const char * mxGetClassName(const mxArray *ptr)
OCTINTERP_API mwIndex * mxGetIr(const mxArray *ptr)
OCTINTERP_API void mexWarnMsgTxt(const char *s)
OCTINTERP_API bool mxIsUint64(const mxArray *ptr)
OCTINTERP_API mwIndex mxCalcSingleSubscript(const mxArray *ptr, mwSize nsubs, mwIndex *subs)
OCTINTERP_API bool mxIsClass(const mxArray *ptr, const char *name)
OCTINTERP_API int mexPrintf(const char *fmt,...)
OCTINTERP_API mxArray * mxCreateStructArray(mwSize ndims, const mwSize *dims, int num_keys, const char **keys)
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
OCTINTERP_API void mexSetTrapFlag(int flag)
OCTINTERP_API mxArray * mxCreateCellArray(mwSize ndims, const mwSize *dims)
OCTINTERP_API int mexIsLocked(void)
OCTINTERP_API mxArray * mxCreateNumericArray(mwSize ndims, const mwSize *dims, mxClassID class_id, mxComplexity flag)
OCTINTERP_API mxArray * mxCreateLogicalArray(mwSize ndims, const mwSize *dims)
OCTINTERP_API mxArray * mxCreateDoubleMatrix(mwSize nr, mwSize nc, mxComplexity flag)
OCTINTERP_API double * mxGetPi(const mxArray *ptr)
OCTINTERP_API mxArray * mxCreateSparseLogicalMatrix(mwSize m, mwSize n, mwSize nzmax)
OCTINTERP_API mxArray * mxCreateDoubleScalar(double val)
OCTINTERP_API bool mxIsInt16(const mxArray *ptr)
OCTINTERP_API bool mxIsDouble(const mxArray *ptr)
OCTINTERP_API void mxDestroyArray(mxArray *v)
OCTINTERP_API void mxSetFieldByNumber(mxArray *ptr, mwIndex index, int key_num, mxArray *val)
OCTINTERP_API double mxGetInf(void)
OCTINTERP_API mxArray * mxCreateUninitNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
OCTINTERP_API bool mxIsEmpty(const mxArray *ptr)
OCTINTERP_API mxArray * mxGetCell(const mxArray *ptr, mwIndex idx)
OCTINTERP_API void mxSetField(mxArray *ptr, mwIndex index, const char *key, mxArray *val)
OCTINTERP_API bool mxIsFinite(double v)
OCTINTERP_API void * mxCalloc(size_t n, size_t size)
OCTINTERP_API mxArray * mxCreateString(const char *str)
OCTINTERP_API mxArray * mxGetField(const mxArray *ptr, mwIndex index, const char *key)
OCTINTERP_API bool mxIsNaN(double v)
OCTINTERP_API bool mxIsInt8(const mxArray *ptr)
OCTINTERP_API void mxFree(void *ptr)
OCTINTERP_API int mexPutVariable(const char *space, const char *name, const mxArray *ptr)
OCTINTERP_API char * mxArrayToString(const mxArray *ptr)
OCTINTERP_API mxArray * mexCallMATLABWithTrap(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
OCTINTERP_API size_t mxGetN(const mxArray *ptr)
OCTINTERP_API void mxSetPr(mxArray *ptr, double *pr)
OCTINTERP_API mxArray * mxCreateLogicalScalar(mxLogical val)
OCTINTERP_API double mxGetEps(void)
OCTINTERP_API void mxSetImagData(mxArray *ptr, void *pi)
OCTINTERP_API mxArray * mxCreateCharMatrixFromStrings(mwSize m, const char **str)
OCTINTERP_API mxArray * mxCreateNumericMatrix(mwSize m, mwSize n, mxClassID class_id, mxComplexity flag)
OCTINTERP_API int mexEvalString(const char *s)
OCTINTERP_API mxArray * mxGetProperty(const mxArray *ptr, mwIndex idx, const char *property_name)
OCTINTERP_API mxChar * mxGetChars(const mxArray *ptr)
OCTINTERP_API void * mxGetData(const mxArray *ptr)
OCTINTERP_API void mexWarnMsgIdAndTxt(const char *id, const char *s,...)
OCTINTERP_API mxClassID mxGetClassID(const mxArray *ptr)
OCTINTERP_API void mexMakeMemoryPersistent(void *ptr)
OCTINTERP_API void mxSetIr(mxArray *ptr, mwIndex *ir)
OCTINTERP_API void mexErrMsgIdAndTxt(const char *id, const char *s,...)
OCTINTERP_API int mxSetDimensions(mxArray *ptr, const mwSize *dims, mwSize ndims)
OCTINTERP_API int mexSet(double handle, const char *property, mxArray *val)
OCTINTERP_API bool mxIsCell(const mxArray *ptr)
OCTINTERP_API void mxRemoveField(mxArray *ptr, int key_num)
OCTINTERP_API void mexMakeArrayPersistent(mxArray *ptr)
OCTINTERP_API size_t mxGetM(const mxArray *ptr)
OCTINTERP_API void mexUnlock(void)
OCTINTERP_API void * mxRealloc(void *ptr, size_t size)
OCTINTERP_API int mexIsGlobal(const mxArray *ptr)
OCTINTERP_API mxArray * mxCreateCellMatrix(mwSize m, mwSize n)
OCTINTERP_API mxArray * mxCreateCharArray(mwSize ndims, const mwSize *dims)
OCTINTERP_API void mxSetPi(mxArray *ptr, double *pi)
OCTINTERP_API void mexErrMsgTxt(const char *s)
OCTINTERP_API int mexCallMATLAB(int nargout, mxArray *argout[], int nargin, mxArray *argin[], const char *fname)
OCTINTERP_API bool mxIsUint8(const mxArray *ptr)
OCTINTERP_API bool mxIsUint32(const mxArray *ptr)
OCTINTERP_API const mxArray * mexGet(double handle, const char *property)
OCTINTERP_API const mwSize * mxGetDimensions(const mxArray *ptr)
OCTINTERP_API bool mxIsFromGlobalWS(const mxArray *ptr)
OCTINTERP_API void mxSetClassName(mxArray *ptr, const char *name)
OCTINTERP_API const char * mexFunctionName(void)
OCTINTERP_API int mexAtExit(void(*f)(void))
OCTINTERP_API bool mxIsNumeric(const mxArray *ptr)
OCTINTERP_API const char * mxGetFieldNameByNumber(const mxArray *ptr, int key_num)
OCTINTERP_API bool mxIsFunctionHandle(const mxArray *ptr)
OCTINTERP_API void * mxGetImagData(const mxArray *ptr)
OCTINTERP_API int mxGetString(const mxArray *ptr, char *buf, mwSize buflen)
OCTINTERP_API int mxAddField(mxArray *ptr, const char *key)
OCTINTERP_API void mxSetN(mxArray *ptr, mwSize N)
OCTINTERP_API void mxSetM(mxArray *ptr, mwSize M)
OCTINTERP_API bool mxIsLogical(const mxArray *ptr)
OCTINTERP_API bool mxIsSingle(const mxArray *ptr)
OCTINTERP_API void mxSetCell(mxArray *ptr, mwIndex idx, mxArray *val)
OCTINTERP_API bool mxIsInt32(const mxArray *ptr)
OCTINTERP_API int mxGetFieldNumber(const mxArray *ptr, const char *key)
OCTINTERP_API void mexLock(void)
OCTINTERP_API bool mxIsChar(const mxArray *ptr)
OCTINTERP_API void mxSetJc(mxArray *ptr, mwIndex *jc)
OCTINTERP_API bool mxIsInt64(const mxArray *ptr)
OCTINTERP_API mxArray * mxCreateLogicalMatrix(mwSize m, mwSize n)
OCTINTERP_API void mxSetProperty(mxArray *ptr, mwIndex idx, const char *property_name, const mxArray *property_value)