#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <limits>
#include <map>
#include <set>
#include <string>
#include "f77-fcn.h"
#include "lo-ieee.h"
#include "oct-locbuf.h"
#include "quit.h"
#include "Cell.h"
#include "error.h"
#include "interpreter-private.h"
#include "interpreter.h"
#include "mxarray.h"
#include "mexproto.h"
#include "oct-map.h"
#include "ovl.h"
#include "ov.h"
#include "ov-classdef.h"
#include "ov-mex-fcn.h"
#include "ov-usr-fcn.h"
#include "pager.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "graphics.h"
Go to the source code of this file.
Macros | |
#define | CONST_MUTATION_METHOD(RET_TYPE, FCN_NAME, ARG_LIST, RET_VAL) RET_TYPE FCN_NAME ARG_LIST const { request_mutation (); return RET_VAL; } |
#define | CONST_VOID_MUTATION_METHOD(FCN_NAME, ARG_LIST) void FCN_NAME ARG_LIST const { request_mutation (); } |
#define | GET_DATA_METHOD(RT, FCN_NAME, ID, COMPLEXITY) RT * FCN_NAME (void) const { return get_data<RT> (ID, COMPLEXITY); } |
#define | MUTATION_METHOD(RET_TYPE, FCN_NAME, ARG_LIST, RET_VAL) RET_TYPE FCN_NAME ARG_LIST { request_mutation (); return RET_VAL; } |
#define | VOID_MUTATION_METHOD(FCN_NAME, ARG_LIST) void FCN_NAME ARG_LIST { request_mutation (); } |
Typedefs | |
typedef void(* | cmex_fptr) (int nlhs, mxArray **plhs, int nrhs, mxArray **prhs) |
typedef F77_RET_T(* | fmex_fptr) (F77_INT &nlhs, mxArray **plhs, F77_INT &nrhs, mxArray **prhs) |
Variables | |
mex * | mex_context = nullptr |
std::map< std::string, int > | mex_lock_count |
#define CONST_MUTATION_METHOD | ( | RET_TYPE, | |
FCN_NAME, | |||
ARG_LIST, | |||
RET_VAL | |||
) | RET_TYPE FCN_NAME ARG_LIST const { request_mutation (); return RET_VAL; } |
#define CONST_VOID_MUTATION_METHOD | ( | FCN_NAME, | |
ARG_LIST | |||
) | void FCN_NAME ARG_LIST const { request_mutation (); } |
#define GET_DATA_METHOD | ( | RT, | |
FCN_NAME, | |||
ID, | |||
COMPLEXITY | |||
) | RT * FCN_NAME (void) const { return get_data<RT> (ID, COMPLEXITY); } |
#define MUTATION_METHOD | ( | RET_TYPE, | |
FCN_NAME, | |||
ARG_LIST, | |||
RET_VAL | |||
) | RET_TYPE FCN_NAME ARG_LIST { request_mutation (); return RET_VAL; } |
#define VOID_MUTATION_METHOD | ( | FCN_NAME, | |
ARG_LIST | |||
) | void FCN_NAME ARG_LIST { request_mutation (); } |
octave_value_list call_mex | ( | octave_mex_function & | mex_fcn, |
const octave_value_list & | args, | ||
int | nargout_arg | ||
) |
Definition at line 4469 of file mex.cc.
References mxArray::as_octave_value(), octave_mex_function::is_fmex(), octave_value_list::length(), mex_context, octave_mex_function::mex_fcn_ptr(), OCTAVE_LOCAL_BUFFER, and octave_value_list::resize().
Referenced by tree_evaluator::execute_mex_function().
int mexAtExit | ( | void(*)(void) | f | ) |
Definition at line 4988 of file mex.cc.
References octave_mex_function::atexit(), f, and mex_context.
int mexCallMATLAB | ( | int | nargout, |
mxArray * | argout[], | ||
int | nargin, | ||
mxArray * | argin[], | ||
const char * | fname | ||
) |
Definition at line 4579 of file mex.cc.
Referenced by mexCallMATLABWithTrap().
mxArray* mexCallMATLABWithTrap | ( | int | nargout, |
mxArray * | argout[], | ||
int | nargin, | ||
mxArray * | argin[], | ||
const char * | fname | ||
) |
Definition at line 4646 of file mex.cc.
References mex_context, mexCallMATLAB(), mexSetTrapFlag(), mxCreateCellMatrix(), mxCreateString(), mxCreateStructMatrix(), and mxSetFieldByNumber().
void mexErrMsgIdAndTxt | ( | const char * | id, |
const char * | fmt, | ||
... | |||
) |
Definition at line 4767 of file mex.cc.
References error(), len, mexFunctionName(), OCTAVE_LOCAL_BUFFER, strlen(), and verror_with_id().
void mexErrMsgTxt | ( | const char * | s | ) |
Definition at line 4744 of file mex.cc.
References error(), len, mexFunctionName(), and strlen().
Referenced by mexGetVariable(), mexPutVariable(), and mxIsFromGlobalWS().
int mexEvalString | ( | const char * | s | ) |
Definition at line 4677 of file mex.cc.
References __get_interpreter__().
mxArray* mexEvalStringWithTrap | ( | const char * | s | ) |
Definition at line 4706 of file mex.cc.
References __get_interpreter__(), mxCreateCellMatrix(), mxCreateString(), mxCreateStructMatrix(), and mxSetFieldByNumber().
const char* mexFunctionName | ( | void | ) |
Definition at line 4544 of file mex.cc.
References mex_context.
Referenced by mexErrMsgIdAndTxt(), mexErrMsgTxt(), mexIsLocked(), mexLock(), mexUnlock(), and mexWarnMsgIdAndTxt().
const mxArray* mexGet | ( | double | handle, |
const char * | property | ||
) |
Definition at line 5015 of file mex.cc.
References octave_value::as_mxArray(), get_property_from_handle(), octave_value::is_defined(), and m.
const mxArray * mexGet_interleaved | ( | double | handle, |
const char * | property | ||
) |
Definition at line 5001 of file mex.cc.
References octave_value::as_mxArray(), get_property_from_handle(), octave_value::is_defined(), and m.
mxArray* mexGetVariable | ( | const char * | space, |
const char * | name | ||
) |
Definition at line 4842 of file mex.cc.
References __get_interpreter__(), octave_value::is_defined(), mex_context, mexErrMsgTxt(), mxArray::set_name(), and strcmp().
Referenced by mexGetVariablePtr().
const mxArray* mexGetVariablePtr | ( | const char * | space, |
const char * | name | ||
) |
Definition at line 4893 of file mex.cc.
References mexGetVariable().
int mexIsGlobal | ( | const mxArray * | ptr | ) |
Definition at line 5029 of file mex.cc.
References mxIsFromGlobalWS().
int mexIsLocked | ( | void | ) |
Definition at line 5035 of file mex.cc.
References __get_interpreter__(), mex_context, and mexFunctionName().
void mexLock | ( | void | ) |
Definition at line 5054 of file mex.cc.
References __get_interpreter__(), mex_context, mex_lock_count, and mexFunctionName().
int mexPrintf | ( | const char * | fmt, |
... | |||
) |
Definition at line 4831 of file mex.cc.
References octave_stdout, and octave::vformat().
int mexPutVariable | ( | const char * | space, |
const char * | name, | ||
const mxArray * | ptr | ||
) |
Definition at line 4899 of file mex.cc.
References __get_interpreter__(), mxArray::as_octave_value(), mxArray::get_name(), mexErrMsgTxt(), and strcmp().
int mexSet | ( | double | handle, |
const char * | property, | ||
mxArray * | val | ||
) |
Definition at line 5072 of file mex.cc.
References mxArray::as_octave_value(), and set_property_in_handle().
void mexSetTrapFlag | ( | int | flag | ) |
Definition at line 4670 of file mex.cc.
References mex_context.
Referenced by mexCallMATLABWithTrap().
void mexUnlock | ( | void | ) |
Definition at line 5093 of file mex.cc.
References __get_interpreter__(), mex_context, mex_lock_count, and mexFunctionName().
void mexWarnMsgIdAndTxt | ( | const char * | id, |
const char * | fmt, | ||
... | |||
) |
Definition at line 4812 of file mex.cc.
References len, mexFunctionName(), OCTAVE_LOCAL_BUFFER, strlen(), and vwarning_with_id().
void mexWarnMsgTxt | ( | const char * | s | ) |
int mxAddField | ( | mxArray * | ptr, |
const char * | key | ||
) |
Definition at line 4381 of file mex.cc.
References mxArray::add_field().
char* mxArrayToString | ( | const mxArray * | ptr | ) |
Definition at line 4443 of file mex.cc.
References mxArray::array_to_string().
Definition at line 4449 of file mex.cc.
References mxArray::calc_single_subscript().
void* mxCalloc | ( | std::size_t | n, |
std::size_t | size | ||
) |
Definition at line 3597 of file mex.cc.
References mex_context, and n.
Definition at line 3650 of file mex.cc.
Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().
mxArray * mxCreateDoubleMatrix | ( | mwSize | nr, |
mwSize | nc, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateDoubleMatrix_interleaved | ( | mwSize | nr, |
mwSize | nc, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateNumericArray | ( | mwSize | ndims, |
const mwSize * | dims, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateNumericArray_interleaved | ( | mwSize | ndims, |
const mwSize * | dims, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateNumericMatrix | ( | mwSize | m, |
mwSize | n, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateNumericMatrix_interleaved | ( | mwSize | m, |
mwSize | n, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateSparse | ( | mwSize | m, |
mwSize | n, | ||
mwSize | nzmax, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateSparse_interleaved | ( | mwSize | m, |
mwSize | n, | ||
mwSize | nzmax, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateString | ( | const char * | str | ) |
Definition at line 3830 of file mex.cc.
Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().
Definition at line 3857 of file mex.cc.
Referenced by mexCallMATLABWithTrap(), and mexEvalStringWithTrap().
mxArray * mxCreateUninitNumericArray | ( | mwSize | ndims, |
const mwSize * | dims, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateUninitNumericArray_interleaved | ( | mwSize | ndims, |
const mwSize * | dims, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateUninitNumericMatrix | ( | mwSize | m, |
mwSize | n, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
mxArray * mxCreateUninitNumericMatrix_interleaved | ( | mwSize | m, |
mwSize | n, | ||
mxClassID | class_id, | ||
mxComplexity | flag | ||
) |
void mxDestroyArray | ( | mxArray * | ptr | ) |
Definition at line 3872 of file mex.cc.
References mex_context.
void mxFree | ( | void * | ptr | ) |
Definition at line 3616 of file mex.cc.
References mex_context.
Referenced by mxArray::~mxArray(), and mxArray::set_name().
Definition at line 4331 of file mex.cc.
References mxArray::get_cell().
Definition at line 4096 of file mex.cc.
References mxArray::get_data(), and mxIsChar().
Definition at line 4299 of file mex.cc.
References mxArray::get_class_id().
const char* mxGetClassName | ( | const mxArray * | ptr | ) |
Definition at line 4305 of file mex.cc.
References mxArray::get_class_name().
mxComplexDouble * mxGetComplexDoubles | ( | const mxArray * | p | ) |
Definition at line 4189 of file mex.cc.
References mxArray::get_complex_doubles().
mxComplexSingle * mxGetComplexSingles | ( | const mxArray * | p | ) |
Definition at line 4195 of file mex.cc.
References mxArray::get_complex_singles().
void* mxGetData | ( | const mxArray * | ptr | ) |
Definition at line 4111 of file mex.cc.
References mxArray::get_data().
Definition at line 4044 of file mex.cc.
References mxArray::get_dimensions().
Definition at line 4129 of file mex.cc.
References mxArray::get_doubles().
std::size_t mxGetElementSize | ( | const mxArray * | ptr | ) |
Definition at line 4455 of file mex.cc.
References mxArray::get_element_size().
Definition at line 4393 of file mex.cc.
References mxGetFieldByNumber(), and mxGetFieldNumber().
Definition at line 4400 of file mex.cc.
References mxArray::get_field_by_number().
Referenced by mxGetField().
const char* mxGetFieldNameByNumber | ( | const mxArray * | ptr, |
int | key_num | ||
) |
Definition at line 4425 of file mex.cc.
References mxArray::get_field_name_by_number().
int mxGetFieldNumber | ( | const mxArray * | ptr, |
const char * | key | ||
) |
Definition at line 4431 of file mex.cc.
References mxArray::get_field_number().
Referenced by mxGetField(), and mxSetField().
void * mxGetImagData | ( | const mxArray * | ptr | ) |
Definition at line 4123 of file mex.cc.
References mxArray::get_imag_data().
double mxGetInf | ( | void | ) |
Definition at line 3584 of file mex.cc.
References lo_ieee_inf_value().
Definition at line 4147 of file mex.cc.
References mxArray::get_int16s().
Definition at line 4153 of file mex.cc.
References mxArray::get_int32s().
Definition at line 4159 of file mex.cc.
References mxArray::get_int64s().
Definition at line 4141 of file mex.cc.
References mxArray::get_int8s().
Definition at line 4344 of file mex.cc.
References mxArray::get_ir().
Definition at line 4350 of file mex.cc.
References mxArray::get_jc().
Definition at line 4105 of file mex.cc.
References mxArray::get_data().
std::size_t mxGetM | ( | const mxArray * | ptr | ) |
Definition at line 4032 of file mex.cc.
References mxArray::get_m().
std::size_t mxGetN | ( | const mxArray * | ptr | ) |
Definition at line 4038 of file mex.cc.
References mxArray::get_n().
double mxGetNaN | ( | void | ) |
Definition at line 3590 of file mex.cc.
References lo_ieee_nan_value().
Definition at line 4050 of file mex.cc.
References mxArray::get_number_of_dimensions().
std::size_t mxGetNumberOfElements | ( | const mxArray * | ptr | ) |
Definition at line 4056 of file mex.cc.
References mxArray::get_number_of_elements().
int mxGetNumberOfFields | ( | const mxArray * | ptr | ) |
Definition at line 4419 of file mex.cc.
References mxArray::get_number_of_fields().
Definition at line 4356 of file mex.cc.
References mxArray::get_nzmax().
double * mxGetPi | ( | const mxArray * | ptr | ) |
Definition at line 4117 of file mex.cc.
References mxArray::get_imag_data().
double* mxGetPr | ( | const mxArray * | ptr | ) |
Definition at line 4084 of file mex.cc.
References mxArray::get_data().
Definition at line 4324 of file mex.cc.
References mxArray::get_property().
double mxGetScalar | ( | const mxArray * | ptr | ) |
Definition at line 4090 of file mex.cc.
References mxArray::get_scalar().
Definition at line 4135 of file mex.cc.
References mxArray::get_singles().
Definition at line 4437 of file mex.cc.
References mxArray::get_string().
Definition at line 4171 of file mex.cc.
References mxArray::get_uint16s().
Definition at line 4177 of file mex.cc.
References mxArray::get_uint32s().
Definition at line 4183 of file mex.cc.
References mxArray::get_uint64s().
Definition at line 4165 of file mex.cc.
References mxArray::get_uint8s().
bool mxIsCell | ( | const mxArray * | ptr | ) |
Definition at line 3880 of file mex.cc.
References mxArray::iscell().
bool mxIsChar | ( | const mxArray * | ptr | ) |
bool mxIsClass | ( | const mxArray * | ptr, |
const char * | name | ||
) |
Definition at line 3892 of file mex.cc.
References mxArray::is_class().
bool mxIsComplex | ( | const mxArray * | ptr | ) |
Definition at line 3898 of file mex.cc.
References mxArray::is_complex().
bool mxIsDouble | ( | const mxArray * | ptr | ) |
Definition at line 3904 of file mex.cc.
References mxArray::is_double().
bool mxIsEmpty | ( | const mxArray * | ptr | ) |
Definition at line 4009 of file mex.cc.
References mxArray::isempty().
bool mxIsFinite | ( | const double | v | ) |
Definition at line 3560 of file mex.cc.
References lo_ieee_isfinite.
bool mxIsFromGlobalWS | ( | const mxArray * | ptr | ) |
bool mxIsFunctionHandle | ( | const mxArray * | ptr | ) |
Definition at line 3910 of file mex.cc.
References mxArray::is_function_handle().
bool mxIsInf | ( | const double | v | ) |
Definition at line 3566 of file mex.cc.
References lo_ieee_isinf.
bool mxIsInt16 | ( | const mxArray * | ptr | ) |
Definition at line 3916 of file mex.cc.
References mxArray::is_int16().
bool mxIsInt32 | ( | const mxArray * | ptr | ) |
Definition at line 3922 of file mex.cc.
References mxArray::is_int32().
bool mxIsInt64 | ( | const mxArray * | ptr | ) |
Definition at line 3928 of file mex.cc.
References mxArray::is_int64().
bool mxIsInt8 | ( | const mxArray * | ptr | ) |
Definition at line 3934 of file mex.cc.
References mxArray::is_int8().
bool mxIsLogical | ( | const mxArray * | ptr | ) |
Definition at line 3940 of file mex.cc.
References mxArray::is_logical().
bool mxIsLogicalScalar | ( | const mxArray * | ptr | ) |
Definition at line 3995 of file mex.cc.
References mxArray::is_logical_scalar().
bool mxIsLogicalScalarTrue | ( | const mxArray * | ptr | ) |
Definition at line 4002 of file mex.cc.
References mxArray::is_logical_scalar_true().
bool mxIsNaN | ( | const double | v | ) |
Definition at line 3572 of file mex.cc.
References lo_ieee_isnan.
bool mxIsNumeric | ( | const mxArray * | ptr | ) |
Definition at line 3946 of file mex.cc.
References mxArray::is_numeric().
bool mxIsScalar | ( | const mxArray * | ptr | ) |
Definition at line 4015 of file mex.cc.
References mxArray::is_scalar().
bool mxIsSingle | ( | const mxArray * | ptr | ) |
Definition at line 3952 of file mex.cc.
References mxArray::is_single().
bool mxIsSparse | ( | const mxArray * | ptr | ) |
Definition at line 3958 of file mex.cc.
References mxArray::is_sparse().
bool mxIsStruct | ( | const mxArray * | ptr | ) |
Definition at line 3964 of file mex.cc.
References mxArray::is_struct().
bool mxIsUint16 | ( | const mxArray * | ptr | ) |
Definition at line 3970 of file mex.cc.
References mxArray::is_uint16().
bool mxIsUint32 | ( | const mxArray * | ptr | ) |
Definition at line 3976 of file mex.cc.
References mxArray::is_uint32().
bool mxIsUint64 | ( | const mxArray * | ptr | ) |
Definition at line 3982 of file mex.cc.
References mxArray::is_uint64().
bool mxIsUint8 | ( | const mxArray * | ptr | ) |
Definition at line 3988 of file mex.cc.
References mxArray::is_uint8().
int mxMakeArrayComplex | ( | mxArray * | ptr | ) |
int mxMakeArrayReal | ( | mxArray * | ptr | ) |
void* mxMalloc | ( | std::size_t | n | ) |
Definition at line 3603 of file mex.cc.
References mex_context, and n.
void* mxRealloc | ( | void * | ptr, |
std::size_t | size | ||
) |
Definition at line 3609 of file mex.cc.
References mex_context.
void mxRemoveField | ( | mxArray * | ptr, |
int | key_num | ||
) |
Definition at line 4387 of file mex.cc.
References mxArray::remove_field().
Definition at line 4337 of file mex.cc.
References mxArray::set_cell().
void mxSetClassName | ( | mxArray * | ptr, |
const char * | name | ||
) |
Definition at line 4311 of file mex.cc.
References mxArray::set_class_name().
int mxSetComplexDoubles | ( | mxArray * | p, |
mxComplexDouble * | d | ||
) |
Definition at line 4274 of file mex.cc.
References mxArray::set_complex_doubles().
int mxSetComplexSingles | ( | mxArray * | p, |
mxComplexSingle * | d | ||
) |
Definition at line 4280 of file mex.cc.
References mxArray::set_complex_singles().
void mxSetData | ( | mxArray * | ptr, |
void * | pr | ||
) |
Definition at line 4208 of file mex.cc.
References mxArray::set_data().
Definition at line 4075 of file mex.cc.
References mxArray::set_dimensions().
Definition at line 4214 of file mex.cc.
References mxArray::set_doubles().
Definition at line 4406 of file mex.cc.
References mxGetFieldNumber(), and mxSetFieldByNumber().
Definition at line 4413 of file mex.cc.
References mxArray::set_field_by_number().
Referenced by mexCallMATLABWithTrap(), mexEvalStringWithTrap(), and mxSetField().
Definition at line 4232 of file mex.cc.
References mxArray::set_int16s().
Definition at line 4238 of file mex.cc.
References mxArray::set_int32s().
Definition at line 4244 of file mex.cc.
References mxArray::set_int64s().
Definition at line 4226 of file mex.cc.
References mxArray::set_int8s().
Definition at line 4362 of file mex.cc.
References mxArray::set_ir().
Definition at line 4368 of file mex.cc.
References mxArray::set_jc().
Definition at line 4063 of file mex.cc.
References m, and mxArray::set_m().
Definition at line 4069 of file mex.cc.
References n, and mxArray::set_n().
Definition at line 4374 of file mex.cc.
References mxArray::set_nzmax().
void mxSetPr | ( | mxArray * | ptr, |
double * | pr | ||
) |
Definition at line 4202 of file mex.cc.
References mxArray::set_data().
void mxSetProperty | ( | mxArray * | ptr, |
mwIndex | idx, | ||
const char * | property_name, | ||
const mxArray * | property_value | ||
) |
Definition at line 4317 of file mex.cc.
References mxArray::set_property().
Definition at line 4220 of file mex.cc.
References mxArray::set_singles().
Definition at line 4256 of file mex.cc.
References mxArray::set_uint16s().
Definition at line 4262 of file mex.cc.
References mxArray::set_uint32s().
Definition at line 4268 of file mex.cc.
References mxArray::set_uint64s().
Definition at line 4250 of file mex.cc.
References mxArray::set_uint8s().
mex* mex_context = nullptr |
Definition at line 3476 of file mex.cc.
Referenced by call_mex(), mxArray::calloc(), mxArray::malloc(), mexAtExit(), mexCallMATLABWithTrap(), mexFunctionName(), mexGetVariable(), mexIsLocked(), mexLock(), mexSetTrapFlag(), mexUnlock(), mxCalloc(), mxDestroyArray(), mxFree(), mxMalloc(), and mxRealloc().
std::map<std::string, int> mex_lock_count |
Definition at line 5051 of file mex.cc.
Referenced by mexLock(), and mexUnlock().