Mercurial > octave
annotate libinterp/corefcn/mex.h @ 21241:bae38398f5f1
use consistent style for all liboctave and libinterp include guards
* mex.h, mexproto.h, mxarray.in.h, oct-obj.h, octave-default-image.h:
Use include guard style that is consistent with other files in Octave.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 10 Feb 2016 12:21:36 -0500 |
parents | fcac5dbbf9ed |
children | 1473547f50f5 |
rev | line source |
---|---|
5864 | 1 /* |
2 | |
19697
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
3 Copyright (C) 2001-2015 Paul Kienzle |
5864 | 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 | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
5864 | 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 | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
5864 | 20 |
21 */ | |
22 | |
23 /* | |
24 | |
25 This code was originally distributed as part of Octave Forge under | |
5900 | 26 the following terms: |
5864 | 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 | |
21241
bae38398f5f1
use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents:
21200
diff
changeset
|
48 #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
|
49 #define octave_mex_h 1 |
5864 | 50 |
51 #define HAVE_OCTAVE | |
52 | |
53 typedef void mxArray; | |
5879 | 54 |
20482
54eec9c180cb
* mex.h: Don't typdef bool if it is already defined.
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
55 #if ! defined (__cplusplus) && ! defined (bool) |
5864 | 56 typedef int bool; |
57 #endif | |
58 | |
59 /* -V4 stuff */ | |
60 #if defined (V4) | |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
61 # define Matrix mxArray |
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
62 # define REAL mxREAL |
5864 | 63 #endif |
64 | |
65 #define mxMAXNAME 64 | |
66 | |
20523
bbe6a846d8ac
Include stdint.h in mex.h file (Bug #46062)
John Donoghue <john.donoghue@ieee.org>
parents:
19697
diff
changeset
|
67 #include <stdint.h> |
bbe6a846d8ac
Include stdint.h in mex.h file (Bug #46062)
John Donoghue <john.donoghue@ieee.org>
parents:
19697
diff
changeset
|
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) | |
5879 | 76 void mexFunction (int nlhs, mxArray* plhs[], int nrhs, mxArray *prhs[]); |
5864 | 77 #else |
5879 | 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 | |
109 #ifndef 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 | |
113 #ifndef 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 | |
117 #ifndef 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 | |
121 #ifndef 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 | |
125 #ifndef 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 | |
129 #ifndef 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 | |
133 #ifndef 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 | |
137 #ifndef 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 | |
141 #ifndef 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 | |
145 #ifndef 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 | |
149 #ifndef 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 | |
153 #ifndef 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 | |
157 #ifndef 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 | |
161 #ifndef 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 | |
165 #ifndef 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 | |
169 #ifndef 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 |