Ignore:
Timestamp:
Jan 11, 2006, 3:55:15 PM (19 years ago)
Author:
dkearney
Message:

modified matlab bindings and tests.
includes all popular functions available in RpLibrary? and RpUnits
compile and run, but not all tests work as they should
some of these functions will be removed soon because the id field is
no longer a valid argument. path ids should be incorporated in paths from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/matlab/rpLibXml.cc

    r135 r154  
    33 *  INTERFACE: Matlab Rappture Library Source
    44 *
    5  *    retStr = rpLibXml(lib)
     5 *    [retStr,err] = rpLibXml(lib)
    66 *
    77 * ======================================================================
     
    1616#include "RpMatlabInterface.h"
    1717
     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
    1827void mexFunction(int nlhs, mxArray *plhs[],
    1928                 int nrhs, const mxArray *prhs[])
     
    2130    const char* output_buf = NULL;
    2231    int libIndex = 0;
     32    int err = 1;
    2333    RpLibrary* lib = NULL;
    2434
     
    2636    if (nrhs != 1)
    2737        mexErrMsgTxt("One input required.");
    28     else if (nlhs > 1)
     38    else if (nlhs > 2)
    2939        mexErrMsgTxt("Too many output arguments.");
    3040
     
    3747        if (lib) {
    3848            output_buf = rpXml(lib);
     49            if (output_buf) {
     50                err = 0;
     51            }
    3952        }
    4053    }
     
    4255    /* Set C-style string output_buf to MATLAB mexFunction output*/
    4356    plhs[0] = mxCreateString(output_buf);
     57    plhs[1] = mxCreateDoubleScalar(err);
    4458
    4559    return;
Note: See TracChangeset for help on using the changeset viewer.