/* * ---------------------------------------------------------------------- * INTERFACE: Matlab Rappture Library Source * * libHandle = rpLib(fileName) * * ====================================================================== * AUTHOR: Derrick Kearney, Purdue University * Copyright (c) 2004-2005 Purdue Research Foundation * * See the file "license.terms" for information on usage and * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * ====================================================================== */ #include "RpMatlabInterface.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { char *path; RpLibrary* lib = NULL; int libIndex = 0; /* Check for proper number of arguments. */ if (nrhs != 1) mexErrMsgTxt("One input required."); else if (nlhs > 1) mexErrMsgTxt("Too many output arguments."); path = getStringInput(prhs[0]); /* Call the C subroutine. */ if (path) { lib = rpLibrary(path); } libIndex = storeObject_Lib(lib); /* Set C-style string output_buf to MATLAB mexFunction output*/ plhs[0] = mxCreateDoubleScalar(libIndex); return; }