source: trunk/src/matlab/rpPutString.cc @ 97

Last change on this file since 97 was 97, checked in by dkearney, 18 years ago

adding initial matlab bindings
few minor changes with other listed files

File size: 1.3 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Matlab Rappture Library Source
4 *
5 *    rpPutString(libHandle,path,value,append)
6 *
7 * ======================================================================
8 *  AUTHOR:  Derrick Kearney, Purdue University
9 *  Copyright (c) 2005
10 *  Purdue Research Foundation, West Lafayette, IN
11 * ======================================================================
12 */
13
14#include "RpMatlabInterface.h"
15
16void mexFunction(int nlhs, mxArray *plhs[],
17                 int nrhs, const mxArray *prhs[])
18{
19    int         libIndex = 0;
20    int         append = 0;
21    RpLibrary*  lib = NULL;
22    RpLibrary*  retLib = NULL;
23    char*       path = NULL;
24    char*       value = NULL;
25
26    /* Check for proper number of arguments. */
27    if (nrhs != 4)
28        mexErrMsgTxt("Two input required.");
29    else if (nlhs > 0)
30        mexErrMsgTxt("Too many output arguments.");
31
32    libIndex = getIntInput(prhs[0]);
33    path = getStringInput(prhs[1]);
34    value = getStringInput(prhs[2]);
35    append = getIntInput(prhs[3]);
36
37    /* Call the C subroutine. */
38    if ( (libIndex > 0) && path && value ) {
39        lib = getObject_Lib(libIndex);
40
41        if (lib) {
42            rpPutString(lib,path,value,append);
43        }
44    }
45
46    return;
47}
Note: See TracBrowser for help on using the repository browser.