| 1 | /* |
| 2 | * |
| 3 | * File: elements.m - Operation on all elements |
| 4 | * |
| 5 | * Copyright (C) 1999 Steve Ratcliffe |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License version 2 as |
| 9 | * published by the Free Software Foundation. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | */ |
| 16 | |
| 17 | |
| 18 | #include "glib.h"cxx . . $ `<file>/src/glib.h`/ |
| 19 | #include "elements.h"cxx . . $ `<file>/src/elements.h`/ |
| 20 | #include "except.h"cxx . . $ `<file>/src/except.h`/ |
| 21 | #include "intl.h"cxx . . $ `<file>/src/intl.h`/ |
| 22 | |
| 23 | #include "md.h"cxx . . $ `<file>/src/md.h`/ |
| 24 | |
| 25 | static void md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(struct containerElementcxx . . $ containerElement# *e); |
| 26 | |
| 27 | /* |
| 28 | * Create and initialise a element element. |
| 29 | */ |
| 30 | struct elementcxx . . $ element# * |
| 31 | md_element_newcxx . . $ md_element_new(6082b53968adc3bf).() |
| 32 | { |
| 33 | struct elementcxx . . $ element# * new; |
| 34 | |
| 35 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 36 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_ELEMENTcxx . . $ `src/elements.h:243:9`!; |
| 37 | return new; |
| 38 | } |
| 39 | |
| 40 | /* |
| 41 | * Create and initialise a container element. |
| 42 | */ |
| 43 | struct containerElementcxx . . $ containerElement# * |
| 44 | md_container_newcxx . . $ md_container_new(f9f95b42874366fc).() |
| 45 | { |
| 46 | struct containerElementcxx . . $ containerElement# * new; |
| 47 | |
| 48 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 49 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_CONTAINERcxx . . $ `src/elements.h:251:9`!; |
| 50 | return new; |
| 51 | } |
| 52 | |
| 53 | /* |
| 54 | * Initialize data structures within the element. This is |
| 55 | * only really required when pointers need allocating. |
| 56 | * Arguments: |
| 57 | * e - Element to init |
| 58 | */ |
| 59 | static void |
| 60 | md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(struct containerElementcxx . . $ containerElement# *e) |
| 61 | { |
| 62 | |
| 63 | e->elementscxx . . $ containerElement#elements. = g_ptr_array_newcxx . . $ g_ptr_array_new(61b5db61367ab387).(); |
| 64 | } |
| 65 | |
| 66 | /* |
| 67 | * Create and initialise a root element. |
| 68 | * Arguments: |
| 69 | * - |
| 70 | */ |
| 71 | struct rootElementcxx . . $ rootElement# * |
| 72 | md_root_newcxx . . $ md_root_new(a50f9478f8482255).(void) |
| 73 | { |
| 74 | struct rootElementcxx . . $ rootElement# * new; |
| 75 | |
| 76 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 77 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_ROOTcxx . . $ `src/elements.h:235:9`!; |
| 78 | md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(MD_CONTAINERcxx . . $ `src/elements.h:41:9`!(new)); |
| 79 | return new; |
| 80 | } |
| 81 | |
| 82 | /* |
| 83 | * Create and initialise a track element. |
| 84 | * Arguments: |
| 85 | * - |
| 86 | */ |
| 87 | struct trackElementcxx . . $ trackElement# * |
| 88 | md_track_newcxx . . $ md_track_new(f7edcf1bc72a45d4).(void) |
| 89 | { |
| 90 | struct trackElementcxx . . $ trackElement# * new; |
| 91 | |
| 92 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 93 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_TRACKcxx . . $ `src/elements.h:248:9`!; |
| 94 | md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(MD_CONTAINERcxx . . $ `src/elements.h:41:9`!(new)); |
| 95 | return new; |
| 96 | } |
| 97 | |
| 98 | /* |
| 99 | * Create and initialise a tempomap element. |
| 100 | */ |
| 101 | struct tempomapElementcxx . . $ tempomapElement# * |
| 102 | md_tempomap_newcxx . . $ md_tempomap_new(20071cdab2b51b1d).() |
| 103 | { |
| 104 | struct tempomapElementcxx . . $ tempomapElement# * new; |
| 105 | |
| 106 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 107 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_TEMPOMAPcxx . . $ `src/elements.h:246:9`!; |
| 108 | md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(MD_CONTAINERcxx . . $ `src/elements.h:41:9`!(new)); |
| 109 | return new; |
| 110 | } |
| 111 | |
| 112 | /* |
| 113 | * Create and initialise a note element. |
| 114 | * Arguments: |
| 115 | * note - |
| 116 | * vel - |
| 117 | * length - |
| 118 | */ |
| 119 | struct noteElementcxx . . $ noteElement# * |
| 120 | md_note_newcxx . . $ md_note_new(51f6f23a6123a73f).(short note, short vel, int length) |
| 121 | { |
| 122 | struct noteElementcxx . . $ noteElement# * new; |
| 123 | |
| 124 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 125 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_NOTEcxx . . $ `src/elements.h:242:9`!; |
| 126 | new->notecxx . . $ noteElement#note. = note; |
| 127 | new->velcxx . . $ noteElement#vel. = vel; |
| 128 | new->lengthcxx . . $ noteElement#length. = length; |
| 129 | new->offvelcxx . . $ noteElement#offvel. = 0; |
| 130 | return new; |
| 131 | } |
| 132 | |
| 133 | /* |
| 134 | * Create and initialise a part element. |
| 135 | * Arguments: |
| 136 | * - |
| 137 | */ |
| 138 | struct partElementcxx . . $ partElement# * |
| 139 | md_part_newcxx . . $ md_part_new(d55e002a0373ce22).(void) |
| 140 | { |
| 141 | struct partElementcxx . . $ partElement# * new; |
| 142 | |
| 143 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 144 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_PARTcxx . . $ `src/elements.h:234:9`!; |
| 145 | md_container_initcxx . . $ md_container_init(ab2f5ebcaaaeb558).(MD_CONTAINERcxx . . $ `src/elements.h:41:9`!(new)); |
| 146 | return new; |
| 147 | } |
| 148 | |
| 149 | /* |
| 150 | * Create and initialise a control element. |
| 151 | * Arguments: |
| 152 | * control - |
| 153 | * value - |
| 154 | */ |
| 155 | struct controlElementcxx . . $ controlElement# * |
| 156 | md_control_newcxx . . $ md_control_new(e3b5e94b6af1caac).(short control, short value) |
| 157 | { |
| 158 | struct controlElementcxx . . $ controlElement# * new; |
| 159 | |
| 160 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 161 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_CONTROLcxx . . $ `src/elements.h:253:9`!; |
| 162 | new->controlcxx . . $ controlElement#control. = control; |
| 163 | new->valuecxx . . $ controlElement#value. = value; |
| 164 | return new; |
| 165 | } |
| 166 | |
| 167 | /* |
| 168 | * Create and initialise a program element. |
| 169 | * Arguments: |
| 170 | * program - |
| 171 | */ |
| 172 | struct programElementcxx . . $ programElement# * |
| 173 | md_program_newcxx . . $ md_program_new(1eb75148bd317b1e).(int program) |
| 174 | { |
| 175 | struct programElementcxx . . $ programElement# * new; |
| 176 | |
| 177 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 178 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_PROGRAMcxx . . $ `src/elements.h:239:9`!; |
| 179 | new->programcxx . . $ programElement#program. = program; |
| 180 | return new; |
| 181 | } |
| 182 | |
| 183 | /* |
| 184 | * Create and initialise a keytouch element. |
| 185 | * Arguments: |
| 186 | * note - |
| 187 | * vel - |
| 188 | */ |
| 189 | struct keytouchElementcxx . . $ keytouchElement# * |
| 190 | md_keytouch_newcxx . . $ md_keytouch_new(d9068c5ca8ca45f1).(int note, int vel) |
| 191 | { |
| 192 | struct keytouchElementcxx . . $ keytouchElement# * new; |
| 193 | |
| 194 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 195 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_KEYTOUCHcxx . . $ `src/elements.h:236:9`!; |
| 196 | new->notecxx . . $ keytouchElement#note. = note; |
| 197 | new->velocitycxx . . $ keytouchElement#velocity. = vel; |
| 198 | return new; |
| 199 | } |
| 200 | |
| 201 | /* |
| 202 | * Create and initialise a pressure element. |
| 203 | * Arguments: |
| 204 | * vel - |
| 205 | */ |
| 206 | struct pressureElementcxx . . $ pressureElement# * |
| 207 | md_pressure_newcxx . . $ md_pressure_new(b6a8b7a84f29ed62).(int vel) |
| 208 | { |
| 209 | struct pressureElementcxx . . $ pressureElement# * new; |
| 210 | |
| 211 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 212 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_PRESSUREcxx . . $ `src/elements.h:241:9`!; |
| 213 | new->velocitycxx . . $ pressureElement#velocity. = vel; |
| 214 | return new; |
| 215 | } |
| 216 | |
| 217 | /* |
| 218 | * Create and initialise a pitch element. |
| 219 | */ |
| 220 | struct pitchElementcxx . . $ pitchElement# * |
| 221 | md_pitch_newcxx . . $ md_pitch_new(dd18f6a3f0176769).(int val) |
| 222 | { |
| 223 | struct pitchElementcxx . . $ pitchElement# * new; |
| 224 | |
| 225 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 226 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_PITCHcxx . . $ `src/elements.h:238:9`!; |
| 227 | new->pitchcxx . . $ pitchElement#pitch. = val; |
| 228 | return new; |
| 229 | } |
| 230 | |
| 231 | /* |
| 232 | * Create and initialise a sysex element. |
| 233 | */ |
| 234 | struct sysexElementcxx . . $ sysexElement# * |
| 235 | md_sysex_newcxx . . $ md_sysex_new(68047c89e1f55f37).(int status, unsigned char *data, int len) |
| 236 | { |
| 237 | struct sysexElementcxx . . $ sysexElement# * new; |
| 238 | |
| 239 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 240 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_SYSEXcxx . . $ `src/elements.h:247:9`!; |
| 241 | new->statuscxx . . $ sysexElement#status. = status; |
| 242 | new->datacxx . . $ sysexElement#data. = data; |
| 243 | new->lengthcxx . . $ sysexElement#length. = len; |
| 244 | return new; |
| 245 | } |
| 246 | |
| 247 | /* |
| 248 | * Create and initialise a meta element. |
| 249 | */ |
| 250 | struct metaElementcxx . . $ metaElement# * |
| 251 | md_meta_newcxx . . $ md_meta_new(ce78063bd076f481).() |
| 252 | { |
| 253 | struct metaElementcxx . . $ metaElement# * new; |
| 254 | |
| 255 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 256 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_METAcxx . . $ `src/elements.h:240:9`!; |
| 257 | return new; |
| 258 | } |
| 259 | |
| 260 | /* |
| 261 | * Create and initialise a map element. |
| 262 | */ |
| 263 | struct mapElementcxx . . $ mapElement# * |
| 264 | md_map_newcxx . . $ md_map_new(6be0a52a477badb3).() |
| 265 | { |
| 266 | struct mapElementcxx . . $ mapElement# * new; |
| 267 | |
| 268 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 269 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_MAPcxx . . $ `src/elements.h:252:9`!; |
| 270 | return new; |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | * Create and initialise a keysig element. |
| 275 | */ |
| 276 | struct keysigElementcxx . . $ keysigElement# * |
| 277 | md_keysig_newcxx . . $ md_keysig_new(3f715853fb4ff7af).(short key, short minor) |
| 278 | { |
| 279 | struct keysigElementcxx . . $ keysigElement# * new; |
| 280 | |
| 281 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 282 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_KEYSIGcxx . . $ `src/elements.h:249:9`!; |
| 283 | new->keycxx . . $ keysigElement#key. = key; |
| 284 | new->minorcxx . . $ keysigElement#minor. = minor != 0? 1: 0; |
| 285 | return new; |
| 286 | } |
| 287 | |
| 288 | /* |
| 289 | * Create and initialise a timesig element. |
| 290 | */ |
| 291 | struct timesigElementcxx . . $ timesigElement# * |
| 292 | md_timesig_newcxx . . $ md_timesig_new(77ab818acf3e842a).(short top, short bottom, short clocks, short n32pq) |
| 293 | { |
| 294 | struct timesigElementcxx . . $ timesigElement# * new; |
| 295 | |
| 296 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 297 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_TIMESIGcxx . . $ `src/elements.h:250:9`!; |
| 298 | new->topcxx . . $ timesigElement#top. = top; |
| 299 | new->bottomcxx . . $ timesigElement#bottom. = bottom; |
| 300 | new->clockscxx . . $ timesigElement#clocks. = clocks; |
| 301 | new->n32pqcxx . . $ timesigElement#n32pq. = n32pq; |
| 302 | return new; |
| 303 | } |
| 304 | |
| 305 | /* |
| 306 | * Create and initialise a tempo element. |
| 307 | */ |
| 308 | struct tempoElementcxx . . $ tempoElement# * |
| 309 | md_tempo_newcxx . . $ md_tempo_new(632eb305d08cebbf).(int m) |
| 310 | { |
| 311 | struct tempoElementcxx . . $ tempoElement# * new; |
| 312 | |
| 313 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 314 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_TEMPOcxx . . $ `src/elements.h:245:9`!; |
| 315 | new->micro_tempocxx . . $ tempoElement#micro_tempo. = m; |
| 316 | return new; |
| 317 | } |
| 318 | |
| 319 | /* |
| 320 | * Create and initialise a text element. |
| 321 | */ |
| 322 | struct textElementcxx . . $ textElement# * |
| 323 | md_text_newcxx . . $ md_text_new(c22b28bbd3f6e4f1).(int type, char *text) |
| 324 | { |
| 325 | struct textElementcxx . . $ textElement# * new; |
| 326 | |
| 327 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 328 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_TEXTcxx . . $ `src/elements.h:237:9`!; |
| 329 | { |
| 330 | static char *typenames[] = { |
| 331 | "", |
| 332 | "text", |
| 333 | "copyright", |
| 334 | "trackname", |
| 335 | "instrument", |
| 336 | "lyric", |
| 337 | "marker", |
| 338 | "cuepoint", |
| 339 | }; |
| 340 | new->typecxx . . $ textElement#type. = type; |
| 341 | new->namecxx . . $ textElement#name. = typenames[type]; |
| 342 | new->textcxx . . $ textElement#text. = text; |
| 343 | if (text) |
| 344 | new->lengthcxx . . $ textElement#length. = strlencxx . . $ strlen(751346f8406fd082).(text); |
| 345 | else |
| 346 | new->lengthcxx . . $ textElement#length. = 0; |
| 347 | } |
| 348 | return new; |
| 349 | } |
| 350 | |
| 351 | /* |
| 352 | * Create and initialise a smpteoffset element. |
| 353 | */ |
| 354 | struct smpteoffsetElementcxx . . $ smpteoffsetElement# * |
| 355 | md_smpteoffset_newcxx . . $ md_smpteoffset_new(af48f5cc74e70ec9).(short hours, short minutes, short seconds, short frames, |
| 356 | short subframes) |
| 357 | { |
| 358 | struct smpteoffsetElementcxx . . $ smpteoffsetElement# * new; |
| 359 | |
| 360 | new = g_malloc0cxx . . $ `src/glib.h:1300:9`!(sizeof(*new)); |
| 361 | MD_ELEMENTcxx . . $ `src/elements.h:33:9`!(new)->typecxx . . $ element#type. = MD_TYPE_SMPTEOFFSETcxx . . $ `src/elements.h:244:9`!; |
| 362 | new->hourscxx . . $ smpteoffsetElement#hours. = hours; |
| 363 | new->minutescxx . . $ smpteoffsetElement#minutes. = minutes; |
| 364 | new->secondscxx . . $ smpteoffsetElement#seconds. = seconds; |
| 365 | new->framescxx . . $ smpteoffsetElement#frames. = frames; |
| 366 | new->subframescxx . . $ smpteoffsetElement#subframes. = subframes; |
| 367 | return new; |
| 368 | } |
| 369 | |
| 370 | /* |
| 371 | * Add an element to a container element. |
| 372 | */ |
| 373 | void |
| 374 | md_addcxx . . $ md_add(1bddb16a67dfcf35).(struct containerElementcxx . . $ containerElement# *c, struct elementcxx . . $ element# *e) |
| 375 | { |
| 376 | g_ptr_array_addcxx . . $ g_ptr_array_add(3cd73f70a4ada9).(c->elementscxx . . $ containerElement#elements., e); |
| 377 | } |
| 378 | |
| 379 | /* |
| 380 | * Free a complete element tree. |
| 381 | */ |
| 382 | void |
| 383 | md_freecxx . . $ md_free(c289bede69bef025).(struct elementcxx . . $ element# *el) |
| 384 | { |
| 385 | struct containerElementcxx . . $ containerElement# *c; |
| 386 | int i; |
| 387 | |
| 388 | if (el->typecxx . . $ element#type. >= MD_CONTAINER_BEGINcxx . . $ `src/elements.h:22:9`!) { |
| 389 | c = MD_CONTAINERcxx . . $ `src/elements.h:41:9`!(el); |
| 390 | for (i = 0; i < c->elementscxx . . $ containerElement#elements.->lencxx . . $ _GPtrArray#len.; i++) { |
| 391 | struct elementcxx . . $ element# *p = g_ptr_array_indexcxx . . $ `src/glib.h:1561:13`!(c->elements, i); |
| 392 | md_freecxx . . $ md_free(c289bede69bef025).(p); |
| 393 | } |
| 394 | g_ptr_array_freecxx . . $ g_ptr_array_free(a9bf79c3455f9f51).(c->elementscxx . . $ containerElement#elements., 1); |
| 395 | } |
| 396 | switch (el->typecxx . . $ element#type.) { |
| 397 | case MD_TYPE_TEXTcxx . . $ `src/elements.h:237:9`!: |
| 398 | g_freecxx . . $ `src/glib.h:1302:9`!(MD_TEXTcxx . . $ `src/elements.h:190:9`!(el)->text); |
| 399 | break; |
| 400 | case MD_TYPE_SYSEXcxx . . $ `src/elements.h:247:9`!: |
| 401 | g_freecxx . . $ `src/glib.h:1302:9`!(MD_SYSEXcxx . . $ `src/elements.h:137:9`!(el)->data); |
| 402 | break; |
| 403 | } |
| 404 | g_freecxx . . $ `src/glib.h:1302:9`!(el); |
| 405 | |
| 406 | } |
| 407 | |
| 408 | /* |
| 409 | * Check that the given element can be casted to the given type. |
| 410 | * This is mainly for debugging as mismatches will not happen |
| 411 | * in proper use. In particular do not use this routine to check |
| 412 | * types unless you want the program to exit if the check fails. |
| 413 | * Arguments: |
| 414 | * el - Element to be cast |
| 415 | * type - type to cast to |
| 416 | */ |
| 417 | struct elementcxx . . $ element# * |
| 418 | md_check_castcxx . . $ md_check_cast(a56fd0223db04f6b).(struct elementcxx . . $ element# *el, int type) |
| 419 | { |
| 420 | |
| 421 | switch (type) { |
| 422 | case MD_TYPE_CONTAINERcxx . . $ `src/elements.h:251:9`!: |
| 423 | if (!iscontainercxx . . $ iscontainer(86b198a3a266d083).(el)) |
| 424 | exceptcxx . . $ except(af5967826b8ba103).(debugErrorcxx . . $ debugError., "Cast to container from %d", el->typecxx . . $ element#type.); |
| 425 | return el; |
| 426 | case MD_TYPE_ELEMENTcxx . . $ `src/elements.h:243:9`!: |
| 427 | /* Anything can be cast to an element */ |
| 428 | if (el->typecxx . . $ element#type. > 100 || el->typecxx . . $ element#type. < 0) |
| 429 | break; /* Sanity check */ |
| 430 | return el; |
| 431 | case MD_TYPE_METAcxx . . $ `src/elements.h:240:9`!: |
| 432 | case MD_TYPE_MAPcxx . . $ `src/elements.h:252:9`!: |
| 433 | /* TEMP: this is a parent type */ |
| 434 | return el; |
| 435 | case MD_TYPE_TRACKcxx . . $ `src/elements.h:248:9`!: |
| 436 | if (el->typecxx . . $ element#type. == MD_TYPE_TEMPOMAPcxx . . $ `src/elements.h:246:9`!) |
| 437 | return el; |
| 438 | break; |
| 439 | } |
| 440 | |
| 441 | if (type == el->typecxx . . $ element#type.) |
| 442 | return el; |
| 443 | |
| 444 | exceptcxx . . $ except(af5967826b8ba103).(debugErrorcxx . . $ debugError., "Cast from %d to %d not allowed", el->typecxx . . $ element#type., type); |
| 445 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!;/* not reached */ |
| 446 | |
| 447 | } |
| 448 |