GNU Octave  4.2.1
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-2017 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 (octave_mex_h)
49 #define octave_mex_h 1
50 
51 #include "octave-config.h"
52 
53 #define HAVE_OCTAVE
54 
55 typedef void mxArray;
56 
57 /* -V4 stuff */
58 #if defined (V4)
59 # define Matrix mxArray
60 # define REAL mxREAL
61 #endif
62 
63 #define mxMAXNAME 64
64 
65 #include "mexproto.h"
66 
67 #if defined (__cplusplus)
68 extern "C" {
69 #endif
70 
71 #if defined (V4)
72 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]);
73 #else
74 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, const mxArray *prhs[]);
75 #endif
76 
77 /* V4 floating point routines renamed in V5. */
78 #define mexIsNaN mxIsNaN
79 #define mexIsFinite mxIsFinite
80 #define mexIsInf mxIsInf
81 #define mexGetEps mxGetEps
82 #define mexGetInf mxGetInf
83 #define mexGetNaN mxGetNan
84 
85 #define mexGetGlobal(nm) mexGetArray (nm, "global")
86 #define mexGetMatrix(nm) mexGetArray (nm, "caller")
87 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller")
88 
89 #define mexGetArray(nm, space) mexGetVariable (space, nm)
90 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm)
91 
92 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr)
93 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr)
94 
95 #define mxCreateFull mxCreateDoubleMatrix
96 
97 #define mxCreateScalarDouble mxCreateDoubleScalar
98 
99 #define mxFreeMatrix mxDestroyArray
100 
101 #define mxIsString mxIsChar
102 
103 /* Apparently these are also defined. */
104 
105 #if ! defined (UINT64_T)
106 # define UINT64_T uint64_t
107 #endif
108 
109 #if ! defined (uint64_T)
110 # define uint64_T uint64_t
111 #endif
112 
113 #if ! defined (INT64_T)
114 # define INT64_T int64_t
115 #endif
116 
117 #if ! defined (int64_T)
118 # define int64_T int64_t
119 #endif
120 
121 #if ! defined (UINT32_T)
122 # define UINT32_T uint32_t
123 #endif
124 
125 #if ! defined (uint32_T)
126 # define uint32_T uint32_t
127 #endif
128 
129 #if ! defined (INT32_T)
130 # define INT32_T int32_t
131 #endif
132 
133 #if ! defined (int32_T)
134 # define int32_T int32_t
135 #endif
136 
137 #if ! defined (UINT16_T)
138 # define UINT16_T uint16_t
139 #endif
140 
141 #if ! defined (uint16_T)
142 # define uint16_T uint16_t
143 #endif
144 
145 #if ! defined (INT16_T)
146 # define INT16_T int16_t
147 #endif
148 
149 #if ! defined (int16_T)
150 # define int16_T int16_t
151 #endif
152 
153 #if ! defined (UINT8_T)
154 # define UINT8_T uint8_t
155 #endif
156 
157 #if ! defined (uint8_T)
158 # define uint8_T uint8_t
159 #endif
160 
161 #if ! defined (INT8_T)
162 # define INT8_T int8_t
163 #endif
164 
165 #if ! defined (int8_T)
166 # define int8_T int8_t
167 #endif
168 
169 #if defined (__cplusplus)
170 }
171 #endif
172 
173 #endif
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
void mxArray
Definition: mex.h:55