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