1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * INTERFACE: Matlab Rappture Library Source |
---|
4 | * |
---|
5 | * rpLibPutString(libHandle,path,value,append) |
---|
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 | |
---|
18 | void mexFunction(int nlhs, mxArray *plhs[], |
---|
19 | int nrhs, const mxArray *prhs[]) |
---|
20 | { |
---|
21 | int libIndex = 0; |
---|
22 | int append = 0; |
---|
23 | RpLibrary* lib = NULL; |
---|
24 | RpLibrary* retLib = NULL; |
---|
25 | char* path = NULL; |
---|
26 | char* value = NULL; |
---|
27 | |
---|
28 | /* Check for proper number of arguments. */ |
---|
29 | if (nrhs != 4) |
---|
30 | mexErrMsgTxt("Two input required."); |
---|
31 | else if (nlhs > 0) |
---|
32 | mexErrMsgTxt("Too many output arguments."); |
---|
33 | |
---|
34 | libIndex = getIntInput(prhs[0]); |
---|
35 | path = getStringInput(prhs[1]); |
---|
36 | value = getStringInput(prhs[2]); |
---|
37 | append = getIntInput(prhs[3]); |
---|
38 | |
---|
39 | /* Call the C subroutine. */ |
---|
40 | if ( (libIndex > 0) && path && value ) { |
---|
41 | lib = getObject_Lib(libIndex); |
---|
42 | |
---|
43 | if (lib) { |
---|
44 | rpPutString(lib,path,value,append); |
---|
45 | } |
---|
46 | } |
---|
47 | |
---|
48 | return; |
---|
49 | } |
---|