annotate libinterp/corefcn/mexproto.h @ 23037:0412dc701e28 stable

mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050) * mexproto.h (mxAssert, mxAssertS): add parenthesis to the macro parameter expr. This avoids errors due to the operator precedence of the negation. See bug was first observed at: https://github.com/sqlp/sedumi/issues/24.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Sat, 14 Jan 2017 00:00:32 +0100
parents 667d353d1ab8
children d8d0e600cbc4 3ac9f9ecfae5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
1 /*
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
2
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 22197
diff changeset
3 Copyright (C) 2006-2016 Paul Kienzle
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
4
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
6
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6787
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6787
diff changeset
10 option) any later version.
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
11
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
15 for more details.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
16
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6787
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6787
diff changeset
19 <http://www.gnu.org/licenses/>.
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
20
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
21 */
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
22
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
23 /*
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
24
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
25 This code was originally distributed as part of Octave Forge under
6064
fede829d805a [project @ 2006-10-19 01:47:08 by jwe]
jwe
parents: 5900
diff changeset
26 the following terms:
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
27
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
28 Author: Paul Kienzle
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
29 I grant this code to the public domain.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
30 2001-03-22
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
31
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
32 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
33 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
34 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
35 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
36 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
37 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
38 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
39 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
40 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
41 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
42 SUCH DAMAGE.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
43
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
44 */
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
45
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
46 /* mex.h is for use in C-programs only; do NOT include it in mex.cc */
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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_mexproto_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_mexproto_h 1
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
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
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
53 #if defined (__cplusplus)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
54 # include <cstdlib>
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
55 extern "C" {
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
56 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
57 # include <stdlib.h>
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
58 # include <stdbool.h>
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
59 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
60
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
61 /* The definition of OCTINTERP_API is normally provided by Octave's
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
62 config.h file. This is provided for the case of mex.h included by
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
63 user programs that don't use Octave's config.h. */
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
64 #if ! defined (OCTINTERP_API)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
65 # if defined (_MSC_VER)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
66 # define OCTINTERP_API __declspec(dllimport)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
67 # else
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
68 /* All other compilers, at least for now. */
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
69 # define OCTINTERP_API
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
70 # endif
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
71 #endif
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
72
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
73 #define MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
74 #include "mxarray.h"
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
75 #undef MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
76
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
77 /* Interface to the interpreter. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
78 extern OCTINTERP_API const char *mexFunctionName (void);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
79
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
80 extern OCTINTERP_API int mexCallMATLAB (int nargout, mxArray *argout[],
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
81 int nargin, mxArray *argin[],
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
82 const char *fname);
22451
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
83 extern OCTINTERP_API mxArray * mexCallMATLABWithTrap (int nargout,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
84 mxArray *argout[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
85 int nargin,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
86 mxArray *argin[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
87 const char *fname);
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
88
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
89 extern OCTINTERP_API int mexEvalString (const char *s);
22454
8445f67a8123 Add function mexEvalStringWithTrap to MEX API.
Rik <rik@octave.org>
parents: 22451
diff changeset
90 extern OCTINTERP_API mxArray * mexEvalStringWithTrap (const char *s);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
91
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
92 extern OCTINTERP_API void mexSetTrapFlag (int flag);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
93
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
94 extern OCTINTERP_API void mexErrMsgTxt (const char *s);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
95 extern OCTINTERP_API void mexErrMsgIdAndTxt (const char *id, const char *s,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
96 ...);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
97 extern OCTINTERP_API void mexWarnMsgTxt (const char *s);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
98 extern OCTINTERP_API void mexWarnMsgIdAndTxt (const char *id, const char *s,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
99 ...);
10127
f21fdff5c906 Change signature of mexPrintf.
David Grundberg <davidg@cs.umu.se>
parents: 10126
diff changeset
100 extern OCTINTERP_API int mexPrintf (const char *fmt, ...);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
101
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
102 extern OCTINTERP_API mxArray *mexGetVariable (const char *space,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
103 const char *name);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
104 extern OCTINTERP_API const mxArray *mexGetVariablePtr (const char *space,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
105 const char *name);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
106
15352
9a8dbd6b6b20 * mysparse.c (mexFunction): Declare pbr and pbr2 as mxLogical*, not bool*.
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
107 extern OCTINTERP_API int mexPutVariable (const char *space, const char *name,
9a8dbd6b6b20 * mysparse.c (mexFunction): Declare pbr and pbr2 as mxLogical*, not bool*.
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
108 const mxArray *ptr);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
109
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
110 extern OCTINTERP_API const mxArray *mexGet (double handle,
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
111 const char *property);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
112 extern OCTINTERP_API int mexSet (double handle, const char *property,
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
113 mxArray *val);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
114
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
115 extern OCTINTERP_API void mexMakeArrayPersistent (mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
116 extern OCTINTERP_API void mexMakeMemoryPersistent (void *ptr);
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
117
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
118 extern OCTINTERP_API void mexLock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
119 extern OCTINTERP_API void mexUnlock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
120
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
121 extern OCTINTERP_API int mexIsGlobal (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
122 extern OCTINTERP_API int mexIsLocked (void);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
123
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
124 extern OCTINTERP_API int mexAtExit (void (*f) (void));
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
125
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
126 /* Floating point predicates. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
127 extern OCTINTERP_API bool mxIsFinite (double v);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
128 extern OCTINTERP_API bool mxIsInf (double v);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
129 extern OCTINTERP_API bool mxIsNaN (double v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
130
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
131 /* Floating point values. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
132 extern OCTINTERP_API double mxGetEps (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
133 extern OCTINTERP_API double mxGetInf (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
134 extern OCTINTERP_API double mxGetNaN (void);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
135
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
136 /* Memory management. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
137 extern OCTINTERP_API void *mxCalloc (size_t n, size_t size);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
138 extern OCTINTERP_API void *mxMalloc (size_t n);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
139 extern OCTINTERP_API void *mxRealloc (void *ptr, size_t size);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
140 extern OCTINTERP_API void mxFree (void *ptr);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
141
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
142 /* Constructors. */
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
143 extern OCTINTERP_API mxArray *mxCreateCellArray (mwSize ndims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
144 const mwSize *dims);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
145 extern OCTINTERP_API mxArray *mxCreateCellMatrix (mwSize m, mwSize n);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
146 extern OCTINTERP_API mxArray *mxCreateCharArray (mwSize ndims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
147 const mwSize *dims);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
148 extern OCTINTERP_API mxArray *mxCreateCharMatrixFromStrings (mwSize m,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
149 const char **str);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 extern OCTINTERP_API mxArray *mxCreateDoubleMatrix (mwSize nr, mwSize nc,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
151 mxComplexity flag);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
152 extern OCTINTERP_API mxArray *mxCreateDoubleScalar (double val);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
153 extern OCTINTERP_API mxArray *mxCreateLogicalArray (mwSize ndims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
154 const mwSize *dims);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
155 extern OCTINTERP_API mxArray *mxCreateLogicalMatrix (mwSize m, mwSize n);
7879
a017ca5a2f75 mexproto.h: fix mxCreateLogicalScalar decl
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
156 extern OCTINTERP_API mxArray *mxCreateLogicalScalar (mxLogical val);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
157 extern OCTINTERP_API mxArray *mxCreateNumericArray (mwSize ndims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 const mwSize *dims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
159 mxClassID class_id,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
160 mxComplexity flag);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
161 extern OCTINTERP_API mxArray *mxCreateNumericMatrix (mwSize m, mwSize n,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
162 mxClassID class_id,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
163 mxComplexity flag);
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
164 extern OCTINTERP_API mxArray *mxCreateUninitNumericArray (mwSize ndims,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
165 const mwSize *dims,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
166 mxClassID class_id,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
167 mxComplexity flag);
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
168 extern OCTINTERP_API mxArray *mxCreateUninitNumericMatrix (mwSize m, mwSize n,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
169 mxClassID class_id,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
170 mxComplexity flag);
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
171
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
172 extern OCTINTERP_API mxArray *mxCreateSparse (mwSize m, mwSize n, mwSize nzmax,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
173 mxComplexity flag);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
174 extern OCTINTERP_API mxArray *mxCreateSparseLogicalMatrix (mwSize m, mwSize n,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
175 mwSize nzmax);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
176 extern OCTINTERP_API mxArray *mxCreateString (const char *str);
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
177 extern OCTINTERP_API mxArray *mxCreateStructArray (mwSize ndims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
178 const mwSize *dims,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
179 int num_keys,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
180 const char **keys);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
181 extern OCTINTERP_API mxArray *mxCreateStructMatrix (mwSize rows, mwSize cols,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
182 int num_keys,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
183 const char **keys);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
184
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
185 /* Copy constructor. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
186 extern OCTINTERP_API mxArray *mxDuplicateArray (const mxArray *v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
187
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
188 /* Destructor. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
189 extern OCTINTERP_API void mxDestroyArray (mxArray *v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
190
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
191 /* Type Predicates. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
192 extern OCTINTERP_API bool mxIsCell (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
193 extern OCTINTERP_API bool mxIsChar (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
194 extern OCTINTERP_API bool mxIsClass (const mxArray *ptr, const char *name);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
195 extern OCTINTERP_API bool mxIsComplex (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
196 extern OCTINTERP_API bool mxIsDouble (const mxArray *ptr);
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
197 /* Matlab seems to have deprecated IsFunctionHandle, but it seems useful */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
198 extern OCTINTERP_API bool mxIsFunctionHandle (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
199 extern OCTINTERP_API bool mxIsInt16 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
200 extern OCTINTERP_API bool mxIsInt32 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
201 extern OCTINTERP_API bool mxIsInt64 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
202 extern OCTINTERP_API bool mxIsInt8 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
203 extern OCTINTERP_API bool mxIsLogical (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
204 extern OCTINTERP_API bool mxIsNumeric (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
205 extern OCTINTERP_API bool mxIsSingle (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
206 extern OCTINTERP_API bool mxIsSparse (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
207 extern OCTINTERP_API bool mxIsStruct (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
208 extern OCTINTERP_API bool mxIsUint16 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
209 extern OCTINTERP_API bool mxIsUint32 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
210 extern OCTINTERP_API bool mxIsUint64 (const mxArray *ptr);
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
211 extern OCTINTERP_API bool mxIsUint8 (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
212
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
213 /* Odd type+size predicate. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
214 extern OCTINTERP_API bool mxIsLogicalScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
215
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
216 /* Odd type+size+value predicate. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
217 extern OCTINTERP_API bool mxIsLogicalScalarTrue (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
218
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
219 /* Size predicates. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
220 extern OCTINTERP_API bool mxIsEmpty (const mxArray *ptr);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
221 extern OCTINTERP_API bool mxIsScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
222
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
223 /* Just plain odd thing to ask of a value. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
224 extern OCTINTERP_API bool mxIsFromGlobalWS (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
225
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
226 /* Dimension extractors. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
227 extern OCTINTERP_API size_t mxGetM (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
228 extern OCTINTERP_API size_t mxGetN (const mxArray *ptr);
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
229 extern OCTINTERP_API const mwSize *mxGetDimensions (const mxArray *ptr);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
230 extern OCTINTERP_API mwSize mxGetNumberOfDimensions (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
231 extern OCTINTERP_API size_t mxGetNumberOfElements (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
232
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
233 /* Dimension setters. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
234 extern OCTINTERP_API void mxSetM (mxArray *ptr, mwSize M);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
235 extern OCTINTERP_API void mxSetN (mxArray *ptr, mwSize N);
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
236 extern OCTINTERP_API int mxSetDimensions (mxArray *ptr, const mwSize *dims,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
237 mwSize ndims);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
238
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
239 /* Data extractors. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
240 extern OCTINTERP_API double *mxGetPi (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
241 extern OCTINTERP_API double *mxGetPr (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
242 extern OCTINTERP_API double mxGetScalar (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
243 extern OCTINTERP_API mxChar *mxGetChars (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
244 extern OCTINTERP_API mxLogical *mxGetLogicals (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
245 extern OCTINTERP_API void *mxGetData (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
246 extern OCTINTERP_API void *mxGetImagData (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
247
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
248 /* Data setters. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
249 extern OCTINTERP_API void mxSetPr (mxArray *ptr, double *pr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
250 extern OCTINTERP_API void mxSetPi (mxArray *ptr, double *pi);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
251 extern OCTINTERP_API void mxSetData (mxArray *ptr, void *data);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
252 extern OCTINTERP_API void mxSetImagData (mxArray *ptr, void *pi);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
253
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
254 /* Classes. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
255 extern OCTINTERP_API mxClassID mxGetClassID (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
256 extern OCTINTERP_API const char *mxGetClassName (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
257
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
258 extern OCTINTERP_API void mxSetClassName (mxArray *ptr, const char *name);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
259
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
260 /* Cell support. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
261 extern OCTINTERP_API mxArray *mxGetCell (const mxArray *ptr, mwIndex idx);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
262
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
263 extern OCTINTERP_API void mxSetCell (mxArray *ptr, mwIndex idx, mxArray *val);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
264
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
265 /* Sparse support. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
266 extern OCTINTERP_API mwIndex *mxGetIr (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
267 extern OCTINTERP_API mwIndex *mxGetJc (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
268 extern OCTINTERP_API mwSize mxGetNzmax (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
269
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
270 extern OCTINTERP_API void mxSetIr (mxArray *ptr, mwIndex *ir);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
271 extern OCTINTERP_API void mxSetJc (mxArray *ptr, mwIndex *jc);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
272 extern OCTINTERP_API void mxSetNzmax (mxArray *ptr, mwSize nzmax);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
273
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
274 /* Structure support. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
275 extern OCTINTERP_API int mxAddField (mxArray *ptr, const char *key);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
276
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
277 extern OCTINTERP_API void mxRemoveField (mxArray *ptr, int key_num);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
278
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
279 extern OCTINTERP_API mxArray *mxGetField (const mxArray *ptr, mwIndex index,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
280 const char *key);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
281 extern OCTINTERP_API mxArray *mxGetFieldByNumber (const mxArray *ptr,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
282 mwIndex index, int key_num);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
283
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
284 extern OCTINTERP_API void mxSetField (mxArray *ptr, mwIndex index,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
285 const char *key, mxArray *val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
286 extern OCTINTERP_API void mxSetFieldByNumber (mxArray *ptr, mwIndex index,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
287 int key_num, mxArray *val);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
288
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
289 extern OCTINTERP_API int mxGetNumberOfFields (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
290
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
291 extern OCTINTERP_API const char *mxGetFieldNameByNumber (const mxArray *ptr,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
292 int key_num);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
293 extern OCTINTERP_API int mxGetFieldNumber (const mxArray *ptr, const char *key);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
294
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
295 extern OCTINTERP_API int mxGetString (const mxArray *ptr, char *buf,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
296 mwSize buflen);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
297 extern OCTINTERP_API char *mxArrayToString (const mxArray *ptr);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
298
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
299 /* Miscellaneous. */
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
300 extern OCTINTERP_API mwIndex mxCalcSingleSubscript (const mxArray *ptr,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
301 mwSize nsubs,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
302 mwIndex *subs);
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
303
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
304 extern OCTINTERP_API size_t mxGetElementSize (const mxArray *ptr);
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
305
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
306 #if defined (MEX_DEBUG)
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
307
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
308 # define mxAssert(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
309 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
310 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
311 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
312 { \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
313 if (msg != NULL && msg[0] != '\0') \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
314 mexErrMsgIdAndTxt ("Octave:MEX", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
315 "Assertion failed: %s, at line %d of file \"%s\".\n%s\n", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
316 #expr, __LINE__, __FILE__, msg); \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
317 else \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
318 mexErrMsgIdAndTxt ("Octave:MEX", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
319 "Assertion failed: %s, at line %d of file \"%s\".\n", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
320 #expr, __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
321 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
322 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
323 while (0)
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
324
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
325 # define mxAssertS(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
326 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
327 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
328 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
329 { \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
330 if (msg != NULL && msg[0] != '\0') \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
331 mexErrMsgIdAndTxt ("Octave:MEX", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
332 "Assertion failed at line %d of file \"%s\".\n%s\n", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
333 __LINE__, __FILE__, msg); \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
334 else \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
335 mexErrMsgIdAndTxt ("Octave:MEX", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
336 "Assertion failed at line %d of file \"%s\".\n", \
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
337 __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
338 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
339 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
340 while (0)
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
341
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
342 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
343 # define mxAssert(expr, msg)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
344 # define mxAssertS(expr, msg)
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
345 #endif
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
346
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
347 #if defined (__cplusplus)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
348 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
349 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
350
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
351 #endif