source: trunk/src/octave/rpLibResult.cc @ 829

Last change on this file since 829 was 789, checked in by dkearney, 17 years ago

adding tool.version.rappture.language to xml files to keep track of language usage

File size: 2.0 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Octave Rappture Library Source
4 *
5 *    [err] = rpLibResult(libHandle)
6 *
7 * ======================================================================
8 *  AUTHOR:  Derrick Kearney, Purdue University
9 *  Copyright (c) 2005
10 *  Purdue Research Foundation, West Lafayette, IN
11 * ======================================================================
12 */
13
14#include "RpOctaveInterface.h"
15
16/**********************************************************************/
17// METHOD: [err] = rpLibResult (libHandle)
18/// Write Rappture Library to run.xml and signal end of processing.
19/**
20 * Usually the last call of the program, this function signals to the gui
21 * that processing has completed and the output is ready to be
22 * displayed
23 */
24
25DEFUN_DLD (rpLibResult, args, ,
26"-*- texinfo -*-\n\
27[err] = rpLibResult (@var{libHandle})\n\
28\n\
29Usually the last call of the program, this function signals to the gui\n\
30that processing has completed and the output is ready to be\n\
31displayed\n\
32Error Codes: @var{err} = 0 is success, anything else is failure.")
33{
34    static std::string who = "rpLibResult";
35
36    // The list of values to return.
37    octave_value_list retval;
38
39    int nargin = args.length ();
40    RpLibrary* lib = NULL;
41    int libHandle = 0;
42    int err = 0;
43
44    if (nargin == 1) {
45        if (args(0).is_real_scalar ()) {
46            libHandle= args(0).int_value ();
47            /* Call the C subroutine. */
48            if (libHandle > 0) {
49                lib = getObject_Lib(libHandle);
50                if (lib) {
51                    lib->put("tool.version.rappture.language", "octave");
52                    lib->result();
53                    // cleanLibDict();
54                    err = 0;
55                }
56            }
57        }
58        else {
59            // wrong argument type
60            print_usage ("rpLib");
61        }
62    }
63    else {
64        // wrong number of arguments
65        print_usage ("rpLib");
66    }
67
68    retval(0) = err;
69
70  return retval;
71}
Note: See TracBrowser for help on using the repository browser.