annotate libinterp/corefcn/mexproto.h @ 33624:e0c037a01fde default tip

redirect stdout and stderr into experimental terminal widget * command-widget.cc (command_widget): open temp files for redirecting stdout and stderr, setup a file system watcher for signals on changes to these files; (~command_widget): close and remove the temp. files; (insert_interpreter_output): use the style as second argument (print_stream): add new contents of temp. files for stdout and stderr to the end of the terminal contents; (notice_settings): set the terminal preferences to the new lexer of the console; (console): create and set new lexer; (new_command_line): use prompt style for the prompt; (execute_command): use second command line argument for the style; (append_string): use style as second argument and style the added text accordingly; * command-widget.h (console) append_string with second argument for style, (command_widget): now with destructor, new method print_stream, insert_interpreter_output with second argument for style, new class variables for temp. file descriptors and file system watcher * console-lexer.cc/h: new lexer derived from QScintillas default lexer for styling the terminal output, styles used so far: Default, Error, and Prompt * gui-preferences-cs.h: new constants for error and prompt colors * libgui/src/module.mk: new files console_lexer.cc/h * qt-interpreter-events.cc (display_exception): interpreter_output_signal with second argument for the style, here Error style * qt-interpreter-events.h: interpreter_output_signal with second argument for the style * terminal-dock-widget.h: interpreter_output_signal with second argument for the style
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 25 May 2024 14:36:01 +0200
parents 2e484f9f1f18
children
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 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31827
diff changeset
3 // Copyright (C) 2006-2024 The Octave Project Developers
27923
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>
29654
d13d090cb03a use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
58 using std::size_t;
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
59 extern "C" {
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
60 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
61 # 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
62 # include <stdbool.h>
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
63 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
64
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
65 #if ! defined (MX_HAS_INTERLEAVED_COMPLEX)
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
66 # define MX_HAS_INTERLEAVED_COMPLEX 0
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
67 #endif
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
68
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
69 #define MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
70 #include "mxarray.h"
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
71 #undef MXARRAY_TYPEDEFS_ONLY
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
72
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
73 /* Prototype for the gateway function. */
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
74
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
75 extern void mexFunction (int nlhs, mxArray *plhs[],
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
76 int nrhs, const mxArray *prhs[]);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
77
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
78 /* Interface to the interpreter. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
79 extern OCTINTERP_API const char * mexFunctionName (void);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
80
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
81 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
82 int nargin, mxArray *argin[],
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
83 const char *fname);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
84 extern OCTINTERP_API mxArray *mexCallMATLABWithTrap (int nargout,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
85 mxArray *argout[],
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
86 int nargin,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
87 mxArray *argin[],
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
88 const char *fname);
22451
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
89
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
90 extern OCTINTERP_API int mexEvalString (const char *s);
22454
8445f67a8123 Add function mexEvalStringWithTrap to MEX API.
Rik <rik@octave.org>
parents: 22451
diff changeset
91 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
92
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
93 extern OCTINTERP_API void mexSetTrapFlag (int flag);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
94
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
95 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
96 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
97 ...);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
98 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
99 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
100 ...);
10127
f21fdff5c906 Change signature of mexPrintf.
David Grundberg <davidg@cs.umu.se>
parents: 10126
diff changeset
101 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
102
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
103 extern OCTINTERP_API mxArray *mexGetVariable (const char *space,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
104 const char *name);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
105 extern OCTINTERP_API const mxArray *mexGetVariablePtr (const char *space,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
106 const char *name);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
107
15352
9a8dbd6b6b20 * mysparse.c (mexFunction): Declare pbr and pbr2 as mxLogical*, not bool*.
John W. Eaton <jwe@octave.org>
parents: 15195
diff changeset
108 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
109 const mxArray *ptr);
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
110
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
111 #if MX_HAS_INTERLEAVED_COMPLEX
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
112 # define mexGet mexGet_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
113 #endif
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
114 extern OCTINTERP_API const mxArray *mexGet (double handle,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
115 const char *property);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
116
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
117 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
118 mxArray *val);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
119
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
120 extern OCTINTERP_API void mexMakeArrayPersistent (mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
121 extern OCTINTERP_API void mexMakeMemoryPersistent (void *ptr);
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
122
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
123 extern OCTINTERP_API void mexLock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
124 extern OCTINTERP_API void mexUnlock (void);
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
125
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
126 extern OCTINTERP_API int mexIsGlobal (const mxArray *ptr);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
127 extern OCTINTERP_API int mexIsLocked (void);
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
128
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
129 extern OCTINTERP_API int mexAtExit (void (*f) (void));
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 predicates. */
22465
6149f6b34cbc Change all mxIs* functions in MEX API to return bool rather than int.
Rik <rik@octave.org>
parents: 22464
diff changeset
132 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
133 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
134 extern OCTINTERP_API bool mxIsNaN (double v);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
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 /* Floating point values. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
137 extern OCTINTERP_API double mxGetEps (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
138 extern OCTINTERP_API double mxGetInf (void);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
139 extern OCTINTERP_API double mxGetNaN (void);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
140
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
141 /* Memory management. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
142 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
143 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
144 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
145 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
146
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
147 /* Constructors. */
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
148 #if MX_HAS_INTERLEAVED_COMPLEX
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
149 # define mxCreateCellArray mxCreateCellArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
150 # define mxCreateCellMatrix mxCreateCellMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
151 # define mxCreateCharArray mxCreateCharArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
152 # define mxCreateCharMatrixFromStrings mxCreateCharMatrixFromStrings_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
153 # define mxCreateDoubleMatrix mxCreateDoubleMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
154 # define mxCreateDoubleScalar mxCreateDoubleScalar_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
155 # define mxCreateLogicalArray mxCreateLogicalArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
156 # define mxCreateLogicalMatrix mxCreateLogicalMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
157 # define mxCreateLogicalScalar mxCreateLogicalScalar_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
158 # define mxCreateNumericArray mxCreateNumericArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
159 # define mxCreateNumericMatrix mxCreateNumericMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
160 # define mxCreateUninitNumericArray mxCreateUninitNumericArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
161 # define mxCreateUninitNumericMatrix mxCreateUninitNumericMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
162 # define mxCreateSparse mxCreateSparse_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
163 # define mxCreateSparseLogicalMatrix mxCreateSparseLogicalMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
164 # define mxCreateString mxCreateString_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
165 # define mxCreateStructArray mxCreateStructArray_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
166 # define mxCreateStructMatrix mxCreateStructMatrix_interleaved
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
167 #endif
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
168
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
169 extern OCTINTERP_API mxArray *mxCreateCellArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
170 const mwSize *dims);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
171 extern OCTINTERP_API mxArray * mxCreateCellMatrix (mwSize m, mwSize n);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
172 extern OCTINTERP_API mxArray *mxCreateCharArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
173 const mwSize *dims);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
174 extern OCTINTERP_API mxArray *mxCreateCharMatrixFromStrings (mwSize m,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
175 const char **str);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
176 extern OCTINTERP_API mxArray *mxCreateDoubleMatrix (mwSize nr, mwSize nc,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
177 mxComplexity flag);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
178 extern OCTINTERP_API mxArray * mxCreateDoubleScalar (double val);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
179 extern OCTINTERP_API mxArray *mxCreateLogicalArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
180 const mwSize *dims);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
181 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
182 extern OCTINTERP_API mxArray * mxCreateLogicalScalar (mxLogical val);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
183 extern OCTINTERP_API mxArray *mxCreateNumericArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
184 const mwSize *dims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
185 mxClassID class_id,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
186 mxComplexity flag);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
187 extern OCTINTERP_API mxArray *mxCreateNumericMatrix (mwSize m, mwSize n,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
188 mxClassID class_id,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
189 mxComplexity flag);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
190 extern OCTINTERP_API mxArray *mxCreateUninitNumericArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
191 const mwSize *dims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
192 mxClassID class_id,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
193 mxComplexity flag);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
194 extern OCTINTERP_API mxArray *mxCreateUninitNumericMatrix (mwSize m, mwSize n,
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
195 mxClassID class_id,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
196 mxComplexity flag);
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
197
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
198 extern OCTINTERP_API mxArray *mxCreateSparse (mwSize m, mwSize n, mwSize nzmax,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
199 mxComplexity flag);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
200 extern OCTINTERP_API mxArray *mxCreateSparseLogicalMatrix (mwSize m, mwSize n,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
201 mwSize nzmax);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
202 extern OCTINTERP_API mxArray * mxCreateString (const char *str);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
203 extern OCTINTERP_API mxArray *mxCreateStructArray (mwSize ndims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
204 const mwSize *dims,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
205 int num_keys,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
206 const char **keys);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
207 extern OCTINTERP_API mxArray *mxCreateStructMatrix (mwSize rows, mwSize cols,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
208 int num_keys,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
209 const char **keys);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
210
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
211 /* Copy constructor. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
212 extern OCTINTERP_API mxArray * mxDuplicateArray (const mxArray *v);
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 /* Destructor. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
215 extern OCTINTERP_API void mxDestroyArray (mxArray *v);
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 /* 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
218 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
219 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
220 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
221 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
222 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
223 /* 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
224 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
225 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
226 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
227 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
228 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
229 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
230 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
231 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
232 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
233 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
234 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
235 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
236 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
237 extern OCTINTERP_API bool mxIsUint8 (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 /* 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
240 extern OCTINTERP_API bool mxIsLogicalScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
241
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
242 /* 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
243 extern OCTINTERP_API bool mxIsLogicalScalarTrue (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
244
22462
6cb7813e5b2f Add new mxIsScalar function for MEX API.
Rik <rik@octave.org>
parents: 22459
diff changeset
245 /* 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
246 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
247 extern OCTINTERP_API bool mxIsScalar (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
248
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
249 /* 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
250 extern OCTINTERP_API bool mxIsFromGlobalWS (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
251
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
252 /* Dimension extractors. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
253 extern OCTINTERP_API size_t mxGetM (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
254 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
255 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
256 extern OCTINTERP_API mwSize mxGetNumberOfDimensions (const mxArray *ptr);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
257 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
258
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
259 /* Dimension setters. */
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
260 extern OCTINTERP_API void mxSetM (mxArray *ptr, mwSize M);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
261 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
262 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
263 mwSize ndims);
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
264
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
265 #if MX_HAS_INTERLEAVED_COMPLEX
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
266 extern OCTINTERP_API int mxMakeArrayReal (mxArray *ptr);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
267 extern OCTINTERP_API int mxMakeArrayComplex (mxArray *ptr);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
268 #endif
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
269
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
270 /* Data extractors. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
271 extern OCTINTERP_API double * mxGetPr (const mxArray *ptr);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
272 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
273 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
274 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
275 extern OCTINTERP_API void * mxGetData (const mxArray *ptr);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
276 #if MX_HAS_INTERLEAVED_COMPLEX
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
277 extern OCTINTERP_API mxDouble * mxGetDoubles (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
278 extern OCTINTERP_API mxSingle * mxGetSingles (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
279 extern OCTINTERP_API mxInt8 * mxGetInt8s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
280 extern OCTINTERP_API mxInt16 * mxGetInt16s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
281 extern OCTINTERP_API mxInt32 * mxGetInt32s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
282 extern OCTINTERP_API mxInt64 * mxGetInt64s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
283 extern OCTINTERP_API mxUint8 * mxGetUint8s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
284 extern OCTINTERP_API mxUint16 * mxGetUint16s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
285 extern OCTINTERP_API mxUint32 * mxGetUint32s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
286 extern OCTINTERP_API mxUint64 * mxGetUint64s (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
287
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
288 extern OCTINTERP_API mxComplexDouble * mxGetComplexDoubles (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
289 extern OCTINTERP_API mxComplexSingle * mxGetComplexSingles (const mxArray *p);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
290 #else
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
291 extern OCTINTERP_API double * mxGetPi (const mxArray *ptr);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
292 extern OCTINTERP_API void * mxGetImagData (const mxArray *ptr);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
293 #endif
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
294
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
295 /* Data setters. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
296 extern OCTINTERP_API void mxSetPr (mxArray *ptr, double *pr);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
297 extern OCTINTERP_API void mxSetData (mxArray *ptr, void *data);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
298 #if MX_HAS_INTERLEAVED_COMPLEX
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
299 extern OCTINTERP_API int mxSetDoubles (mxArray *p, mxDouble *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
300 extern OCTINTERP_API int mxSetSingles (mxArray *p, mxSingle *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
301 extern OCTINTERP_API int mxSetInt8s (mxArray *p, mxInt8 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
302 extern OCTINTERP_API int mxSetInt16s (mxArray *p, mxInt16 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
303 extern OCTINTERP_API int mxSetInt32s (mxArray *p, mxInt32 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
304 extern OCTINTERP_API int mxSetInt64s (mxArray *p, mxInt64 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
305 extern OCTINTERP_API int mxSetUint8s (mxArray *p, mxUint8 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
306 extern OCTINTERP_API int mxSetUint16s (mxArray *p, mxUint16 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
307 extern OCTINTERP_API int mxSetUint32s (mxArray *p, mxUint32 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
308 extern OCTINTERP_API int mxSetUint64s (mxArray *p, mxUint64 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
309
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
310 extern OCTINTERP_API int mxSetComplexDoubles (mxArray *p, mxComplexDouble *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
311 extern OCTINTERP_API int mxSetComplexSingles (mxArray *p, mxComplexSingle *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
312 #else
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
313 extern OCTINTERP_API void mxSetPi (mxArray *ptr, double *pi);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
314 extern OCTINTERP_API void mxSetImagData (mxArray *ptr, void *pi);
28126
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
315 #endif
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
316
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
317 /* Classes. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
318 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
319 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
320 extern OCTINTERP_API void mxSetClassName (mxArray *ptr, const char *name);
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
321 extern OCTINTERP_API mxArray *mxGetProperty (const mxArray *ptr, mwIndex idx,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
322 const char *property_name);
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
323 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
324 const char *property_name,
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
325 const mxArray *property_value);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
326
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
327 /* Cell support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
328 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
329
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
330 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
331
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
332 /* Sparse support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
333 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
334 extern OCTINTERP_API mwIndex * mxGetJc (const mxArray *ptr);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
335 extern OCTINTERP_API mwSize mxGetNzmax (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
336
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
337 extern OCTINTERP_API void mxSetIr (mxArray *ptr, mwIndex *ir);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
338 extern OCTINTERP_API void mxSetJc (mxArray *ptr, mwIndex *jc);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
339 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
340
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
341 /* Structure support. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
342 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
343
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
344 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
345
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
346 extern OCTINTERP_API mxArray *mxGetField (const mxArray *ptr, mwIndex index,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
347 const char *key);
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
348 extern OCTINTERP_API mxArray *mxGetFieldByNumber (const mxArray *ptr,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
349 mwIndex index, int key_num);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
350
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
351 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
352 const char *key, mxArray *val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
353 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
354 int key_num, mxArray *val);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
355
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
356 extern OCTINTERP_API int mxGetNumberOfFields (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
357
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
358 extern OCTINTERP_API const char *mxGetFieldNameByNumber (const mxArray *ptr,
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
359 int key_num);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
360 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
361
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
362 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
363 mwSize buflen);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
364 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
365
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
366 /* Miscellaneous. */
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
367 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
368 mwSize nsubs,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
369 mwIndex *subs);
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
370
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
371 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
372
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
373 #if defined (MEX_DEBUG)
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
374
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
375 # define mxAssert(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
376 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
377 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
378 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
379 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
380 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
381 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
382 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
383 "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
384 #expr, __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
385 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
386 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
387 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
388 "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
389 #expr, __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
390 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
391 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
392 while (0)
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
393
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
394 # define mxAssertS(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
395 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
396 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
397 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
398 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
399 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
400 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
401 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
402 "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
403 __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
404 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
405 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
406 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
407 "Assertion failed at line %d of file \"%s\".\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
408 __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
409 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
410 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
411 while (0)
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
412
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
413 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
414 # define mxAssert(expr, msg)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
415 # define mxAssertS(expr, msg)
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
416 #endif
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
417
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
418 #if defined (__cplusplus)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
419 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
420 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
421
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
422 #endif