Changeset 154 for trunk/src/matlab/rpLibNodeType.cc
- Timestamp:
- Jan 11, 2006 3:55:15 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/matlab/rpLibNodeType.cc
r135 r154 3 3 * INTERFACE: Matlab Rappture Library Source 4 4 * 5 * retStr= rpLibNodeType(lib)5 * [retStr,err] = rpLibNodeType(lib) 6 6 * 7 7 * ====================================================================== … … 16 16 #include "RpMatlabInterface.h" 17 17 18 /**********************************************************************/ 19 // METHOD: [retStr,err] = rpLibNodeType(nodeHandle) 20 /// Return the type name of the node represented by 'nodeHandle' 21 /** 22 * This method returns the type name of the node represented` 23 * by 'nodeHandle'. 24 * Error code, err=0 on success, anything else is failure. 25 */ 26 27 18 28 void mexFunction(int nlhs, mxArray *plhs[], 19 29 int nrhs, const mxArray *prhs[]) … … 21 31 const char *output_buf; 22 32 int libIndex = 0; 33 int err = 1; 23 34 RpLibrary* lib = NULL; 24 35 … … 26 37 if (nrhs != 1) 27 38 mexErrMsgTxt("One input required."); 28 else if (nlhs > 1)39 else if (nlhs > 2) 29 40 mexErrMsgTxt("Too many output arguments."); 30 41 … … 37 48 if (lib) { 38 49 output_buf = rpNodeType(lib); 50 if (output_buf) { 51 err = 0; 52 } 39 53 } 40 54 } … … 42 56 /* Set C-style string output_buf to MATLAB mexFunction output*/ 43 57 plhs[0] = mxCreateString(output_buf); 58 plhs[1] = mxCreateDoubleScalar(err); 44 59 45 60 return;
Note: See TracChangeset
for help on using the changeset viewer.