User`s guide
5 Controlling Code Generation
5-12
mxArray * mprhs[1];
mxArray * mplhs[1];
int i;
mlf
F
Interface Function
TheCompileralwaysgeneratesthemlfF interface function,w hich contains the
“normal” C interface to the function. This code is the corresponding C interface
function (
mlfGasket) from the Sierpinski Gasket example. This function calls
the C
mgasket function.
if (nlhs > 1) {
mlfError(_mxarray0_);
}
if (nrhs > 1) {
mlfError(_mxarray2_);
}
for (i = 0; i < 1; ++i) {
mplhs[i] = mclGetUninitializedArray();
}
for (i = 0; i < 1 && i < nrhs; ++i) {
mprhs[i] = prhs[i];
}
for (; i < 1; ++i) {
mprhs[i] = NULL;
}
mlfEnterNewContext(0, 1, mprhs[0]);
mplhs[0] = Mgasket(nlhs, mprhs[0]);
mlfRestorePreviousContext(0, 1, mprhs[0]);
plhs[0] = mplhs[0];
}
Input argument
processing
Output argument
processing
Call to C
implementation
function