1 /* oo_DESCRIPTION.h 2 * 3 * Copyright (C) 1994-2013,2015-2020 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 2 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_BYTEMAT 83 #define oo_BYTEMAT(x,nrow,ncol) { U"" #x, ubytewa, Melder_offsetof (ooSTRUCT, x), sizeof (byte), nullptr, nullptr, 2, nullptr, U"" #nrow, nullptr, U"" #ncol }, 84 85 #undef oo_ENUM 86 #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 }, 87 #undef oo_LENUM 88 #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 }, 89 #undef oo_ENUM_SET 90 #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 }, 91 #undef oo_LENUM_SET 92 #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 }, 93 #undef oo_ENUM_VECTOR_FROM 94 #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 }, 95 #undef oo_LENUM_VECTOR_FROM 96 #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 }, 97 #undef oo_ENUM_VECTOR 98 #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 }, 99 #undef oo_LENUM_VECTOR 100 #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 }, 101 #undef oo_BOOLEAN 102 #define oo_BOOLEAN(x) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, 103 #undef oo_BOOLEAN_SET 104 #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 }, 105 #undef oo_BOOLEAN_VECTOR_FROM 106 #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 }, 107 #undef oo_BOOLEAN_VECTOR 108 #define oo_BOOLEAN_VECTOR(x,n) { U"" #x, booleanwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, 109 #undef oo_QUESTION 110 #define oo_QUESTION(x) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, 111 #undef oo_QUESTION_SET 112 #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 }, 113 #undef oo_QUESTION_VECTOR_FROM 114 #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 }, 115 #undef oo_QUESTION_VECTOR 116 #define oo_QUESTION_VECTOR(x,n) { U"" #x, questionwa, Melder_offsetof (ooSTRUCT, x), sizeof (bool), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, 117 118 #undef oo_STRING 119 #define oo_STRING(x) { U"" #x, stringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, 120 #undef oo_LSTRING 121 #define oo_LSTRING(x) { U"" #x, lstringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr }, 122 123 #undef oo_STRING_SET 124 #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 }, 125 #undef oo_LSTRING_SET 126 #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 }, 127 128 #undef oo_STRING_VECTOR 129 #define oo_STRING_VECTOR(x,n) { U"" #x, stringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, 130 #undef oo_LSTRING_VECTOR 131 #define oo_LSTRING_VECTOR(x,n) { U"" #x, lstringwa, Melder_offsetof (ooSTRUCT, x), sizeof (char32 *), nullptr, nullptr, 1, nullptr, U"" #n, nullptr, nullptr }, 132 133 #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 }, 134 #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 }, 135 #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 }, 136 137 #define oo_OBJECT(Type,version,x) { U"" #x, objectwa, Melder_offsetof (ooSTRUCT, x), sizeof (Type), U"" #Type, & theClassInfo_##Type, 0, nullptr, nullptr, nullptr, nullptr }, 138 #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 }, 139 #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 }, 140 #define oo_FILE(x) 141 #define oo_DIR(x) 142 143 #define oo_DEFINE_STRUCT(Type) \ 144 static struct structData_Description the##Type##_description [] = { 145 #define oo_END_STRUCT(Type) \ 146 { } \ 147 }; \ 148 Data_Description struct##Type :: s_description = & the##Type##_description [0]; 149 150 #define oo_DEFINE_CLASS(Class,Parent) \ 151 static struct structData_Description the##Class##_description [] = { \ 152 { U"" #Class, inheritwa, 0, sizeof (class struct##Class), U"" #Class, & theClassInfo_##Parent, 0, nullptr, nullptr, nullptr, nullptr }, 153 #define oo_END_CLASS(Class) \ 154 { } \ 155 }; \ 156 Data_Description struct##Class :: s_description = & the##Class##_description [0]; 157 158 #define oo_FROM(from) 159 #define oo_ENDFROM 160 161 #define oo_DECLARING 0 162 #define oo_DESTROYING 0 163 #define oo_COPYING 0 164 #define oo_COMPARING 0 165 #define oo_VALIDATING_ENCODING 0 166 #define oo_READING 0 167 #define oo_READING_TEXT 0 168 #define oo_READING_BINARY 0 169 #define oo_WRITING 0 170 #define oo_WRITING_TEXT 0 171 #define oo_WRITING_BINARY 0 172 #define oo_DESCRIBING 1 173 174 /* End of file oo_DESCRIPTION.h */ 175