Mercurial > octave
annotate libinterp/corefcn/mex.h @ 27919:1891570abac8
update Octave Project Developers copyright for the new year
In files that have the "Octave Project Developers" copyright notice,
update for 2020.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 06 Jan 2020 22:29:51 -0500 |
parents | b442ec6dda5c |
children | bd51beb6205e |
rev | line source |
---|---|
5864 | 1 /* |
2 | |
27919
1891570abac8
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27918
diff
changeset
|
3 Copyright (C) 2001-2020 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
5 See the file COPYRIGHT.md in the top-level directory of this distribution |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
6 or <https://octave.org/COPYRIGHT.html/>. |
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
7 |
5864 | 8 |
9 This file is part of Octave. | |
10 | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
11 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
12 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
13 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
14 (at your option) any later version. |
5864 | 15 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
16 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
17 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
19 GNU General Public License for more details. |
5864 | 20 |
21 You should have received a copy of the GNU General Public License | |
7016 | 22 along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23449
diff
changeset
|
23 <https://www.gnu.org/licenses/>. |
5864 | 24 |
25 */ | |
26 | |
27 /* | |
28 | |
29 This code was originally distributed as part of Octave Forge under | |
5900 | 30 the following terms: |
5864 | 31 |
32 Author: Paul Kienzle | |
33 I grant this code to the public domain. | |
34 2001-03-22 | |
35 | |
36 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | |
37 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
38 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
39 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | |
40 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
41 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
42 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
43 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
44 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
45 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
46 SUCH DAMAGE. | |
47 | |
48 */ | |
49 | |
50 /* mex.h is for use in C-programs only; do NOT include it in mex.cc */ | |
51 | |
21241
bae38398f5f1
use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
52 #if ! defined (octave_mex_h) |
bae38398f5f1
use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
53 #define octave_mex_h 1 |
5864 | 54 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21241
diff
changeset
|
55 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21241
diff
changeset
|
56 |
5864 | 57 #define HAVE_OCTAVE |
58 | |
59 typedef void mxArray; | |
5879 | 60 |
5864 | 61 /* -V4 stuff */ |
62 #if defined (V4) | |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
63 # define Matrix mxArray |
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
64 # define REAL mxREAL |
5864 | 65 #endif |
66 | |
67 #define mxMAXNAME 64 | |
68 | |
16705
122d3f62e179
do not include C++ header in extern "C" context (bug #38746)
Clemens Buchacher <drizzd@aon.at>
parents:
15195
diff
changeset
|
69 #include "mexproto.h" |
122d3f62e179
do not include C++ header in extern "C" context (bug #38746)
Clemens Buchacher <drizzd@aon.at>
parents:
15195
diff
changeset
|
70 |
5864 | 71 #if defined (__cplusplus) |
72 extern "C" { | |
73 #endif | |
74 | |
75 #if defined (V4) | |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
76 void mexFunction (int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]); |
5864 | 77 #else |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
78 void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]); |
5864 | 79 #endif |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
80 |
5864 | 81 /* V4 floating point routines renamed in V5. */ |
82 #define mexIsNaN mxIsNaN | |
83 #define mexIsFinite mxIsFinite | |
84 #define mexIsInf mxIsInf | |
85 #define mexGetEps mxGetEps | |
86 #define mexGetInf mxGetInf | |
87 #define mexGetNaN mxGetNan | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
88 |
5864 | 89 #define mexGetGlobal(nm) mexGetArray (nm, "global") |
90 #define mexGetMatrix(nm) mexGetArray (nm, "caller") | |
91 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller") | |
92 | |
5879 | 93 #define mexGetArray(nm, space) mexGetVariable (space, nm) |
94 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm) | |
95 | |
5864 | 96 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr) |
97 #define mexPutArray(ptr, space) mexPutVariable (space, "", ptr) | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
98 |
5864 | 99 #define mxCreateFull mxCreateDoubleMatrix |
100 | |
101 #define mxCreateScalarDouble mxCreateDoubleScalar | |
102 | |
103 #define mxFreeMatrix mxDestroyArray | |
104 | |
105 #define mxIsString mxIsChar | |
106 | |
6048 | 107 /* Apparently these are also defined. */ |
108 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
109 #if ! defined (UINT64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
110 # define UINT64_T uint64_t |
6048 | 111 #endif |
112 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
113 #if ! defined (uint64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
114 # define uint64_T uint64_t |
6048 | 115 #endif |
116 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
117 #if ! defined (INT64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
118 # define INT64_T int64_t |
6048 | 119 #endif |
120 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
121 #if ! defined (int64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
122 # define int64_T int64_t |
6048 | 123 #endif |
124 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
125 #if ! defined (UINT32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
126 # define UINT32_T uint32_t |
6048 | 127 #endif |
128 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
129 #if ! defined (uint32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
130 # define uint32_T uint32_t |
6048 | 131 #endif |
132 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
133 #if ! defined (INT32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
134 # define INT32_T int32_t |
6048 | 135 #endif |
136 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
137 #if ! defined (int32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
138 # define int32_T int32_t |
6048 | 139 #endif |
140 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
141 #if ! defined (UINT16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
142 # define UINT16_T uint16_t |
6048 | 143 #endif |
144 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
145 #if ! defined (uint16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
146 # define uint16_T uint16_t |
6048 | 147 #endif |
148 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
149 #if ! defined (INT16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
150 # define INT16_T int16_t |
6048 | 151 #endif |
152 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
153 #if ! defined (int16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
154 # define int16_T int16_t |
6048 | 155 #endif |
156 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
157 #if ! defined (UINT8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
158 # define UINT8_T uint8_t |
6048 | 159 #endif |
160 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
161 #if ! defined (uint8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
162 # define uint8_T uint8_t |
6048 | 163 #endif |
164 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
165 #if ! defined (INT8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
166 # define INT8_T int8_t |
6048 | 167 #endif |
168 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
169 #if ! defined (int8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
170 # define int8_T int8_t |
6048 | 171 #endif |
172 | |
5864 | 173 #if defined (__cplusplus) |
174 } | |
175 #endif | |
176 | |
177 #endif |