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 |
|
27 the follwoing terms: |
|
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; |
|
55 typedef unsigned short mxChar; |
|
56 enum mxComplexity { mxREAL = 0, mxCOMPLEX = 1 }; |
|
57 |
|
58 #if ! defined (__cplusplus) |
|
59 typedef int bool; |
|
60 #endif |
|
61 |
|
62 typedef int mxLOGICAL; |
|
63 |
|
64 /* -V4 stuff */ |
|
65 #if defined (V4) |
|
66 #define Matrix mxArray |
|
67 #define REAL mxREAL |
|
68 #endif |
|
69 |
|
70 #define mxMAXNAME 64 |
|
71 |
|
72 #if defined (__cplusplus) |
|
73 extern "C" { |
|
74 #endif |
|
75 |
|
76 #if defined (V4) |
|
77 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray* prhs[]); |
|
78 #else |
|
79 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]); |
|
80 #endif |
|
81 |
|
82 #include "mexproto.h" |
|
83 |
|
84 /* V4 floating point routines renamed in V5. */ |
|
85 #define mexIsNaN mxIsNaN |
|
86 #define mexIsFinite mxIsFinite |
|
87 #define mexIsInf mxIsInf |
|
88 #define mexGetEps mxGetEps |
|
89 #define mexGetInf mxGetInf |
|
90 #define mexGetNaN mxGetNan |
|
91 |
|
92 #define mexGetGlobal(nm) mexGetArray (nm, "global") |
|
93 #define mexGetMatrix(nm) mexGetArray (nm, "caller") |
|
94 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller") |
|
95 |
|
96 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr) |
|
97 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr) |
|
98 |
|
99 #define mxCreateFull mxCreateDoubleMatrix |
|
100 |
|
101 #define mxCreateScalarDouble mxCreateDoubleScalar |
|
102 |
|
103 #define mxFreeMatrix mxDestroyArray |
|
104 |
|
105 #define mxIsString mxIsChar |
|
106 |
|
107 #if defined (__cplusplus) |
|
108 } |
|
109 #endif |
|
110 |
|
111 #endif |
|
112 |
|
113 /* |
|
114 ;;; Local Variables: *** |
|
115 ;;; mode: C *** |
|
116 ;;; End: *** |
|
117 */ |