annotate libinterp/corefcn/mexproto.h @ 27923:bd51beb6205e

update formatting of copyright notices * Use <https://octave.org/copyright/> instead of <https://octave.org/COPYRIGHT.html/>. * For consistency with other comments in the Octave sources, use C++-style comments for copyright blocks in C and C++ files. * Use delimiters above and below copyright blocks that are appropriate for the language used in the file. * Eliminate extra spacing inside copyright blocks. * lex.ll (looks_like_copyright): Also allow newlines and carriage returns before the word "Copyright". * scripts/mk-doc.pl (gethelp): Also skip empty comment lines. * bp-table.cc, type.m: Adjust tests.
author John W. Eaton <jwe@octave.org>
date Wed, 08 Jan 2020 11:59:41 -0500
parents 1891570abac8
children 4c21f99b4ad5 0a5b15007766
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 // Copyright (C) 2006-2020 The Octave Project Developers
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
25
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
26 /*
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 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
29 the following terms:
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
30
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
31 Author: Paul Kienzle
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
32 I grant this code to the public domain.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
33 2001-03-22
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
34
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
35 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
36 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
37 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
38 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
39 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
40 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
41 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
42 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
43 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
44 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
45 SUCH DAMAGE.
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
46
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
47 */
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
48
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
49 /* 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
50
21241
bae38398f5f1 use consistent style for all liboctave and libinterp include guards
John W. Eaton <jwe@octave.org>
parents: 21200
diff changeset
51 #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
52 #define octave_mexproto_h 1
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
53
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21241
diff changeset
54 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21241
diff changeset
55
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
56 #if defined (__cplusplus)
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
57 # include <cstdlib>
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
58 extern "C" {
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
59 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
60 # 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
61 # include <stdbool.h>
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
62 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
63
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
64 #define MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
65 #include "mxarray.h"
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
66 #undef MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
67
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
68 /* Interface to the interpreter. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
69 extern OCTINTERP_API const char * mexFunctionName (void);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
70
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
71 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
72 int nargin, mxArray *argin[],
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
73 const char *fname);
22451
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
74 extern OCTINTERP_API mxArray * mexCallMATLABWithTrap (int nargout,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
75 mxArray *argout[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
76 int nargin,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
77 mxArray *argin[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
78 const char *fname);
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
79
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
80 extern OCTINTERP_API int mexEvalString (const char *s);
22454
8445f67a8123 Add function mexEvalStringWithTrap to MEX API.
Rik <rik@octave.org>
parents: 22451
diff changeset
81 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
82
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
83 extern OCTINTERP_API void mexSetTrapFlag (int flag);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
84
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
85 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
86 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
87 ...);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
88 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
89 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
90 ...);
10127
f21fdff5c906 Change signature of mexPrintf.
David Grundberg <davidg@cs.umu.se>
parents: 10126
diff changeset
91 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
92
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
93 extern OCTINTERP_API mxArray * mexGetVariable (const char *space,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
94 const char *name);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
95 extern OCTINTERP_API const mxArray * mexGetVariablePtr (const char *space,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
96 const char *name);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
97
15352
9a8dbd6b6b20 * mysparse.c (mexFunction): Declare pbr and pbr2 as mxLogical*, not bool*.
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
98 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
99 const mxArray *ptr);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
100
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
101 extern OCTINTERP_API const mxArray * mexGet (double handle,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
102 const char *property);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
103 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
104 mxArray *val);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
105
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
106 extern OCTINTERP_API void mexMakeArrayPersistent (mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
107 extern OCTINTERP_API void mexMakeMemoryPersistent (void *ptr);
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
108
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
109 extern OCTINTERP_API void mexLock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
110 extern OCTINTERP_API void mexUnlock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
111
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
112 extern OCTINTERP_API int mexIsGlobal (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
113 extern OCTINTERP_API int mexIsLocked (void);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
114
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
115 extern OCTINTERP_API int mexAtExit (void (*f) (void));
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
116
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
117 /* 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
118 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
119 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
120 extern OCTINTERP_API bool mxIsNaN (double v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
121
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
122 /* Floating point values. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
123 extern OCTINTERP_API double mxGetEps (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
124 extern OCTINTERP_API double mxGetInf (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
125 extern OCTINTERP_API double mxGetNaN (void);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
126
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
127 /* Memory management. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
128 extern OCTINTERP_API void * mxCalloc (size_t n, size_t size);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
129 extern OCTINTERP_API void * mxMalloc (size_t n);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
130 extern OCTINTERP_API void * mxRealloc (void *ptr, size_t size);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
131 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
132
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
133 /* Constructors. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
134 extern OCTINTERP_API mxArray * mxCreateCellArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
135 const mwSize *dims);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
136 extern OCTINTERP_API mxArray * mxCreateCellMatrix (mwSize m, mwSize n);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
137 extern OCTINTERP_API mxArray * mxCreateCharArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
138 const mwSize *dims);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
139 extern OCTINTERP_API mxArray * mxCreateCharMatrixFromStrings (mwSize m,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
140 const char **str);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
141 extern OCTINTERP_API mxArray * mxCreateDoubleMatrix (mwSize nr, mwSize nc,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
142 mxComplexity flag);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
143 extern OCTINTERP_API mxArray * mxCreateDoubleScalar (double val);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
144 extern OCTINTERP_API mxArray * mxCreateLogicalArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
145 const mwSize *dims);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
146 extern OCTINTERP_API mxArray * mxCreateLogicalMatrix (mwSize m, mwSize n);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
147 extern OCTINTERP_API mxArray * mxCreateLogicalScalar (mxLogical val);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
148 extern OCTINTERP_API mxArray * mxCreateNumericArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
149 const mwSize *dims,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 mxClassID class_id,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
151 mxComplexity flag);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
152 extern OCTINTERP_API mxArray * mxCreateNumericMatrix (mwSize m, mwSize n,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
153 mxClassID class_id,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
154 mxComplexity flag);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
155 extern OCTINTERP_API mxArray * mxCreateUninitNumericArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
156 const mwSize *dims,
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
157 mxClassID class_id,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
158 mxComplexity flag);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
159 extern OCTINTERP_API mxArray * mxCreateUninitNumericMatrix (mwSize m, mwSize n,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
160 mxClassID class_id,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
161 mxComplexity flag);
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
162
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
163 extern OCTINTERP_API mxArray * mxCreateSparse (mwSize m, mwSize n, mwSize nzmax,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
164 mxComplexity flag);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
165 extern OCTINTERP_API mxArray * mxCreateSparseLogicalMatrix (mwSize m, mwSize n,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
166 mwSize nzmax);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
167 extern OCTINTERP_API mxArray * mxCreateString (const char *str);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
168 extern OCTINTERP_API mxArray * mxCreateStructArray (mwSize ndims,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
169 const mwSize *dims,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
170 int num_keys,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
171 const char **keys);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
172 extern OCTINTERP_API mxArray * mxCreateStructMatrix (mwSize rows, mwSize cols,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
173 int num_keys,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
174 const char **keys);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
175
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
176 /* Copy constructor. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
177 extern OCTINTERP_API mxArray * mxDuplicateArray (const mxArray *v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
178
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
179 /* Destructor. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
180 extern OCTINTERP_API void mxDestroyArray (mxArray *v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
181
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
182 /* 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
183 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
184 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
185 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
186 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
187 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
188 /* 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
189 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
190 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
191 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
192 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
193 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
194 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
195 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
196 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
197 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
198 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
199 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
200 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
201 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
202 extern OCTINTERP_API bool mxIsUint8 (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
203
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
204 /* 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
205 extern OCTINTERP_API bool mxIsLogicalScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
206
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
207 /* 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
208 extern OCTINTERP_API bool mxIsLogicalScalarTrue (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
209
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
210 /* 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
211 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
212 extern OCTINTERP_API bool mxIsScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
213
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
214 /* 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
215 extern OCTINTERP_API bool mxIsFromGlobalWS (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
216
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
217 /* Dimension extractors. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
218 extern OCTINTERP_API size_t mxGetM (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
219 extern OCTINTERP_API size_t mxGetN (const mxArray *ptr);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
220 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
221 extern OCTINTERP_API mwSize mxGetNumberOfDimensions (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
222 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
223
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
224 /* Dimension setters. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
225 extern OCTINTERP_API void mxSetM (mxArray *ptr, mwSize M);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
226 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
227 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
228 mwSize ndims);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
229
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
230 /* Data extractors. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
231 extern OCTINTERP_API double * mxGetPi (const mxArray *ptr);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
232 extern OCTINTERP_API double * mxGetPr (const mxArray *ptr);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
233 extern OCTINTERP_API double mxGetScalar (const mxArray *ptr);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
234 extern OCTINTERP_API mxChar * mxGetChars (const mxArray *ptr);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
235 extern OCTINTERP_API mxLogical * mxGetLogicals (const mxArray *ptr);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
236 extern OCTINTERP_API void * mxGetData (const mxArray *ptr);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
237 extern OCTINTERP_API void * mxGetImagData (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
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 setters. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
240 extern OCTINTERP_API void mxSetPr (mxArray *ptr, double *pr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
241 extern OCTINTERP_API void mxSetPi (mxArray *ptr, double *pi);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
242 extern OCTINTERP_API void mxSetData (mxArray *ptr, void *data);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
243 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
244
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
245 /* Classes. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
246 extern OCTINTERP_API mxClassID mxGetClassID (const mxArray *ptr);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
247 extern OCTINTERP_API const char * mxGetClassName (const mxArray *ptr);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
248 extern OCTINTERP_API void mxSetClassName (mxArray *ptr, const char *name);
23891
142a9c7e403a Avoid CamelCase in variables names in mxGetProperty cset (bd9e719f04cc).
Rik <rik@octave.org>
parents: 23884
diff changeset
249 extern OCTINTERP_API mxArray * mxGetProperty (const mxArray *ptr, mwIndex idx,
142a9c7e403a Avoid CamelCase in variables names in mxGetProperty cset (bd9e719f04cc).
Rik <rik@octave.org>
parents: 23884
diff changeset
250 const char *property_name);
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
251 extern OCTINTERP_API void mxSetProperty (mxArray *ptr, mwIndex idx,
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
252 const char *property_name,
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
253 const mxArray *property_value);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
254
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
255 /* Cell support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
256 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
257
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
258 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
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 /* Sparse support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
261 extern OCTINTERP_API mwIndex * mxGetIr (const mxArray *ptr);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
262 extern OCTINTERP_API mwIndex * mxGetJc (const mxArray *ptr);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
263 extern OCTINTERP_API mwSize mxGetNzmax (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
264
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
265 extern OCTINTERP_API void mxSetIr (mxArray *ptr, mwIndex *ir);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
266 extern OCTINTERP_API void mxSetJc (mxArray *ptr, mwIndex *jc);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
267 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
268
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
269 /* Structure support. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
270 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
271
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
272 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
273
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
274 extern OCTINTERP_API mxArray * mxGetField (const mxArray *ptr, mwIndex index,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
275 const char *key);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
276 extern OCTINTERP_API mxArray * mxGetFieldByNumber (const mxArray *ptr,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
277 mwIndex index, 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 void mxSetField (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, mxArray *val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
281 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
282 int key_num, mxArray *val);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
283
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
284 extern OCTINTERP_API int mxGetNumberOfFields (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
285
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
286 extern OCTINTERP_API const char * mxGetFieldNameByNumber (const mxArray *ptr,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
287 int key_num);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
288 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
289
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
290 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
291 mwSize buflen);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
292 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
293
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
294 /* Miscellaneous. */
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
295 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
296 mwSize nsubs,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
297 mwIndex *subs);
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
298
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
299 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
300
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
301 #if defined (MEX_DEBUG)
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
302
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
303 # define mxAssert(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
304 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
305 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
306 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
307 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
308 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
309 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
310 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
311 "Assertion failed: %s, at line %d of file \"%s\".\n%s\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
312 #expr, __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
313 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
314 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
315 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
316 "Assertion failed: %s, at line %d of file \"%s\".\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
317 #expr, __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
318 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
319 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
320 while (0)
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
321
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
322 # define mxAssertS(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
323 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
324 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
325 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
326 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
327 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
328 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
329 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
330 "Assertion failed at line %d of file \"%s\".\n%s\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
331 __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
332 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
333 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
334 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
335 "Assertion failed at line %d of file \"%s\".\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
336 __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
337 } \
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 while (0)
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
340
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
341 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
342 # define mxAssert(expr, msg)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
343 # define mxAssertS(expr, msg)
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
344 #endif
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
345
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
346 #if defined (__cplusplus)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
347 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
348 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
349
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
350 #endif