annotate libinterp/corefcn/mxtypes.in.h @ 33250:40fde86be9b0

replace calls to error_* with corresponding panic_* functions in libinterp Affected files: __isprimelarge__.cc, cellfun.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, graphics.cc, kron.cc, mex.cc, oct-map.cc, oct-stream.cc, pr-output.cc, schur.cc, variables.cc, and ops.h.
author John W. Eaton <jwe@octave.org>
date Mon, 25 Mar 2024 00:42:04 -0400
parents 2e484f9f1f18
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28123
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 // %NO_EDIT_WARNING%
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 ////////////////////////////////////////////////////////////////////////
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31706
diff changeset
5 // Copyright (C) 2001-2024 The Octave Project Developers
28123
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 // See the file COPYRIGHT.md in the top-level directory of this
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 // distribution or <https://octave.org/copyright/>.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 // This file is part of Octave.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 // Octave is free software: you can redistribute it and/or modify it
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 // under the terms of the GNU General Public License as published by
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 // the Free Software Foundation, either version 3 of the License, or
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 // (at your option) any later version.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 // Octave is distributed in the hope that it will be useful, but
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 // GNU General Public License for more details.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 // You should have received a copy of the GNU General Public License
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 // along with Octave; see the file COPYING. If not, see
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 // <https://www.gnu.org/licenses/>.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 //
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 ////////////////////////////////////////////////////////////////////////
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 /*
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 Part of this code was originally distributed as part of Octave Forge under
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 the following terms:
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 Author: Paul Kienzle
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 I grant this code to the public domain.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 2001-03-22
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 SUCH DAMAGE.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 */
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 #if ! defined (octave_mxtypes_h)
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 #define octave_mxtypes_h 1
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 #include "octave-config.h"
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 typedef enum
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
57 {
28123
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58 mxUNKNOWN_CLASS = 0,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 mxCELL_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 mxSTRUCT_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 mxLOGICAL_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
62 mxCHAR_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
63 mxVOID_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
64 mxDOUBLE_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65 mxSINGLE_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 mxINT8_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 mxUINT8_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 mxINT16_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 mxUINT16_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 mxINT32_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 mxUINT32_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 mxINT64_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 mxUINT64_CLASS,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 mxFUNCTION_CLASS
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 }
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 mxClassID;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 typedef enum
31607
aac27ad79be6 maint: Re-indent code after switch to using namespace macros.
Rik <rik@octave.org>
parents: 30564
diff changeset
79 {
28123
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 mxREAL = 0,
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
81 mxCOMPLEX = 1
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 }
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 mxComplexity;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 /* Matlab uses a wide char (uint16) internally, but Octave uses plain char. */
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 /* typedef Uint16 mxChar; */
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87 typedef char mxChar;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 typedef unsigned char mxLogical;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 typedef double mxDouble;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 typedef float mxSingle;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 typedef int8_t mxInt8;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 typedef int16_t mxInt16;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96 typedef int32_t mxInt32;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 typedef int64_t mxInt64;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 typedef uint8_t mxUint8;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 typedef uint16_t mxUint16;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
101 typedef uint32_t mxUint32;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
102 typedef uint64_t mxUint64;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
104 typedef struct { mxDouble real; mxDouble imag; } mxComplexDouble;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
105 typedef struct { mxSingle real; mxSingle imag; } mxComplexSingle;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
106
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
107 /* We don't have these yet but we can define the types. */
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
108 typedef struct { mxInt8 real; mxInt8 imag; } mxComplexInt8;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
109 typedef struct { mxInt16 real; mxInt16 imag; } mxComplexInt16;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 typedef struct { mxInt32 real; mxInt32 imag; } mxComplexInt32;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 typedef struct { mxInt64 real; mxInt64 imag; } mxComplexInt64;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
113 typedef struct { mxUint8 real; mxUint8 imag; } mxComplexUint8;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
114 typedef struct { mxUint16 real; mxUint16 imag; } mxComplexUint16;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
115 typedef struct { mxUint32 real; mxUint32 imag; } mxComplexUint32;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
116 typedef struct { mxUint64 real; mxUint64 imag; } mxComplexUint64;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 /*
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
119 * FIXME: Mathworks says mwSize, mwIndex should be int generally.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
120 * But on 64-bit systems, or when mex -largeArrayDims is used, it is size_t.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
121 * mwSignedIndex is supposed to be ptrdiff_t. All of this is confusing.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
122 * Its better to conform to the same indexing as the rest of Octave.
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
123 */
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
124 typedef %OCTAVE_IDX_TYPE% mwSize;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
125 typedef %OCTAVE_IDX_TYPE% mwIndex;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
126 typedef %OCTAVE_IDX_TYPE% mwSignedIndex;
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
127
4963f23b145c move mex type definitions to separate file
John W. Eaton <jwe@octave.org>
parents:
diff changeset
128 #endif