GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
mex.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2001-2013 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 3 of the License, or (at your
10 option) any 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, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 /*
24 
25 This code was originally distributed as part of Octave Forge under
26 the following terms:
27 
28 Author: Paul Kienzle
29 I grant this code to the public domain.
30 2001-03-22
31 
32 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
33 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
36 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 SUCH DAMAGE.
43 
44 */
45 
46 /* mex.h is for use in C-programs only; do NOT include it in mex.cc */
47 
48 #if ! defined (MEX_H)
49 #define MEX_H
50 
51 #define HAVE_OCTAVE
52 
53 typedef void mxArray;
54 
55 #if ! defined (__cplusplus)
56 typedef int bool;
57 #endif
58 
59 /* -V4 stuff */
60 #if defined (V4)
61 #define Matrix mxArray
62 #define REAL mxREAL
63 #endif
64 
65 #define mxMAXNAME 64
66 
67 #include "mexproto.h"
68 
69 #if defined (__cplusplus)
70 extern "C" {
71 #endif
72 
73 #if defined (V4)
74 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]);
75 #else
76 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
77 #endif
78 
79 /* V4 floating point routines renamed in V5. */
80 #define mexIsNaN mxIsNaN
81 #define mexIsFinite mxIsFinite
82 #define mexIsInf mxIsInf
83 #define mexGetEps mxGetEps
84 #define mexGetInf mxGetInf
85 #define mexGetNaN mxGetNan
86 
87 #define mexGetGlobal(nm) mexGetArray (nm, "global")
88 #define mexGetMatrix(nm) mexGetArray (nm, "caller")
89 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller")
90 
91 #define mexGetArray(nm, space) mexGetVariable (space, nm)
92 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm)
93 
94 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr)
95 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr)
96 
97 #define mxCreateFull mxCreateDoubleMatrix
98 
99 #define mxCreateScalarDouble mxCreateDoubleScalar
100 
101 #define mxFreeMatrix mxDestroyArray
102 
103 #define mxIsString mxIsChar
104 
105 /* Apparently these are also defined. */
106 
107 #ifndef UINT64_T
108 #define UINT64_T uint64_t
109 #endif
110 
111 #ifndef uint64_T
112 #define uint64_T uint64_t
113 #endif
114 
115 #ifndef INT64_T
116 #define INT64_T int64_t
117 #endif
118 
119 #ifndef int64_T
120 #define int64_T int64_t
121 #endif
122 
123 #ifndef UINT32_T
124 #define UINT32_T uint32_t
125 #endif
126 
127 #ifndef uint32_T
128 #define uint32_T uint32_t
129 #endif
130 
131 #ifndef INT32_T
132 #define INT32_T int32_t
133 #endif
134 
135 #ifndef int32_T
136 #define int32_T int32_t
137 #endif
138 
139 #ifndef UINT16_T
140 #define UINT16_T uint16_t
141 #endif
142 
143 #ifndef uint16_T
144 #define uint16_T uint16_t
145 #endif
146 
147 #ifndef INT16_T
148 #define INT16_T int16_t
149 #endif
150 
151 #ifndef int16_T
152 #define int16_T int16_t
153 #endif
154 
155 #ifndef UINT8_T
156 #define UINT8_T uint8_t
157 #endif
158 
159 #ifndef uint8_T
160 #define uint8_T uint8_t
161 #endif
162 
163 #ifndef INT8_T
164 #define INT8_T int8_t
165 #endif
166 
167 #ifndef int8_T
168 #define int8_T int8_t
169 #endif
170 
171 #if defined (__cplusplus)
172 }
173 #endif
174 
175 #endif