11#if defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3))
19# define LIBMWMEX_API_EXTERN_C extern "C"
21# define LIBMWMEX_API_EXTERN_C extern
25# define MWMEX_EXPORT_SYM __declspec(dllexport)
27# define MWMEX_EXPORT_SYM __attribute__ ((visibility("default")))
29# define MWMEX_EXPORT_SYM
32#ifdef MW_NEEDS_VERSION_H
33# define MEXFUNCTION_LINKAGE LIBMWMEX_API_EXTERN_C MWMEX_EXPORT_SYM
35# define MEXFUNCTION_LINKAGE LIBMWMEX_API_EXTERN_C
41typedef struct impl_info_tag *MEX_impl_info;
49typedef void (*mex_exit_fn)(void);
61#define cicompare(s1,s2) utStrcmpi((s1),(s2))
63#define cicompare(s1,s2) strcmp((s1),(s2))
65#define cscompare(s1,s2) strcmp((s1),(s2))
81 void (*initialize)(void);
82 void (*terminate)(void);
85#define MEX_INFORMATION_VERSION 1
87typedef void (*fn_clean_up_after_error)(void);
88typedef const char *(*fn_simple_function_to_string)(mxFunctionPtr f);
94#if defined(TARGET_API_VERSION)
95#if !(TARGET_API_VERSION == 700 || TARGET_API_VERSION == 800)
96#error invalid TARGET_VERSION_API definition
97#elif defined(MEX_DOUBLE_HANDLE) && TARGET_API_VERSION != 700
98#error It is illegal to use MEX_DOUBLE_HANDLE with linear versioning
99#elif defined(MX_COMPAT_32) && TARGET_API_VERSION != 700
100#error It is illegal to use MX_COMPAT_32 with linear versioning
105#if !defined(TARGET_API_VERSION) || TARGET_API_VERSION == 700
106#ifndef MEX_DOUBLE_HANDLE
107#define mexCallMATLAB mexCallMATLABWithObject
108#define mexCallMATLABWithTrap mexCallMATLABWithTrapWithObject
109#define mexGetVariable mexGetVariableWithObject
111NULL;do{mexGetIsDeprecated x;}while(0)
112#define mexSet(a,b,c) \
1130;do{mexSetIsDeprecated x;}while(0)
115#define mexSetTrapFlag(a) \
1160;do{mexSetTrapFlagIsDeprecated x;}while(0)
119#elif TARGET_API_VERSION == 800
121#define mexCallMATLAB mexCallMATLAB_800
122#define mexCallMATLABWithTrap mexCallMATLABWithTrap_800
123#define mexEvalString mexEvalString_800
124#define mexEvalStringWithTrap mexEvalStringWithTrap_800
125#define mexGet mexGetIsDeprecated
126#define mexSet mexSetIsDeprecated
127#define mexGetVariable mexGetVariable_800
128#define mexGetVariablePtr mexGetVariablePtr_800
129#define mexPutVariable mexPutVariable_800
130#define mexPrintf mexPrintf_800
131#define mexSetTrapFlag mexSetTrapFlagIsDeprecated
132#define mexErrMsgIdAndTxt mexErrMsgIdAndTxt_800
133#define mexWarnMsgIdAndTxt mexWarnMsgIdAndTxt_800
134#define mexErrMsgTxt mexErrMsgTxt_800
135#define mexWarnMsgTxt mexWarnMsgTxt_800
136#define mexIsLocked mexIsLocked_800
137#define mexLock mexLock_800
138#define mexUnlock mexUnlock_800
139#define mexMakeArrayPersistent mexMakeArrayPersistent_800
140#define mexMakeMemoryPersistent mexMakeMemoryPersistent_800
141#define mexPrintAssertion mexPrintAssertion_800
142#define mexIsGlobal mexIsGlobal_800
143#define mexFunctionName mexFunctionName_800
144#define mexAtExit mexAtExit_800
150LIBMWMEX_API_EXTERN_C
void mexErrMsgTxt(
151 const char *error_msg
159LIBMWMEX_API_EXTERN_C
void mexErrMsgIdAndTxt(
160 const char * identifier,
161 const char * err_msg,
170LIBMWMEX_API_EXTERN_C
void mexWarnMsgTxt(
181LIBMWMEX_API_EXTERN_C
void mexWarnMsgIdAndTxt(
182 const char * identifier,
183 const char * warn_msg,
191LIBMWMEX_API_EXTERN_C
int mexPrintf(
197#define printf mexPrintf
206LIBMWMEX_API_EXTERN_C
void mexMakeArrayPersistent(
216LIBMWMEX_API_EXTERN_C
void mexMakeMemoryPersistent(
void *ptr);
222LIBMWMEX_API_EXTERN_C
int mexCallMATLAB(
234LIBMWMEX_API_EXTERN_C mxArray *mexCallMATLABWithTrap(
247LIBMWMEX_API_EXTERN_C
void mexPrintAssertion(
251 const char *message);
257LIBMWMEX_API_EXTERN_C
bool mexIsGlobal(
const mxArray *pA);
264LIBMWMEX_API_EXTERN_C
int mexPutVariable(
265 const char *workspace,
267 const mxArray *parray
275LIBMWMEX_API_EXTERN_C
const mxArray *mexGetVariablePtr(
276 const char *workspace,
285LIBMWMEX_API_EXTERN_C mxArray *mexGetVariable(
286 const char *workspace,
294LIBMWMEX_API_EXTERN_C
void mexLock(
void);
300LIBMWMEX_API_EXTERN_C
void mexUnlock(
void);
306LIBMWMEX_API_EXTERN_C
bool mexIsLocked(
void);
312LIBMWMEX_API_EXTERN_C
const char *mexFunctionName(
void);
319LIBMWMEX_API_EXTERN_C
int mexEvalString(
328LIBMWMEX_API_EXTERN_C mxArray* mexEvalStringWithTrap(
336LIBMWMEX_API_EXTERN_C
int mexAtExit(mex_exit_fn exit_fcn);
337#ifdef MEX_DOUBLE_HANDLE
340LIBMWMEX_API_EXTERN_C
const mxArray *mexGet(
double handle,
const char *property);
346LIBMWMEX_API_EXTERN_C
int mexSet(
double handle,
const char *property, mxArray *value);
360 const mxArray *prhs[]
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
Matlab entry function.
Definition: mex_speigs.c:47