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/rpLibGetString.cc

    r135 r154  
    33 *  INTERFACE: Matlab Rappture Library Source
    44 *
    5  *    retStr = rpLibGetString(libHandle,path)
     5 *    [retStr,err] = rpLibGetString(libHandle,path)
    66 *
    77 * ======================================================================
     
    1616#include "RpMatlabInterface.h"
    1717
     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
    1830void mexFunction(int nlhs, mxArray *plhs[],
    1931                 int nrhs, const mxArray *prhs[])
     
    2133    int         libIndex    = 0;
    2234    int         retLibIndex = 0;
     35    int         err         = 1;
    2336    RpLibrary*  lib         = NULL;
    2437    char*       path        = NULL;
     
    2841    if (nrhs != 2)
    2942        mexErrMsgTxt("Two input required.");
    30     else if (nlhs > 1)
     43    else if (nlhs > 2)
    3144        mexErrMsgTxt("Too many output arguments.");
    3245
     
    4053        if (lib) {
    4154            retString = rpGetString(lib,path);
     55            if (retString) {
     56                err = 0;
     57            }
    4258        }
    4359    }
     
    4561    /* Set C-style string output_buf to MATLAB mexFunction output*/
    4662    plhs[0] = mxCreateString(retString);
     63    plhs[1] = mxCreateDoubleScalar(err);
    4764
    4865    return;
Note: See TracChangeset for help on using the changeset viewer.