5864
|
1 /* |
|
2 |
|
3 Copyright (C) 2001, 2006 Paul Kienzle |
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
|
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
|
20 02110-1301, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 /* |
|
25 |
|
26 This code was originally distributed as part of Octave Forge under |
5900
|
27 the following terms: |
5864
|
28 |
|
29 Author: Paul Kienzle |
|
30 I grant this code to the public domain. |
|
31 2001-03-22 |
|
32 |
|
33 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
|
34 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
35 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
36 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
|
37 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|
38 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
|
39 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
|
40 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
41 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
|
42 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
43 SUCH DAMAGE. |
|
44 |
|
45 */ |
|
46 |
|
47 /* mex.h is for use in C-programs only; do NOT include it in mex.cc */ |
|
48 |
|
49 #if ! defined (MEX_H) |
|
50 #define MEX_H |
|
51 |
|
52 #define HAVE_OCTAVE |
|
53 |
|
54 typedef void mxArray; |
5879
|
55 |
5864
|
56 #if ! defined (__cplusplus) |
|
57 typedef int bool; |
|
58 #endif |
|
59 |
|
60 /* -V4 stuff */ |
|
61 #if defined (V4) |
|
62 #define Matrix mxArray |
|
63 #define REAL mxREAL |
|
64 #endif |
|
65 |
|
66 #define mxMAXNAME 64 |
|
67 |
|
68 #if defined (__cplusplus) |
|
69 extern "C" { |
|
70 #endif |
|
71 |
|
72 #if defined (V4) |
5879
|
73 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]); |
5864
|
74 #else |
5879
|
75 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]); |
5864
|
76 #endif |
|
77 |
|
78 #include "mexproto.h" |
|
79 |
|
80 /* V4 floating point routines renamed in V5. */ |
|
81 #define mexIsNaN mxIsNaN |
|
82 #define mexIsFinite mxIsFinite |
|
83 #define mexIsInf mxIsInf |
|
84 #define mexGetEps mxGetEps |
|
85 #define mexGetInf mxGetInf |
|
86 #define mexGetNaN mxGetNan |
|
87 |
|
88 #define mexGetGlobal(nm) mexGetArray (nm, "global") |
|
89 #define mexGetMatrix(nm) mexGetArray (nm, "caller") |
|
90 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller") |
|
91 |
5879
|
92 #define mexGetArray(nm, space) mexGetVariable (space, nm) |
|
93 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm) |
|
94 |
5864
|
95 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr) |
|
96 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr) |
|
97 |
|
98 #define mxCreateFull mxCreateDoubleMatrix |
|
99 |
|
100 #define mxCreateScalarDouble mxCreateDoubleScalar |
|
101 |
|
102 #define mxFreeMatrix mxDestroyArray |
|
103 |
|
104 #define mxIsString mxIsChar |
|
105 |
6048
|
106 /* Apparently these are also defined. */ |
|
107 |
|
108 #ifndef UINT64_T |
|
109 #define UINT64_T uint64_t |
|
110 #endif |
|
111 |
|
112 #ifndef uint64_T |
|
113 #define uint64_T uint64_t |
|
114 #endif |
|
115 |
|
116 #ifndef INT64_T |
|
117 #define INT64_T int64_t |
|
118 #endif |
|
119 |
|
120 #ifndef int64_T |
|
121 #define int64_T int64_t |
|
122 #endif |
|
123 |
|
124 #ifndef UINT32_T |
|
125 #define UINT32_T uint32_t |
|
126 #endif |
|
127 |
|
128 #ifndef uint32_T |
|
129 #define uint32_T uint32_t |
|
130 #endif |
|
131 |
|
132 #ifndef INT32_T |
|
133 #define INT32_T int32_t |
|
134 #endif |
|
135 |
|
136 #ifndef int32_T |
|
137 #define int32_T int32_t |
|
138 #endif |
|
139 |
|
140 #ifndef UINT16_T |
|
141 #define UINT16_T uint16_t |
|
142 #endif |
|
143 |
|
144 #ifndef uint16_T |
|
145 #define uint16_T uint16_t |
|
146 #endif |
|
147 |
|
148 #ifndef INT16_T |
|
149 #define INT16_T int16_t |
|
150 #endif |
|
151 |
|
152 #ifndef int16_T |
|
153 #define int16_T int16_t |
|
154 #endif |
|
155 |
|
156 #ifndef UINT8_T |
|
157 #define UINT8_T uint8_t |
|
158 #endif |
|
159 |
|
160 #ifndef uint8_T |
|
161 #define uint8_T uint8_t |
|
162 #endif |
|
163 |
|
164 #ifndef INT8_T |
|
165 #define INT8_T int8_t |
|
166 #endif |
|
167 |
|
168 #ifndef int8_T |
|
169 #define int8_T int8_t |
|
170 #endif |
|
171 |
5864
|
172 #if defined (__cplusplus) |
|
173 } |
|
174 #endif |
|
175 |
|
176 #endif |
|
177 |
|
178 /* |
|
179 ;;; Local Variables: *** |
|
180 ;;; mode: C *** |
|
181 ;;; End: *** |
|
182 */ |