Last change
on this file since 1085 was
1085,
checked in by dkearney, 16 years ago
|
adjusting matlab and octave bindings to use the void* bindings dictionary instead of the lib* dictionary in hopes that we can phase out the lib* dictionary.
|
File size:
1.3 KB
|
Line | |
---|
1 | /* |
---|
2 | * ---------------------------------------------------------------------- |
---|
3 | * INTERFACE: Matlab Rappture Library Source |
---|
4 | * |
---|
5 | * libHandle = rpLib(fileName) |
---|
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 | DEFUN_DLD (rpLib, args, , |
---|
17 | "[libHandle, err] = rpLib (fileName)\n\ |
---|
18 | \n\ |
---|
19 | Opens a Rappture Library Object based on the xml file 'fileName'.\n\ |
---|
20 | Returns a handle to the Rappture Library Object and an error flag.\n\ |
---|
21 | err = 0 is success, anything else is failure.") |
---|
22 | { |
---|
23 | static std::string who = "rpLib"; |
---|
24 | |
---|
25 | // The list of values to return. |
---|
26 | octave_value_list retval; |
---|
27 | |
---|
28 | int nargin = args.length (); |
---|
29 | std::string path = ""; |
---|
30 | RpLibrary* lib = NULL; |
---|
31 | int libIndex = 0; |
---|
32 | |
---|
33 | retval(1) = 1; |
---|
34 | retval(0) = -1; |
---|
35 | |
---|
36 | if (nargin == 1) { |
---|
37 | if (args(0).is_string ()) { |
---|
38 | path = args(0).string_value (); |
---|
39 | if (!path.empty()) { |
---|
40 | lib = new RpLibrary(path); |
---|
41 | retval(1) = 0; |
---|
42 | } |
---|
43 | } |
---|
44 | } |
---|
45 | else { |
---|
46 | print_usage ("fopen"); |
---|
47 | } |
---|
48 | |
---|
49 | retval(0) = storeObject_Void((void*)lib); |
---|
50 | |
---|
51 | return retval; |
---|
52 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.