/* * ---------------------------------------------------------------------- * INTERFACE: Matlab Rappture Library Source * * rpPutString(libHandle,path,value,append) * * ====================================================================== * AUTHOR: Derrick Kearney, Purdue University * Copyright (c) 2005 * Purdue Research Foundation, West Lafayette, IN * ====================================================================== */ #include "RpMatlabInterface.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int libIndex = 0; int append = 0; RpLibrary* lib = NULL; RpLibrary* retLib = NULL; char* path = NULL; char* value = NULL; /* Check for proper number of arguments. */ if (nrhs != 4) mexErrMsgTxt("Two input required."); else if (nlhs > 0) mexErrMsgTxt("Too many output arguments."); libIndex = getIntInput(prhs[0]); path = getStringInput(prhs[1]); value = getStringInput(prhs[2]); append = getIntInput(prhs[3]); /* Call the C subroutine. */ if ( (libIndex > 0) && path && value ) { lib = getObject_Lib(libIndex); if (lib) { rpPutString(lib,path,value,append); } } return; }