source: trunk/src/matlab/rpNodeComp.cc @ 115

Last change on this file since 115 was 115, checked in by mmc, 17 years ago

Updated all copyright notices.

File size: 1.3 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Matlab Rappture Library Source
4 *
5 *    retStr = rpNodeComp(nodeHandle)
6 *
7 * ======================================================================
8 *  AUTHOR:  Derrick Kearney, Purdue University
9 *  Copyright (c) 2004-2005  Purdue Research Foundation
10 *
11 *  See the file "license.terms" for information on usage and
12 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 * ======================================================================
14 */
15
16#include "RpMatlabInterface.h"
17
18void mexFunction(int nlhs, mxArray *plhs[],
19                 int nrhs, const mxArray *prhs[])
20{
21    const char *output_buf;
22    int libIndex = 0;
23    RpLibrary* lib = NULL;
24
25    /* Check for proper number of arguments. */
26    if (nrhs != 1)
27        mexErrMsgTxt("One input required.");
28    else if (nlhs > 1)
29        mexErrMsgTxt("Too many output arguments.");
30
31    // grab the integer value of the library handle
32    libIndex = getIntInput(prhs[0]);
33
34    /* Call the C subroutine. */
35    if (libIndex > 0) {
36        lib = getObject_Lib(libIndex);
37        if (lib) {
38            output_buf = rpNodeComp(lib);
39        }
40    }
41
42    /* Set C-style string output_buf to MATLAB mexFunction output*/
43    plhs[0] = mxCreateString(output_buf);
44
45    return;
46}
Note: See TracBrowser for help on using the repository browser.