Changeset 154 for trunk/src/matlab/rpLibGetString.cc
- Timestamp:
- Jan 11, 2006, 3:55:15 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibGetString.cc
r135 r154 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * retStr= rpLibGetString(libHandle,path)5 * [retStr,err] = rpLibGetString(libHandle,path) 6 6 * 7 7 * ====================================================================== … … 16 16 #include "RpMatlabInterface.h" 17 17 18 /**********************************************************************/ 19 // METHOD: [retStr,err] = rpLibGetString(libHandle,path) 20 /// Query the value of a node. 21 /** 22 * Clients use this to query the value of a node. If the path 23 * is not specified, it returns the value associated with the 24 * root node. Otherwise, it returns the value for the element 25 * specified by the path. Values are returned as strings. 26 * 27 * Error code, err=0 on success, anything else is failure. 28 */ 29 18 30 void mexFunction(int nlhs, mxArray *plhs[], 19 31 int nrhs, const mxArray *prhs[]) … … 21 33 int libIndex = 0; 22 34 int retLibIndex = 0; 35 int err = 1; 23 36 RpLibrary* lib = NULL; 24 37 char* path = NULL; … … 28 41 if (nrhs != 2) 29 42 mexErrMsgTxt("Two input required."); 30 else if (nlhs > 1)43 else if (nlhs > 2) 31 44 mexErrMsgTxt("Too many output arguments."); 32 45 … … 40 53 if (lib) { 41 54 retString = rpGetString(lib,path); 55 if (retString) { 56 err = 0; 57 } 42 58 } 43 59 } … … 45 61 /* Set C-style string output_buf to MATLAB mexFunction output*/ 46 62 plhs[0] = mxCreateString(retString); 63 plhs[1] = mxCreateDoubleScalar(err); 47 64 48 65 return;
Note: See TracChangeset
for help on using the changeset viewer.