F
fl
Hi,
I have a program which is originally from Matlab mex function. I would
like to rewrite it in order to run in plain C. The mex interface is a
Matlab standard. prhs is the call parameter pointer array. Some
pointers point to array while some point to integer. Matlab uses
different mxGetPr() to get pointer, or uses mxGetScalar() to get
value.
If I write the interface in general C, I try to define prhs as
pointer's point to integer. If I store some elements of plhs to
pointers while others to integer, the compiler gives warning. The
compiler wants prhs as the same level pointers. This kind of warning
is dangerous or not?
Another method I think is to use a structer to transfer data to the
function.
Do you have some good methods on my question? Thanks.
...................
int **plhs, **prhs;
prhs = ptr_arr;
mexFunction(nlhs, plhs, nrhs, prhs);
I have a program which is originally from Matlab mex function. I would
like to rewrite it in order to run in plain C. The mex interface is a
Matlab standard. prhs is the call parameter pointer array. Some
pointers point to array while some point to integer. Matlab uses
different mxGetPr() to get pointer, or uses mxGetScalar() to get
value.
If I write the interface in general C, I try to define prhs as
pointer's point to integer. If I store some elements of plhs to
pointers while others to integer, the compiler gives warning. The
compiler wants prhs as the same level pointers. This kind of warning
is dangerous or not?
Another method I think is to use a structer to transfer data to the
function.
Do you have some good methods on my question? Thanks.
...................
int **plhs, **prhs;
prhs = ptr_arr;
mexFunction(nlhs, plhs, nrhs, prhs);