annotate libinterp/corefcn/mexproto.h @ 29572:aef11bb4e6d1

use std::size_t and std::ptrdiff_t in C++ code (bug #60471) Files affected: make_int.cc, file-editor-tab.cc, octave-qscintilla.cc, Cell.cc, Cell.h, call-stack.cc, call-stack.h, cellfun.cc, data.cc, debug.cc, dlmread.cc, error.cc, event-queue.h, fcn-info.cc, fcn-info.h, file-io.cc, ft-text-renderer.cc, gl2ps-print.cc, graphics.cc, graphics.in.h, help.cc, hex2num.cc, input.cc, latex-text-renderer.cc, load-path.cc, load-save.cc, load-save.h, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat5.cc, ls-oct-text.cc, mex.cc, mexproto.h, mxarray.h, oct-map.cc, oct-stream.cc, oct-stream.h, pager.cc, pager.h, pr-output.cc, regexp.cc, settings.h, stack-frame.cc, stack-frame.h, strfns.cc, syminfo.cc, symrec.h, symscope.cc, symscope.h, symtab.cc, sysdep.cc, toplev.cc, utils.cc, utils.h, variables.cc, __fltk_uigetfile__.cc, __init_fltk__.cc, audioread.cc, gzip.cc, cdef-class.cc, cdef-manager.cc, cdef-method.cc, cdef-object.cc, cdef-object.h, ov-base-diag.cc, ov-base-diag.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc, ov-base-scalar.h, ov-base-sparse.h, ov-base.cc, ov-base.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc, ov-class.cc, ov-class.h, ov-classdef.cc, ov-fcn-handle.cc, ov-java.cc, ov-lazy-idx.h, ov-perm.cc, ov-perm.h, ov-range.h, ov-str-mat.cc, ov-struct.cc, ov-struct.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc, ov.h, ovl.cc, octave.cc, bp-table.cc, jit-ir.cc, jit-ir.h, jit-typeinfo.cc, jit-typeinfo.h, jit-util.h, lex.h, lex.ll, oct-lvalue.cc, oct-parse.yy, parse.h, profiler.h, pt-eval.cc, pt-eval.h, pt-jit.cc, pt-jit.h, pt-pr-code.cc, pt-tm-const.cc, pt-tm-const.h, Array.h, CMatrix.cc, DiagArray2.h, PermMatrix.h, Sparse.h, dMatrix.cc, fCMatrix.cc, fMatrix.cc, bsxfun-defs.cc, oct-fftw.cc, oct-fftw.h, randpoisson.cc, sparse-chol.cc, mx-inlines.cc, file-ops.cc, lo-sysdep.cc, oct-env.cc, oct-time.cc, action-container.cc, action-container.h, base-list.h, caseless-str.h, cmd-edit.cc, cmd-hist.cc, data-conv.cc, data-conv.h, f77-fcn.h, file-info.cc, file-info.h, kpse.cc, kpse.h, lo-cutils.h, lo-hash.h, lo-regexp.cc, oct-base64.cc, oct-base64.h, oct-binmap.h, oct-glob.cc, oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sparse.h, oct-string.cc, quit.cc, unwind-prot.h, url-transfer.cc, main.in.cc, mkoctfile.in.cc, and shared-fcns.h.
author John W. Eaton <jwe@octave.org>
date Wed, 28 Apr 2021 22:57:42 -0400
parents 7854d5752dd2
children 32f4357ac8d9
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 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
3 // Copyright (C) 2006-2021 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>
29572
aef11bb4e6d1 use std::size_t and std::ptrdiff_t in C++ code (bug #60471)
John W. Eaton <jwe@octave.org>
parents: 29359
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);
22451
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
84 extern OCTINTERP_API mxArray * mexCallMATLABWithTrap (int nargout,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
85 mxArray *argout[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
86 int nargin,
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
87 mxArray *argin[],
ad5439817753 Add mexCallMATLABWithTrap to MEX API (bug #48949).
Rik <rik@octave.org>
parents: 22407
diff changeset
88 const char *fname);
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
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
103 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
104 const char *name);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
105 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
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
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
114 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
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
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
169 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
170 const mwSize *dims);
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);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
172 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
173 const mwSize *dims);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
174 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
175 const char **str);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
176 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
177 mxComplexity flag);
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);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
179 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
180 const mwSize *dims);
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);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
183 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
184 const mwSize *dims,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
185 mxClassID class_id,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
186 mxComplexity flag);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
187 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
188 mxClassID class_id,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
189 mxComplexity flag);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
190 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
191 const mwSize *dims,
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
192 mxClassID class_id,
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
193 mxComplexity flag);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
194 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
195 mxClassID class_id,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
196 mxComplexity flag);
22464
1d2960b5efe6 Add new MEX fcns mxCreateUninitNumericArray, mxCreateUninitNumericMatrix.
Rik <rik@octave.org>
parents: 22462
diff changeset
197
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
198 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
199 mxComplexity flag);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
200 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
201 mwSize nzmax);
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);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
203 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
204 const mwSize *dims,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
205 int num_keys,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
206 const char **keys);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
207 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
208 int num_keys,
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
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 #if 0
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
291 /* We don't have these yet. */
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
292 extern OCTINTERP_API mxComplexInt8 * mxGetComplexInt8s (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
293 extern OCTINTERP_API mxComplexInt16 * mxGetComplexInt16s (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
294 extern OCTINTERP_API mxComplexInt32 * mxGetComplexInt32s (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
295 extern OCTINTERP_API mxComplexInt64 * mxGetComplexInt64s (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
296 extern OCTINTERP_API mxComplexUint8 * mxGetComplexUint8s (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
297 extern OCTINTERP_API mxComplexUint16 * mxGetComplexUint16s (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
298 extern OCTINTERP_API mxComplexUint32 * mxGetComplexUint32s (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
299 extern OCTINTERP_API mxComplexUint64 * mxGetComplexUint64s (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
300 #endif
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
301 #else
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 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
303 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
304 #endif
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
305
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
306 /* Data setters. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
307 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
308 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
309 #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
310 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
311 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
312 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
313 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
314 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
315 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
316 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
317 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
318 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
319 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
320
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
321 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
322 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
323 #if 0
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
324 /* We don't have these yet. */
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
325 extern OCTINTERP_API int mxSetComplexInt8s (mxArray *p, mxComplexInt8 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
326 extern OCTINTERP_API int mxSetComplexInt16s (mxArray *p, mxComplexInt16 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
327 extern OCTINTERP_API int mxSetComplexInt32s (mxArray *p, mxComplexInt32 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
328 extern OCTINTERP_API int mxSetComplexInt64s (mxArray *p, mxComplexInt64 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
329 extern OCTINTERP_API int mxSetComplexUint8s (mxArray *p, mxComplexUint8 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
330 extern OCTINTERP_API int mxSetComplexUint16s (mxArray *p, mxComplexUint16 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
331 extern OCTINTERP_API int mxSetComplexUint32s (mxArray *p, mxComplexUint32 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
332 extern OCTINTERP_API int mxSetComplexUint64s (mxArray *p, mxComplexUint64 *d);
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
333 #endif
4c21f99b4ad5 handle interleaved complex data and new typed data access functions for mex
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
334 #else
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
335 extern OCTINTERP_API void mxSetPi (mxArray *ptr, double *pi);
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
336 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
337 #endif
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
338
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
339 /* Classes. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
340 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
341 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
342 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
343 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
344 const char *property_name);
23893
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
345 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
346 const char *property_name,
75eff5b667b3 new mxSetProperty function for MEX API
John W. Eaton <jwe@octave.org>
parents: 23891
diff changeset
347 const mxArray *property_value);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
348
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
349 /* Cell support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
350 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
351
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
352 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
353
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
354 /* Sparse support. */
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
355 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
356 extern OCTINTERP_API mwIndex * mxGetJc (const mxArray *ptr);
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
357 extern OCTINTERP_API mwSize mxGetNzmax (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
358
6686
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
359 extern OCTINTERP_API void mxSetIr (mxArray *ptr, mwIndex *ir);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
360 extern OCTINTERP_API void mxSetJc (mxArray *ptr, mwIndex *jc);
2aad75fcc93a [project @ 2007-06-03 20:58:28 by dbateman]
dbateman
parents: 6338
diff changeset
361 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
362
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
363 /* Structure support. */
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
364 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
365
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
366 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
367
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
368 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
369 const char *key);
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
370 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
371 mwIndex index, int key_num);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
372
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
373 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
374 const char *key, mxArray *val);
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
375 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
376 int key_num, mxArray *val);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
377
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
378 extern OCTINTERP_API int mxGetNumberOfFields (const mxArray *ptr);
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
379
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
380 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
381 int key_num);
6109
c68896f193e3 [project @ 2006-10-27 02:16:18 by jwe]
jwe
parents: 6064
diff changeset
382 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
383
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
384 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
385 mwSize buflen);
23446
cd4e1ee28716 maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents: 23441
diff changeset
386 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
387
9651
7234534f47ba mexproto.h: define OCTINTERP_API if it is not already defined
John W. Eaton <jwe@octave.org>
parents: 9650
diff changeset
388 /* Miscellaneous. */
22471
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
389 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
390 mwSize nsubs,
667d353d1ab8 Clean up MEX API prototypes to match Matlab.
Rik <rik@octave.org>
parents: 22465
diff changeset
391 mwIndex *subs);
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
392
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
393 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
394
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
395 #if defined (MEX_DEBUG)
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
396
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
397 # define mxAssert(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
398 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
399 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
400 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
401 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
402 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
403 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
404 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
405 "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
406 #expr, __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
407 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
408 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
409 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
410 "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
411 #expr, __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
412 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
413 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
414 while (0)
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
415
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
416 # define mxAssertS(expr, msg) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
417 do \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
418 { \
23037
0412dc701e28 mexproto.h (mxAssert, mxAssertS): ensure operator precedence (bug #50050)
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 22471
diff changeset
419 if (! (expr)) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
420 { \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
421 if (msg && msg[0]) \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
422 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
423 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
424 "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
425 __LINE__, __FILE__, msg); \
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
426 else \
24721
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
427 mexErrMsgIdAndTxt \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
428 ("Octave:MEX", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
429 "Assertion failed at line %d of file \"%s\".\n", \
f26c5320e858 avoid comparison to NULL
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
430 __LINE__, __FILE__); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
431 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
432 } \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21724
diff changeset
433 while (0)
22459
6af82fc041a4 Implement Matlab-compatible MEX functions mxAssert and mxAssertS.
Rik <rik@octave.org>
parents: 22454
diff changeset
434
5900
c20eb7330d13 [project @ 2006-07-22 08:31:16 by jwe]
jwe
parents: 5879
diff changeset
435 #else
21200
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
436 # define mxAssert(expr, msg)
fcac5dbbf9ed maint: Indent #ifdef blocks in libinterp.
Rik <rik@octave.org>
parents: 19697
diff changeset
437 # define mxAssertS(expr, msg)
5879
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
438 #endif
4f1112bfafce [project @ 2006-07-05 23:50:44 by jwe]
jwe
parents: 5864
diff changeset
439
5864
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
440 #if defined (__cplusplus)
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
441 }
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
442 #endif
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
443
e884ab4f29ee [project @ 2006-06-22 00:57:27 by jwe]
jwe
parents:
diff changeset
444 #endif