| 1 | /* oo_DESCRIPTION.h |
| 2 | * |
| 3 | * Copyright (C) 1994-2013,2015-2020,2023,2024,2026 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "oo_undef.h" |
| 20 | |
| 21 | #undef oo_BYTE |
| 22 | #define oo_BYTE(x) { U"" #x, bytewa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 23 | #undef oo_INT16 |
| 24 | #define oo_INT16(x) { U"" #x, int16wa, Melder_offsetof (ooSTRUCT, x), sizeof (int16), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 25 | #undef oo_INT |
| 26 | #define oo_INT(x) { U"" #x, intwa, Melder_offsetof (ooSTRUCT, x), sizeof (int), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 27 | #undef oo_INT32 |
| 28 | #define oo_INT32(x) { U"" #x, intwa, Melder_offsetof (ooSTRUCT, x), sizeof (int32), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 29 | #undef oo_INTEGER |
| 30 | #define oo_INTEGER(x) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 31 | #undef oo_INTEGER16 |
| 32 | #define oo_INTEGER16(x) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 33 | #undef oo_UBYTE |
| 34 | #define oo_UBYTE(x) { U"" #x, ubytewa, Melder_offsetof (ooSTRUCT, x), sizeof (unsigned char), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 35 | #undef oo_UINT |
| 36 | #define oo_UINT(x) { U"" #x, uintwa, Melder_offsetof (ooSTRUCT, x), sizeof (unsigned int), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 37 | #undef oo_UINTEGER |
| 38 | #define oo_UINTEGER(x) { U"" #x, uintegerwa, Melder_offsetof (ooSTRUCT, x), sizeof (uinteger), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 39 | #undef oo_FLOAT |
| 40 | #define oo_FLOAT(x) { U"" #x, floatwa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 41 | #undef oo_DOUBLE |
| 42 | #define oo_DOUBLE(x) { U"" #x, doublewa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 43 | #undef oo_COMPLEX |
| 44 | #define oo_COMPLEX(x) { U"" #x, complexwa, Melder_offsetof (ooSTRUCT, x), sizeof (dcomplex), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 45 | |
| 46 | #undef oo_BYTE_SET |
| 47 | #define oo_BYTE_SET(x,setType) { U"" #x, bytewa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, /* BUG function pointer to pointer */ |
| 48 | #undef oo_INT_SET |
| 49 | #define oo_INT_SET(x,setType) { U"" #x, intwa, Melder_offsetof (ooSTRUCT, x), sizeof (int), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 50 | #undef oo_INTEGER_SET |
| 51 | #define oo_INTEGER_SET(x,setType) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 52 | #undef oo_UBYTE_SET |
| 53 | #define oo_UBYTE_SET(x,setType) { U"" #x, ubytewa, Melder_offsetof (ooSTRUCT, x), sizeof (unsigned char), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 54 | #undef oo_UINT_SET |
| 55 | #define oo_UINT_SET(x,setType) { U"" #x, uintwa, Melder_offsetof (ooSTRUCT, x), sizeof (unsigned int), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 56 | #undef oo_UINTEGER_SET |
| 57 | #define oo_UINTEGER_SET(x,setType) { U"" #x, uintegerwa, Melder_offsetof (ooSTRUCT, x), sizeof (uinteger), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 58 | #undef oo_FLOAT_SET |
| 59 | #define oo_FLOAT_SET(x,setType) { U"" #x, floatwa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 60 | #undef oo_DOUBLE_SET |
| 61 | #define oo_DOUBLE_SET(x,setType) { U"" #x, doublewa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 62 | #undef oo_COMPLEX_SET |
| 63 | #define oo_COMPLEX_SET(x,setType) { U"" #x, complexwa, Melder_offsetof (ooSTRUCT, x), sizeof (dcomplex), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 64 | |
| 65 | #undef oo_VEC |
| 66 | #define oo_VEC(x,n) { U"" #x, doublewa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 67 | #undef oo_INTVEC |
| 68 | #define oo_INTVEC(x,n) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 69 | #undef oo_INTVEC16 |
| 70 | #define oo_INTVEC16(x,n) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 71 | #undef oo_BOOLVEC |
| 72 | #define oo_BOOLVEC(x,n) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 73 | #undef oo_COMPVEC |
| 74 | #define oo_COMPVEC(x,n) { U"" #x, complexwa, Melder_offsetof (ooSTRUCT, x), sizeof (dcomplex), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 75 | #undef oo_BYTEVEC |
| 76 | #define oo_BYTEVEC(x,n) { U"" #x, ubytewa, Melder_offsetof (ooSTRUCT, x), sizeof (byte), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 77 | |
| 78 | #undef oo_MAT |
| 79 | #define oo_MAT(x,nrow,ncol) { U"" #x, doublewa, Melder_offsetof (ooSTRUCT, x), sizeof (double), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 80 | #undef oo_INTMAT |
| 81 | #define oo_INTMAT(x,nrow,ncol) { U"" #x, integerwa, Melder_offsetof (ooSTRUCT, x), sizeof (integer), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 82 | #undef oo_BOOLMAT |
| 83 | #define oo_BOOLMAT(x,nrow,ncol) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 84 | #undef oo_COMPMAT |
| 85 | #define oo_COMPMAT(x,nrow,ncol) { U"" #x, complexwa, Melder_offsetof (ooSTRUCT, x), sizeof (dcomplex), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 86 | #undef oo_BYTEMAT |
| 87 | #define oo_BYTEMAT(x,nrow,ncol) { U"" #x, ubytewa, Melder_offsetof (ooSTRUCT, x), sizeof (byte), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 88 | |
| 89 | #undef oo_ENUM |
| 90 | #define oo_ENUM(Type,x) { U"" #x, enumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), U"" #Type, (void *) Type##_getText, 0, nullptr, nullptr, nullptr, nullptr }, |
| 91 | #undef oo_LENUM |
| 92 | #define oo_LENUM(Type,x) { U"" #x, lenumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed short), U"" #Type, (void *) Type##_getText, 0, nullptr, nullptr, nullptr, nullptr }, |
| 93 | #undef oo_ENUM_SET |
| 94 | #define oo_ENUM_SET(Type,x,setType) { U"" #x, enumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), U"" #Type, (void *) Type##_getText, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 95 | #undef oo_LENUM_SET |
| 96 | #define oo_LENUM_SET(Type,x,setType) { U"" #x, lenumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed short), U"" #Type, (void *) Type##_getText, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 97 | #undef oo_ENUM_VECTOR_FROM |
| 98 | #define oo_ENUM_VECTOR_FROM(Type,x,min,max) { U"" #x, enumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), U"" #Type, (void *) Type##_getText, 1, U"" #min, U"" #max, nullptr, nullptr }, |
| 99 | #undef oo_LENUM_VECTOR_FROM |
| 100 | #define oo_LENUM_VECTOR_FROM(Type,x,min,max) { U"" #x, lenumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed short), U"" #Type, (void *) Type##_getText, 1, U"" #min, U"" #max, nullptr, nullptr }, |
| 101 | #undef oo_ENUM_VECTOR |
| 102 | #define oo_ENUM_VECTOR(Type,x,n) { U"" #x, enumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed char), U"" #Type, (void *) Type##_getText, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 103 | #undef oo_LENUM_VECTOR |
| 104 | #define oo_LENUM_VECTOR(Type,x,n) { U"" #x, lenumwa, Melder_offsetof (ooSTRUCT, x), sizeof (signed short), U"" #Type, (void *) Type##_getText, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 105 | #undef oo_BOOLEAN |
| 106 | #define oo_BOOLEAN(x) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 107 | #undef oo_BOOLEAN_SET |
| 108 | #define oo_BOOLEAN_SET(x,setType) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 109 | #undef oo_BOOLEAN_VECTOR_FROM |
| 110 | #define oo_BOOLEAN_VECTOR_FROM(x,min,max) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, U"" #min, U"" #max, nullptr, nullptr }, |
| 111 | #undef oo_BOOLEAN_VECTOR |
| 112 | #define oo_BOOLEAN_VECTOR(x,n) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 113 | #undef oo_QUESTION |
| 114 | #define oo_QUESTION(x) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 115 | #undef oo_QUESTION_SET |
| 116 | #define oo_QUESTION_SET(x,setType) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 117 | #undef oo_QUESTION_VECTOR_FROM |
| 118 | #define oo_QUESTION_VECTOR_FROM(x,min,max) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, U"" #min, U"" #max, nullptr, nullptr }, |
| 119 | #undef oo_QUESTION_VECTOR |
| 120 | #define oo_QUESTION_VECTOR(x,n) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 121 | |
| 122 | #undef oo_STRING |
| 123 | #define oo_STRING(x) { U"" #x, stringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 124 | #undef oo_LSTRING |
| 125 | #define oo_LSTRING(x) { U"" #x, lstringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, |
| 126 | |
| 127 | #undef oo_STRING_SET |
| 128 | #define oo_STRING_SET(x,setType) { U"" #x, stringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 129 | #undef oo_LSTRING_SET |
| 130 | #define oo_LSTRING_SET(x,setType) { U"" #x, lstringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 131 | |
| 132 | #undef oo_STRING_VECTOR |
| 133 | #define oo_STRING_VECTOR(x,n) { U"" #x, stringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 134 | #undef oo_LSTRING_VECTOR |
| 135 | #define oo_LSTRING_VECTOR(x,n) { U"" #x, lstringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 136 | |
| 137 | #define oo_STRUCT(Type,x) { U"" #x, structwa, Melder_offsetof (ooSTRUCT, x), sizeof (struct struct##Type), U"" #Type, & struct##Type :: s_description, 0, nullptr, nullptr, nullptr, nullptr }, |
| 138 | #define oo_STRUCT_SET(Type,x,setType) { U"" #x, structwa, Melder_offsetof (ooSTRUCT, x), sizeof (struct struct##Type), U"" #Type, & struct##Type :: s_description, 3, (conststring32) setType##_getText, (conststring32) setType##_getValue, nullptr, nullptr }, |
| 139 | #define oo_STRUCTVEC(Type,x,n) { U"" #x, structwa, Melder_offsetof (ooSTRUCT, x), sizeof (struct struct##Type), U"" #Type, & struct##Type :: s_description, 1, nullptr, U"" #n, nullptr, nullptr }, |
| 140 | #define oo_STRUCTMAT(Type,x,nrow,ncol) { U"" #x, structwa, Melder_offsetof (ooSTRUCT, x), sizeof (struct struct##Type), U"" #Type, & struct##Type :: s_description, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, |
| 141 | |
| 142 | #define oo_OBJECT(Type,version,x) { U"" #x, objectwa, Melder_offsetof (ooSTRUCT, x), sizeof (Type), U"" #Type, & theClassInfo_##Type, 0, nullptr, nullptr, nullptr, nullptr }, |
| 143 | #define oo_COLLECTION_OF(Type,x,ItemType,version) { U"" #x, collectionofwa, Melder_offsetof (ooSTRUCT, x), sizeof (class struct##ItemType), U"" #Type, & theClassInfo_Collection, 0, (conststring32) & theClassInfo_##ItemType, nullptr, nullptr, nullptr }, |
| 144 | #define oo_COLLECTION(Type,x,ItemType,version) { U"" #x, collectionwa, Melder_offsetof (ooSTRUCT, x), sizeof (class struct##ItemType), U"" #Type, & theClassInfo_##Type, 0, (conststring32) & theClassInfo_##ItemType, nullptr, nullptr, nullptr }, |
| 145 | #define oo_TRANSIENT_FILE(x) |
| 146 | #define oo_TRANSIENT_FOLDER(x) |
| 147 | #define oo_UNSAFE_BORROWED_TRANSIENT_CONST_OBJECT_REFERENCE(Class, x) |
| 148 | #define oo_UNSAFE_BORROWED_TRANSIENT_MUTABLE_OBJECT_REFERENCE(Class, x) |
| 149 | |
| 150 | #define oo_DEFINE_STRUCT(Type) \ |
| 151 | static struct structData_Description the##Type##_description [] = { |
| 152 | #define oo_END_STRUCT(Type) \ |
| 153 | { } \ |
| 154 | }; \ |
| 155 | Data_Description struct##Type :: s_description = & the##Type##_description [0]; |
| 156 | |
| 157 | #define oo_DEFINE_CLASS(Class,Parent) \ |
| 158 | static struct structData_Description the##Class##_description [] = { \ |
| 159 | { U"" #Class, inheritwa, 0, sizeof (class struct##Class), U"" #Class, & theClassInfo_##Parent, 0, nullptr, nullptr, nullptr, nullptr }, |
| 160 | #define oo_END_CLASS(Class) \ |
| 161 | { } \ |
| 162 | }; \ |
| 163 | Data_Description struct##Class :: s_description = & the##Class##_description [0]; |
| 164 | |
| 165 | #define oo_FROM(from) |
| 166 | #define oo_ENDFROM |
| 167 | |
| 168 | #define oo_DECLARING 0 |
| 169 | #define oo_DESTROYING 0 |
| 170 | #define oo_COPYING 0 |
| 171 | #define oo_COMPARING 0 |
| 172 | #define oo_VALIDATING_ENCODING 0 |
| 173 | #define oo_READING 0 |
| 174 | #define oo_READING_TEXT 0 |
| 175 | #define oo_READING_BINARY 0 |
| 176 | #define oo_WRITING 0 |
| 177 | #define oo_WRITING_TEXT 0 |
| 178 | #define oo_WRITING_BINARY 0 |
| 179 | #define oo_DESCRIBING 1 |
| 180 | |
| 181 | /* End of file oo_DESCRIPTION.h */ |