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