/* $Id: lcaGetRetryCount.c,v 1.5 2007/05/31 21:16:45 till Exp $ */ /* matlab wrapper for ezcaGetRetryCount */ /* Author: Till Straumann , 2002-2003 */ /* LICENSE: EPICS open license, see ../LICENSE file */ #include "mglue.h" #include #include void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { LcaError theErr; lcaErrorInit(&theErr); LHSCHECK(nlhs, plhs); if ( 1 < nlhs ) { lcaSetError(&theErr, EZCA_INVALIDARG, "Need one output arg"); goto cleanup; } if ( 0 != nrhs ) { lcaSetError(&theErr, EZCA_INVALIDARG, "Expected no rhs argument"); goto cleanup; } if ( ! (plhs[0] = mxCreateNumericMatrix( 1, 1, mxINT32_CLASS, mxREAL )) ) { lcaSetError(&theErr, EZCA_FAILEDMALLOC, "Not enough memory"); goto cleanup; } *(int*)mxGetData(plhs[0]) = ezcaGetRetryCount(); nlhs = 0; cleanup: ERR_CHECK(nlhs, plhs, &theErr); }