Mercurial > octave
annotate libinterp/corefcn/mex.h @ 23449:c763214a8260
maint: Use convention 'int *x' for naming pointers.
* mycell.c, myfeval.c, mypow2.c, myprop.c, myset.c, mystruct.c, Backend.cc,
Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h,
ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc,
CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h,
EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc,
FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h,
ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h,
MenuContainer.h, MouseModeActionGroup.cc, MouseModeActionGroup.h, Object.cc,
Object.h, ObjectFactory.cc, ObjectFactory.h, ObjectProxy.cc, ObjectProxy.h,
Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h,
PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h,
QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc,
RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc,
TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc,
ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h,
ToolBarButton.cc, ToolBarButton.h, color-picker.cc, file-editor-tab.cc,
file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h,
octave-qscintilla.cc, main-window.cc, main-window.h, octave-cmd.cc,
octave-dock-widget.cc, parser.cc, shortcut-manager.cc, workspace-view.cc,
__ichol__.cc, __ilu__.cc, __magick_read__.cc, c-file-ptr-stream.cc,
c-file-ptr-stream.h, cellfun.cc, data.cc, gl2ps-print.cc, graphics.cc,
graphics.in.h, ls-hdf5.cc, ls-hdf5.h, ls-mat5.cc, mex.h, oct-map.cc, oct-map.h,
oct-stream.cc, octave-link.cc, profiler.cc, profiler.h, psi.cc, qz.cc,
sighandlers.cc, symtab.h, txt-eng.h, zfstream.cc, zfstream.h, __init_fltk__.cc,
audiodevinfo.cc, gzip.cc, ov-class.cc, ov-classdef.cc, ov-classdef.h,
ov-dld-fcn.h, ov-fcn-inline.cc, ov-java.cc, ov-java.h, ov.cc, pt-arg-list.cc,
pt-array-list.cc, pt-bp.cc, pt-check.cc, pt-classdef.h, pt-decl.cc, pt-eval.cc,
pt-idx.cc, pt-idx.h, pt-jit.cc, pt-misc.cc, pt-pr-code.cc, pt-select.cc,
pt-stmt.cc, Array.cc, Array.h, CMatrix.cc, MSparse.cc, Sparse.h, dMatrix.cc,
dim-vector.h, fCMatrix.cc, fMatrix.cc, CollocWt.cc, bsxfun-defs.cc,
eigs-base.cc, gsvd.cc, gsvd.h, lo-lapack-proto.h, oct-norm.cc, randmtzig.cc,
svd.cc, svd.h, mx-inlines.cc, oct-binmap.h, oct-sort.cc, oct-sort.h,
oct-string.cc, oct-string.h, sparse-sort.cc, sparse-sort.h:
Use convention 'int *x' for naming pointers.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 27 Apr 2017 15:18:20 -0700 |
parents | 092078913d54 |
children | 194eb4bd202b |
rev | line source |
---|---|
5864 | 1 /* |
2 | |
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
3 Copyright (C) 2001-2017 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 | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
8 under the terms of the GNU General Public License as published by |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
9 the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
10 (at your option) any later version. |
5864 | 11 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
12 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
|
13 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22465
diff
changeset
|
15 GNU General Public License for more details. |
5864 | 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 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21241
diff
changeset
|
51 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21241
diff
changeset
|
52 |
5864 | 53 #define HAVE_OCTAVE |
54 | |
55 typedef void mxArray; | |
5879 | 56 |
5864 | 57 /* -V4 stuff */ |
58 #if defined (V4) | |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
59 # define Matrix mxArray |
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
60 # define REAL mxREAL |
5864 | 61 #endif |
62 | |
63 #define mxMAXNAME 64 | |
64 | |
16705
122d3f62e179
do not include C++ header in extern "C" context (bug #38746)
Clemens Buchacher <drizzd@aon.at>
parents:
15195
diff
changeset
|
65 #include "mexproto.h" |
122d3f62e179
do not include C++ header in extern "C" context (bug #38746)
Clemens Buchacher <drizzd@aon.at>
parents:
15195
diff
changeset
|
66 |
5864 | 67 #if defined (__cplusplus) |
68 extern "C" { | |
69 #endif | |
70 | |
71 #if defined (V4) | |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
72 void mexFunction (int nlhs, mxArray *plhs[], int nrhs, mxArray *prhs[]); |
5864 | 73 #else |
23449
c763214a8260
maint: Use convention 'int *x' for naming pointers.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
74 void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]); |
5864 | 75 #endif |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
76 |
5864 | 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 | |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
84 |
5864 | 85 #define mexGetGlobal(nm) mexGetArray (nm, "global") |
86 #define mexGetMatrix(nm) mexGetArray (nm, "caller") | |
87 #define mexGetMatrixPtr(nm) mexGetArrayPtr (nm, "caller") | |
88 | |
5879 | 89 #define mexGetArray(nm, space) mexGetVariable (space, nm) |
90 #define mexGetArrayPtr(nm, space) mexGetVariablePtr (space, nm) | |
91 | |
5864 | 92 #define mexPutMatrix(ptr) mexPutVariable ("caller", "", ptr) |
93 #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
|
94 |
5864 | 95 #define mxCreateFull mxCreateDoubleMatrix |
96 | |
97 #define mxCreateScalarDouble mxCreateDoubleScalar | |
98 | |
99 #define mxFreeMatrix mxDestroyArray | |
100 | |
101 #define mxIsString mxIsChar | |
102 | |
6048 | 103 /* Apparently these are also defined. */ |
104 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
105 #if ! defined (UINT64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
106 # define UINT64_T uint64_t |
6048 | 107 #endif |
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 (INT64_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
114 # define INT64_T int64_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 (UINT32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
122 # define UINT32_T uint32_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 (INT32_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
130 # define INT32_T int32_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 (UINT16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
138 # define UINT16_T uint16_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 (INT16_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
146 # define INT16_T int16_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 (UINT8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
154 # define UINT8_T uint8_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 (INT8_T) |
21200
fcac5dbbf9ed
maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents:
20525
diff
changeset
|
162 # define INT8_T int8_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 | |
5864 | 169 #if defined (__cplusplus) |
170 } | |
171 #endif | |
172 | |
173 #endif |