source: trunk/lang/matlab/rpLibResult.cc @ 1109

Last change on this file since 1109 was 1109, checked in by dkearney, 16 years ago

removing tabs

File size: 1.8 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Matlab Rappture Library Source
4 *
5 *    [err] = rpLibResult(lib,status)
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/**********************************************************************/
19// METHOD: [err] = rpLibResult (libHandle,status)
20/// Write Rappture Library to run.xml and signal end of processing.
21/**
22 * Usually the last call of the program, this function signals to the gui
23 * that processing has completed and the output is ready to be
24 * displayed
25 */
26
27void mexFunction(int nlhs, mxArray *plhs[],
28                 int nrhs, const mxArray *prhs[])
29{
30    int libIndex = 0;
31    int err = 1;
32    int status = 0;
33    RpLibrary* lib = NULL;
34
35    /* Check for proper number of arguments. */
36    if (nrhs > 2) {
37        mexErrMsgTxt("At most two input allowed.");
38    }
39
40    if (nrhs < 1) {
41        mexErrMsgTxt("One input required.");
42    }
43
44    // grab the integer value of the library handle
45    libIndex = getIntInput(prhs[0]);
46
47    if (nrhs == 2) {
48        status = getIntInput(prhs[1]);
49    }
50
51    /* Call the C subroutine. */
52    if (libIndex > 0) {
53        lib = (RpLibrary*) getObject_Void(libIndex);
54        if (lib) {
55            lib->put("tool.version.rappture.language", "matlab");
56            lib->result(status);
57            err = 0;
58            // cleanLibDict();
59        }
60    }
61
62    plhs[0] = mxCreateDoubleScalar(err);
63
64    return;
65}
Note: See TracBrowser for help on using the repository browser.