eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-tarray.h
Go to the documentation of this file.
1
8#ifndef ELLIPSIS_TARRAY_H
9#define ELLIPSIS_TARRAY_H 1
10
11#include "ellipsis-token.h"
12
14
24inline
26 if (!__LOC_ID_0_1[0] + !__LOC_ID_0_2[0]) {
27 return !__LOC_ID_0_2[0] - !__LOC_ID_0_1[0];
28 }
29 return ellipsis‿str32‿compare(__LOC_ID_0_1[0]->contents, __LOC_ID_0_2[0]->contents);
30}
31
32#include <stddef.h>
33#include <string.h>
34#include <stdlib.h>
36
37extern thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic;
38extern thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic;
39extern thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic;
40
42
43#include <stdio.h>
44#include <stdlib.h>
45#include <stdint.h>
46
47#define STRINGIFY(...) STRINGIFY_(__VA_ARGS__)
48#define STRINGIFY_(...) #__VA_ARGS__
49
50#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...) \
51({\
52 static char const contract_format_ ## COUNT[] = \
53 __FILE__ ":" STRINGIFY(__LINE__) ": violation of " CTYPE " `" CSTR "`" __VA_OPT__(", ") __VA_ARGS__ "\n";\
54 (VERB \
55 ? fputs(contract_format_ ## COUNT, stderr) \
56 : 0);\
57 })
58
59#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
60(((false) || (COND)) \
61 ? (void)0 \
62 : (ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR __VA_OPT__(,) __VA_ARGS__) \
63 , ((false) \
64 ? (void)0 \
65 : ACTION())))
66
67#define ELLIPSIS_TO_VOIDS(...) ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))
68
69#define ELLIPSIS_TEST_ICE(...) (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)
70
71#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...) \
72 _Generic( \
73 ELLIPSIS_TEST_ICE(__VA_ARGS__), \
74 ellipsis‿contracts‿is_ice*: (__VA_ARGS__), \
75 default: true)
76
77#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...) \
78 ({\
79 static_assert(ELLIPSIS_CONTRACT_ICE_OR_TRUE(COND), \
80 "compile time violation of " CTYPE " " CSTR \
81 __VA_OPT__(", ") __VA_ARGS__ );\
82 })
83
84#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
85 \
86 do { \
87 _Generic( \
88 ELLIPSIS_TEST_ICE(COND), \
89 ellipsis‿contracts‿is_ice*: ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR __VA_OPT__(,) __VA_ARGS__), \
90 default: ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE __VA_OPT__(,) __VA_ARGS__));\
91 } while(false)
92
155#ifndef DOXYGEN_SPECIAL
156 union {
157#endif
163 size_t const length;
169 [[deprecated("use const member length instead")]]
171#ifndef DOXYGEN_SPECIAL
172 };
173#endif
180 size_t const capacity;
189};
190
191#define ELLIPSIS_TARRAY_OVERLAY(N) \
192 union {\
193 struct {\
194 size_t const length;\
195 size_t const padding;\
196 unsigned const :(offsetof(ellipsis‿token‿array, array)-2*sizeof(size_t));\
197 ellipsis‿token‿array‿base array[N];\
198 };\
199 ellipsis‿token‿array fa;\
200 }
201
202#define ELLIPSIS_TARRAY_STATIC(N, ...) \
203 (({\
204 static const ELLIPSIS_TARRAY_OVERLAY( \
205 sizeof((ellipsis‿token‿array‿base[]){__VA_ARGS__ }) \
206 /sizeof(ellipsis‿token‿array‿base)) \
207 __LOC_ID_1_1 = {\
208 .length = (N), \
209 .array = {__VA_ARGS__ }, \
210 };&__LOC_ID_1_1;})->fa)
211
232#if __clang__ && (__clang_major__ < 30)
233#define ELLIPSIS_TARRAY_LITERAL_LOCAL(N, ...) ELLIPSIS_TARRAY_STATIC(N, __VA_ARGS__)
234#else
235#define ELLIPSIS_TARRAY_LITERAL_LOCAL(N, ...) \
236 ((static const ELLIPSIS_TARRAY_OVERLAY( \
237 sizeof((ellipsis‿token‿array‿base[]){__VA_ARGS__ }) \
238 /sizeof(ellipsis‿token‿array‿base))) \
239 {\
240 .length = (N), \
241 .array = {__VA_ARGS__ }, \
242 }.fa)
243#endif
244
245#define ELLIPSIS_TARRAY_LITERAL_GLOBAL(N, ...) \
246 ((const ELLIPSIS_TARRAY_OVERLAY( \
247 sizeof((ellipsis‿token‿array‿base[]){__VA_ARGS__ }) \
248 /sizeof(ellipsis‿token‿array‿base))) \
249 {\
250 .length = (N), \
251 .array = {__VA_ARGS__ }, \
252 }.fa)
253
254#define ELLIPSIS_TARRAY_LITERAL ELLIPSIS_TARRAY_LITERAL_LOCAL
255
269
278inline void ellipsis‿token‿array‿move(ellipsis‿token‿array* __LOC_ID_0_3[restrict static 1], ellipsis‿token‿array**restrict __LOC_ID_0_4) {
279 if (*__LOC_ID_0_3)
280 ellipsis‿token‿array‿delete((void*)*__LOC_ID_0_3);
281 if (__LOC_ID_0_4) {
282 *__LOC_ID_0_3= *__LOC_ID_0_4;
283 *__LOC_ID_0_4= nullptr;
284 } else {
285 *__LOC_ID_0_3= nullptr;
286 }
287
288}
289
298inline void ellipsis‿token‿array‿cmove(ellipsis‿token‿array const* __LOC_ID_0_5[restrict static 1], ellipsis‿token‿array const**restrict __LOC_ID_0_6) {
299 if (*__LOC_ID_0_5)
300 ellipsis‿token‿array‿delete((void*)*__LOC_ID_0_5);
301 if (__LOC_ID_0_6) {
302 *__LOC_ID_0_5= *__LOC_ID_0_6;
303 *__LOC_ID_0_6= nullptr;
304 } else {
305 *__LOC_ID_0_5= nullptr;
306 }
307
308}
309
317GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
318inline
320 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
321 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
322 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
323 }
324 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
325 [[__maybe_unused__]] register bool defer_return_flag = false;
326 if (false) {
327 DEFER_ID_1_1:
328 goto DEFER_END_ID_1_2;
329 } else {
330 (void)0 ;
331 /* defer */
332 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
333 unsigned (*DEFER_LOC_ID_1_1)[DEFER_LOC_ID_0_2] = {};
334 if (false) {
335 DEFER_ID_1_2: {
336 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
337 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
338 {ELLIPSIS_CONTRACT(1, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when growing an FA array");}
339 }
340 goto DEFER_ID_1_1;
341 } else
342 (void)0 ;
344 do {
345 /* return mode 2 */
346 defer_return_flag = true;
347 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿alloc‿_Insta(len);
348 goto DEFER_ID_1_2;
349 } while(false);
350
351 goto DEFER_ID_1_2;
352 }
353[[__maybe_unused__]] DEFER_END_ID_1_2:;
354 return DEFER_LOC_ID_0_1;
355}
356
372GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
373inline
375 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
376 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
377 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
378 }
379 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
380 [[__maybe_unused__]] register bool defer_return_flag = false;
381 if (false) {
382 DEFER_ID_1_3:
383 goto DEFER_END_ID_1_4;
384 } else {
385 (void)0 ;
386 /* defer */
387 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
388 unsigned (*DEFER_LOC_ID_1_2)[DEFER_LOC_ID_0_2] = {};
389 if (false) {
390 DEFER_ID_1_4: {
391 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
392 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
393 {ELLIPSIS_CONTRACT(2, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when creating a one element FA array");}
394 }
395 goto DEFER_ID_1_3;
396 } else
397 (void)0 ;
398 do {ELLIPSIS_CONTRACT(3, !s || (s->length < s->capacity) || (s->capacity < SIZE_MAX), abort, true, "¬s ∨ (s→length < s→capacity) ∨ (s→capacity < SIZE_MAX)", "assertion", "FA array is a its limits");} while (false);
400 do {
401 /* return mode 2 */
402 defer_return_flag = true;
403 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿append‿_Insta(s, c);
404 goto DEFER_ID_1_4;
405 } while(false);
406
407 goto DEFER_ID_1_4;
408 }
409[[__maybe_unused__]] DEFER_END_ID_1_4:;
410 return DEFER_LOC_ID_0_1;
411}
412
420GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
421inline
423 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
424 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
425 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
426 }
427 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
428 [[__maybe_unused__]] register bool defer_return_flag = false;
429 if (false) {
430 DEFER_ID_1_5:
431 goto DEFER_END_ID_1_6;
432 } else {
433 (void)0 ;
434 /* defer */
435 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
436 unsigned (*DEFER_LOC_ID_1_3)[DEFER_LOC_ID_0_2] = {};
437 if (false) {
438 DEFER_ID_1_6: {
439 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
440 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
441 {ELLIPSIS_CONTRACT(4, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when concatenating two FA arrays");}
442 }
443 goto DEFER_ID_1_5;
444 } else
445 (void)0 ;
446 do {ELLIPSIS_CONTRACT(5, s && t, abort, true, "s ∧ t", "assertion", "argument FA arrays for concatenation must not be null");} while (false);
447 do {ELLIPSIS_CONTRACT(6, s->length <= (SIZE_MAX - t->length), abort, true, "s→length ≤ (SIZE_MAX − t→length)", "assertion", "concatenation of FA would be too long");} while (false);
449 do {
450 /* return mode 2 */
451 defer_return_flag = true;
452 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿concat‿_Insta(s, t);
453 goto DEFER_ID_1_6;
454 } while(false);
455
456 goto DEFER_ID_1_6;
457 }
458[[__maybe_unused__]] DEFER_END_ID_1_6:;
459 return DEFER_LOC_ID_0_1;
460}
461
490GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
491inline
493 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
494 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
495 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
496 }
497 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
498 [[__maybe_unused__]] register bool defer_return_flag = false;
499 if (false) {
500 DEFER_ID_1_7:
501 goto DEFER_END_ID_1_8;
502 } else {
503 (void)0 ;
504 /* defer */
505 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
506 unsigned (*DEFER_LOC_ID_1_4)[DEFER_LOC_ID_0_2] = {};
507 if (false) {
508 DEFER_ID_1_8: {
509 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
510 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
511 {ELLIPSIS_CONTRACT(7, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when growing an FA array");}
512 }
513 goto DEFER_ID_1_7;
514 } else
515 (void)0 ;
517 do {
518 /* return mode 2 */
519 defer_return_flag = true;
521 goto DEFER_ID_1_8;
522 } while(false);
523
524 goto DEFER_ID_1_8;
525 }
526[[__maybe_unused__]] DEFER_END_ID_1_8:;
527 return DEFER_LOC_ID_0_1;
528}
529
545GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
546inline
548 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
549 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
550 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
551 }
552 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
553 [[__maybe_unused__]] register bool defer_return_flag = false;
554 if (false) {
555 DEFER_ID_1_9:
556 goto DEFER_END_ID_1_10;
557 } else {
558 (void)0 ;
559 /* defer */
560 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
561 unsigned (*DEFER_LOC_ID_1_5)[DEFER_LOC_ID_0_2] = {};
562 if (false) {
563 DEFER_ID_1_10: {
564 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
565 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
566 {ELLIPSIS_CONTRACT(8, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when growing an FA array");}
567 }
568 goto DEFER_ID_1_9;
569 } else
570 (void)0 ;
571 do {ELLIPSIS_CONTRACT(9, !s || ((bool)((s)->capacity)), abort, true, "¬s ∨ ((bool)((s)→capacity))", "assertion", "flexible array object must be in allocated storage to be growable");} while (false);
572 do {ELLIPSIS_CONTRACT(10, !s || s->length < SIZE_MAX, abort, true, "¬s ∨ s→length < SIZE_MAX", "assertion", "FA array is a its limits");} while (false);
574 do {
575 /* return mode 2 */
576 defer_return_flag = true;
578 goto DEFER_ID_1_10;
579 } while(false);
580
581 goto DEFER_ID_1_10;
582 }
583[[__maybe_unused__]] DEFER_END_ID_1_10:;
584 return DEFER_LOC_ID_0_1;
585}
586
604GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
605inline
607 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
608 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
609 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
610 }
611 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
612 [[__maybe_unused__]] register bool defer_return_flag = false;
613 if (false) {
614 DEFER_ID_1_11:
615 goto DEFER_END_ID_1_12;
616 } else {
617 (void)0 ;
618 /* defer */
619 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
620 unsigned (*DEFER_LOC_ID_1_6)[DEFER_LOC_ID_0_2] = {};
621 if (false) {
622 DEFER_ID_1_12: {
623 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
624 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
625 {ELLIPSIS_CONTRACT(11, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when shrinking an FA array");}
626 }
627 goto DEFER_ID_1_11;
628 } else
629 (void)0 ;
630 do {ELLIPSIS_CONTRACT(12, s, abort, true, "s", "assertion", "can only shrink existing array");} while (false);
631 do {ELLIPSIS_CONTRACT(13, ((bool)((s)->capacity)), abort, true, "((bool)((s)→capacity))", "assertion", "flexible array object must be in allocated storage to be shrinkable");} while (false);
632 do {ELLIPSIS_CONTRACT(14, length <= s->length, abort, true, "length ≤ s→length", "assertion", "can\'t shrink array to make it longer");} while (false);
634 do {
635 /* return mode 2 */
636 defer_return_flag = true;
638 goto DEFER_ID_1_12;
639 } while(false);
640
641 goto DEFER_ID_1_12;
642 }
643[[__maybe_unused__]] DEFER_END_ID_1_12:;
644 return DEFER_LOC_ID_0_1;
645}
646
655GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
656inline
658 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
659 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
660 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
661 }
662 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
663 [[__maybe_unused__]] register bool defer_return_flag = false;
664 if (false) {
665 DEFER_ID_1_13:
666 goto DEFER_END_ID_1_14;
667 } else {
668 (void)0 ;
669 do {ELLIPSIS_CONTRACT(15, s, abort, true, "s", "assertion", "substring from non-existing string");} while (false);
670 do {ELLIPSIS_CONTRACT(16, pos < s->length, abort, true, "pos < s→length", "assertion", "start of substring is out of bounds");} while (false);
671 /* defer */
672 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
673 unsigned (*DEFER_LOC_ID_1_7)[DEFER_LOC_ID_0_2] = {};
674 if (false) {
675 DEFER_ID_1_14: {
676 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
677 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
678 {ELLIPSIS_CONTRACT(17, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "out of memory when growing an FA array");}
679 }
680 goto DEFER_ID_1_13;
681 } else
682 (void)0 ;
684 do {
685 /* return mode 2 */
686 defer_return_flag = true;
687 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿sub‿_Insta(s, pos, len);
688 goto DEFER_ID_1_14;
689 } while(false);
690
691 goto DEFER_ID_1_14;
692 }
693[[__maybe_unused__]] DEFER_END_ID_1_14:;
694 return DEFER_LOC_ID_0_1;
695}
696
708GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
709inline
711 typeof(ellipsis‿token‿array const*) DEFER_LOC_ID_0_1;
712 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
713 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array const*)) {};
714 }
715 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
716 [[__maybe_unused__]] register bool defer_return_flag = false;
717 if (false) {
718 DEFER_ID_1_15:
719 goto DEFER_END_ID_1_16;
720 } else {
721 (void)0 ;
722 do {ELLIPSIS_CONTRACT(18, s, abort, true, "s", "assertion", "copy of non-existing string");} while (false);
723 /* defer */
724 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
725 unsigned (*DEFER_LOC_ID_1_8)[DEFER_LOC_ID_0_2] = {};
726 if (false) {
727 DEFER_ID_1_16: {
728 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
729 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
730 {ELLIPSIS_CONTRACT(19, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), unreachable, false, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assumption", "copy operation failed");}
731 }
732 goto DEFER_ID_1_15;
733 } else
734 (void)0 ;
736 do {
737 /* return mode 2 */
738 defer_return_flag = true;
740 goto DEFER_ID_1_16;
741 } while(false);
742
743 goto DEFER_ID_1_16;
744 }
745[[__maybe_unused__]] DEFER_END_ID_1_16:;
746 return DEFER_LOC_ID_0_1;
747}
748
756GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
757inline
759 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
760 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
761 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
762 }
763 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
764 [[__maybe_unused__]] register bool defer_return_flag = false;
765 if (false) {
766 DEFER_ID_1_17:
767 goto DEFER_END_ID_1_18;
768 } else {
769 (void)0 ;
770 /* defer */
771 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
772 unsigned (*DEFER_LOC_ID_1_9)[DEFER_LOC_ID_0_2] = {};
773 if (false) {
774 DEFER_ID_1_18: {
775 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
776 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
777 {ELLIPSIS_CONTRACT(20, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when growing an FA array");}
778 }
779 goto DEFER_ID_1_17;
780 } else
781 (void)0 ;
783 do {
784 /* return mode 2 */
785 defer_return_flag = true;
786 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿alloc‿_Inner(len);
787 goto DEFER_ID_1_18;
788 } while(false);
789
790 goto DEFER_ID_1_18;
791 }
792[[__maybe_unused__]] DEFER_END_ID_1_18:;
793 return DEFER_LOC_ID_0_1;
794}
795
811GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
812inline
814 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
815 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
816 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
817 }
818 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
819 [[__maybe_unused__]] register bool defer_return_flag = false;
820 if (false) {
821 DEFER_ID_1_19:
822 goto DEFER_END_ID_1_20;
823 } else {
824 (void)0 ;
825 /* defer */
826 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
827 unsigned (*DEFER_LOC_ID_1_10)[DEFER_LOC_ID_0_2] = {};
828 if (false) {
829 DEFER_ID_1_20: {
830 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
831 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
832 {ELLIPSIS_CONTRACT(21, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when creating a one element FA array");}
833 }
834 goto DEFER_ID_1_19;
835 } else
836 (void)0 ;
837 do {ELLIPSIS_CONTRACT(22, !s || (s->length < s->capacity) || (s->capacity < SIZE_MAX), unreachable, false, "¬s ∨ (s→length < s→capacity) ∨ (s→capacity < SIZE_MAX)", "assumption", "FA array is a its limits");} while (false);
839 do {
840 /* return mode 2 */
841 defer_return_flag = true;
842 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿append‿_Inner(s, c);
843 goto DEFER_ID_1_20;
844 } while(false);
845
846 goto DEFER_ID_1_20;
847 }
848[[__maybe_unused__]] DEFER_END_ID_1_20:;
849 return DEFER_LOC_ID_0_1;
850}
851
859GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
860inline
862 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
863 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
864 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
865 }
866 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
867 [[__maybe_unused__]] register bool defer_return_flag = false;
868 if (false) {
869 DEFER_ID_1_21:
870 goto DEFER_END_ID_1_22;
871 } else {
872 (void)0 ;
873 /* defer */
874 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
875 unsigned (*DEFER_LOC_ID_1_11)[DEFER_LOC_ID_0_2] = {};
876 if (false) {
877 DEFER_ID_1_22: {
878 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
879 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
880 {ELLIPSIS_CONTRACT(23, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when concatenating two FA arrays");}
881 }
882 goto DEFER_ID_1_21;
883 } else
884 (void)0 ;
885 do {ELLIPSIS_CONTRACT(24, s && t, unreachable, false, "s ∧ t", "assumption", "argument FA arrays for concatenation must not be null");} while (false);
886 do {ELLIPSIS_CONTRACT(25, s->length <= (SIZE_MAX - t->length), unreachable, false, "s→length ≤ (SIZE_MAX − t→length)", "assumption", "concatenation of FA would be too long");} while (false);
888 do {
889 /* return mode 2 */
890 defer_return_flag = true;
891 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿concat‿_Inner(s, t);
892 goto DEFER_ID_1_22;
893 } while(false);
894
895 goto DEFER_ID_1_22;
896 }
897[[__maybe_unused__]] DEFER_END_ID_1_22:;
898 return DEFER_LOC_ID_0_1;
899}
900
929GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
930inline
932 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
933 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
934 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
935 }
936 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
937 [[__maybe_unused__]] register bool defer_return_flag = false;
938 if (false) {
939 DEFER_ID_1_23:
940 goto DEFER_END_ID_1_24;
941 } else {
942 (void)0 ;
943 /* defer */
944 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
945 unsigned (*DEFER_LOC_ID_1_12)[DEFER_LOC_ID_0_2] = {};
946 if (false) {
947 DEFER_ID_1_24: {
948 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
949 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
950 {ELLIPSIS_CONTRACT(26, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when growing an FA array");}
951 }
952 goto DEFER_ID_1_23;
953 } else
954 (void)0 ;
956 do {
957 /* return mode 2 */
958 defer_return_flag = true;
960 goto DEFER_ID_1_24;
961 } while(false);
962
963 goto DEFER_ID_1_24;
964 }
965[[__maybe_unused__]] DEFER_END_ID_1_24:;
966 return DEFER_LOC_ID_0_1;
967}
968
984GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
985inline
987 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
988 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
989 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
990 }
991 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
992 [[__maybe_unused__]] register bool defer_return_flag = false;
993 if (false) {
994 DEFER_ID_1_25:
995 goto DEFER_END_ID_1_26;
996 } else {
997 (void)0 ;
998 /* defer */
999 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1000 unsigned (*DEFER_LOC_ID_1_13)[DEFER_LOC_ID_0_2] = {};
1001 if (false) {
1002 DEFER_ID_1_26: {
1003 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1004 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1005 {ELLIPSIS_CONTRACT(27, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when growing an FA array");}
1006 }
1007 goto DEFER_ID_1_25;
1008 } else
1009 (void)0 ;
1010 do {ELLIPSIS_CONTRACT(28, !s || ((bool)((s)->capacity)), unreachable, false, "¬s ∨ ((bool)((s)→capacity))", "assumption", "flexible array object must be in allocated storage to be growable");} while (false);
1011 do {ELLIPSIS_CONTRACT(29, !s || s->length < SIZE_MAX, unreachable, false, "¬s ∨ s→length < SIZE_MAX", "assumption", "FA array is a its limits");} while (false);
1013 do {
1014 /* return mode 2 */
1015 defer_return_flag = true;
1016 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿grow‿_Inner(s, length);
1017 goto DEFER_ID_1_26;
1018 } while(false);
1019
1020 goto DEFER_ID_1_26;
1021 }
1022[[__maybe_unused__]] DEFER_END_ID_1_26:;
1023 return DEFER_LOC_ID_0_1;
1024}
1025
1043GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
1044inline
1046 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
1047 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1048 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
1049 }
1050 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1051 [[__maybe_unused__]] register bool defer_return_flag = false;
1052 if (false) {
1053 DEFER_ID_1_27:
1054 goto DEFER_END_ID_1_28;
1055 } else {
1056 (void)0 ;
1057 /* defer */
1058 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1059 unsigned (*DEFER_LOC_ID_1_14)[DEFER_LOC_ID_0_2] = {};
1060 if (false) {
1061 DEFER_ID_1_28: {
1062 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1063 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1064 {ELLIPSIS_CONTRACT(30, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when shrinking an FA array");}
1065 }
1066 goto DEFER_ID_1_27;
1067 } else
1068 (void)0 ;
1069 do {ELLIPSIS_CONTRACT(31, s, unreachable, false, "s", "assumption", "can only shrink existing array");} while (false);
1070 do {ELLIPSIS_CONTRACT(32, ((bool)((s)->capacity)), unreachable, false, "((bool)((s)→capacity))", "assumption", "flexible array object must be in allocated storage to be shrinkable");} while (false);
1071 do {ELLIPSIS_CONTRACT(33, length <= s->length, unreachable, false, "length ≤ s→length", "assumption", "can\'t shrink array to make it longer");} while (false);
1073 do {
1074 /* return mode 2 */
1075 defer_return_flag = true;
1077 goto DEFER_ID_1_28;
1078 } while(false);
1079
1080 goto DEFER_ID_1_28;
1081 }
1082[[__maybe_unused__]] DEFER_END_ID_1_28:;
1083 return DEFER_LOC_ID_0_1;
1084}
1085
1094GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
1095inline
1097 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
1098 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1099 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
1100 }
1101 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1102 [[__maybe_unused__]] register bool defer_return_flag = false;
1103 if (false) {
1104 DEFER_ID_1_29:
1105 goto DEFER_END_ID_1_30;
1106 } else {
1107 (void)0 ;
1108 do {ELLIPSIS_CONTRACT(34, s, unreachable, false, "s", "assumption", "substring from non-existing string");} while (false);
1109 do {ELLIPSIS_CONTRACT(35, pos < s->length, unreachable, false, "pos < s→length", "assumption", "start of substring is out of bounds");} while (false);
1110 /* defer */
1111 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1112 unsigned (*DEFER_LOC_ID_1_15)[DEFER_LOC_ID_0_2] = {};
1113 if (false) {
1114 DEFER_ID_1_30: {
1115 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1116 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1117 {ELLIPSIS_CONTRACT(36, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "out of memory when growing an FA array");}
1118 }
1119 goto DEFER_ID_1_29;
1120 } else
1121 (void)0 ;
1123 do {
1124 /* return mode 2 */
1125 defer_return_flag = true;
1126 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿sub‿_Inner(s, pos, len);
1127 goto DEFER_ID_1_30;
1128 } while(false);
1129
1130 goto DEFER_ID_1_30;
1131 }
1132[[__maybe_unused__]] DEFER_END_ID_1_30:;
1133 return DEFER_LOC_ID_0_1;
1134}
1135
1147GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
1148inline
1150 typeof(ellipsis‿token‿array const*) DEFER_LOC_ID_0_1;
1151 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1152 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array const*)) {};
1153 }
1154 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1155 [[__maybe_unused__]] register bool defer_return_flag = false;
1156 if (false) {
1157 DEFER_ID_1_31:
1158 goto DEFER_END_ID_1_32;
1159 } else {
1160 (void)0 ;
1161 do {ELLIPSIS_CONTRACT(37, s, unreachable, false, "s", "assumption", "copy of non-existing string");} while (false);
1162 /* defer */
1163 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1164 unsigned (*DEFER_LOC_ID_1_16)[DEFER_LOC_ID_0_2] = {};
1165 if (false) {
1166 DEFER_ID_1_32: {
1167 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1168 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1169 {ELLIPSIS_CONTRACT(38, ((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1), abort, true, "((typeof(DEFER_LOC_ID_0_1))DEFER_LOC_ID_0_1)", "assertion", "copy operation failed");}
1170 }
1171 goto DEFER_ID_1_31;
1172 } else
1173 (void)0 ;
1175 do {
1176 /* return mode 2 */
1177 defer_return_flag = true;
1179 goto DEFER_ID_1_32;
1180 } while(false);
1181
1182 goto DEFER_ID_1_32;
1183 }
1184[[__maybe_unused__]] DEFER_END_ID_1_32:;
1185 return DEFER_LOC_ID_0_1;
1186}
1187
1201GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns") ellipsis‿token‿array* ellipsis‿token‿array‿remove(ellipsis‿token‿array s[restrict static 1], size_t);
1202
1213inline
1215 memset(_ar, 0, _n*sizeof(_ar[0]));
1216}
1217
1228
1237GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷token∷array" " need to keep pointer returns")
1238inline
1240 typeof(ellipsis‿token‿array*) DEFER_LOC_ID_0_1;
1241 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1242 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿token‿array*)) {};
1243 }
1244 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1245 [[__maybe_unused__]] register bool defer_return_flag = false;
1246 if (false) {
1247 DEFER_ID_1_33:
1248 goto DEFER_END_ID_1_34;
1249 } else {
1250 (void)0 ;
1251 ELLIPSIS_CONTRACT(39, __LOC_ID_0_7, abort, true, "__LOC(0, 1)", "precondition", "copy of non-existing string");
1252 do {
1253 /* return mode 2 */
1254 defer_return_flag = true;
1255 DEFER_LOC_ID_0_1 = ellipsis‿token‿array‿sub(__LOC_ID_0_7, 0, __LOC_ID_0_7->length);
1256 goto DEFER_ID_1_33;
1257 } while(false);
1258
1259 goto DEFER_ID_1_33;
1260 }
1261[[__maybe_unused__]] DEFER_END_ID_1_34:;
1262 return DEFER_LOC_ID_0_1;
1263}
1264
1268inline
1269int ellipsis‿token‿array‿compareInternal(void const* A, void const* B) {
1273}
1274
1287inline
1289 extern void (qsort)(void*, size_t, size_t, int (*)(const void*, const void*));
1290 if (offs < p->length) {
1291 size_t rlen = p->length - offs;
1292 if (rlen < len) len = rlen;
1293 if (len > 1) {
1295 }
1296 }
1297}
1298
1307inline
1309 extern void* (bsearch)(void const*, void const*, size_t, size_t, int (*)(const void*, const void*));
1310 if (offs < p->length) {
1311 size_t rlen = p->length - offs;
1312 if (rlen < len) len = rlen;
1313 if (len > 0) {
1314 return bsearch((void const*)el, (void const*)(p->array+offs), len, sizeof(ellipsis‿token‿array‿base), ellipsis‿token‿array‿compareInternal);
1315 }
1316 }
1317 return nullptr;
1318}
1319
1320#endif
#define GNU_ATTR_COUNTED_BY(...)
Definition ellipsis-error.h:59
#define STDC_ATTR_NODISCARD(...)
Definition ellipsis-error.h:68
#define GNU_ATTR_STRICT_FLEX_ARRAY(...)
Definition ellipsis-error.h:54
#define GNU_ATTR_RETURNS_NONNULL
Definition ellipsis-error.h:34
struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice
Definition ellipsis-expression.c:24
int ellipsis‿str32‿compare(ellipsis‿str32 const *s, ellipsis‿str32 const *t)
Definition ellipsis-str32.c:129
ellipsis‿token‿array const * ellipsis‿token‿array‿cpy_const‿_Inner(ellipsis‿token‿array const *restrict s)
Definition ellipsis-tarray.c:257
ellipsis‿token‿array * ellipsis‿token‿array‿alloc‿_Inner(size_t len)
Definition ellipsis-tarray.c:147
ellipsis‿token‿array * ellipsis‿token‿array‿concat‿_Inner(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Definition ellipsis-tarray.c:168
ellipsis‿token‿array * ellipsis‿token‿array‿grow‿_Inner(ellipsis‿token‿array *restrict s, size_t length)
Definition ellipsis-tarray.c:202
ellipsis‿token‿array * ellipsis‿token‿array‿append‿_Inner(ellipsis‿token‿array *restrict s, s->array[0] c)
Definition ellipsis-tarray.c:159
ellipsis‿token‿array * ellipsis‿token‿array‿concat_inplace‿_Inner(ellipsis‿token‿array const *s0, ellipsis‿token‿array const *t)
Definition ellipsis-tarray.c:183
ellipsis‿token‿array * ellipsis‿token‿array‿shrink‿_Inner(ellipsis‿token‿array s[restrict static 1], size_t length)
Definition ellipsis-tarray.c:228
ellipsis‿token‿array * ellipsis‿token‿array‿sub‿_Inner(ellipsis‿token‿array const *s, size_t pos, size_t len)
Definition ellipsis-tarray.c:240
thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic
#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-tarray.h:84
ellipsis‿token * ellipsis‿token‿array‿base
Definition ellipsis-tarray.h:13
thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic
thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic
A token element as recognized during processing.
Definition ellipsis-token.h:94
A structure with a flexible array member of base type ellipsis‿token‿array‿base.
Definition ellipsis-tarray.h:154
ellipsis‿token‿array * ellipsis‿token‿array‿concat‿_Insta(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one.
Definition ellipsis-tarray.c:353
ellipsis‿token‿array * ellipsis‿token‿array‿grow‿_Ctra(ellipsis‿token‿array *restrict s, size_t length)
Grow the ellipsis‿token‿array to (at least) the indicated amount of elements return a new one and del...
Definition ellipsis-tarray.h:986
ellipsis‿token‿array * ellipsis‿token‿array‿concat‿_Ctra(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one.
Definition ellipsis-tarray.h:861
ellipsis‿token‿array * ellipsis‿token‿array‿cpy(ellipsis‿token‿array const *restrict __LOC_ID_0_7)
Allocate a ellipsis‿token‿array and copy the data to which the parameter points into it.
Definition ellipsis-tarray.h:1239
size_t const length
Current length of this instance.
Definition ellipsis-tarray.h:163
ellipsis‿token‿array * ellipsis‿token‿array‿alloc‿_Ctra(size_t len)
Allocate a ellipsis‿token‿array with elements as given by the parameter.
Definition ellipsis-tarray.h:758
void ellipsis‿token‿array‿cmove(ellipsis‿token‿array const *__LOC_ID_0_5[restrict static 1], ellipsis‿token‿array const **restrict __LOC_ID_0_6)
Move a ellipsis‿token‿array const pointed to by the second parameter to the one pointed to by the fir...
Definition ellipsis-tarray.h:298
size_t length_mod
Modifiable length of this instance.
Definition ellipsis-tarray.h:170
ellipsis‿token‿array * ellipsis‿token‿array‿concat_inplace‿_Ctra(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one and delete s.
Definition ellipsis-tarray.h:931
ellipsis‿token‿array * ellipsis‿token‿array‿append‿_Insta(ellipsis‿token‿array *restrict s, ellipsis‿token‿array‿base c)
Append a new element to a ellipsis‿token‿array and return a new object.
Definition ellipsis-tarray.c:316
ellipsis‿token‿array * ellipsis‿token‿array‿sub‿_Insta(ellipsis‿token‿array const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿token‿array with len elements and copy the data from *s at position pos onward.
Definition ellipsis-tarray.c:544
ellipsis‿token‿array * ellipsis‿token‿array‿remove(ellipsis‿token‿array s[restrict static 1], size_t)
Remove (at most) the indicated amount of elements from the ellipsis‿token‿array return a new one and ...
Definition ellipsis-tarray.c:108
int ellipsis‿token‿array‿base‿compare(ellipsis‿token‿array‿base const *__LOC_ID_0_1, ellipsis‿token‿array‿base const *__LOC_ID_0_2)
compare the pointed-to tokens
Definition ellipsis-tarray.h:25
ellipsis‿token‿array * ellipsis‿token‿array‿grow(ellipsis‿token‿array *restrict s, size_t length)
Grow the ellipsis‿token‿array to (at least) the indicated amount of elements return a new one and del...
Definition ellipsis-tarray.h:547
ellipsis‿token‿array * ellipsis‿token‿array‿sub(ellipsis‿token‿array const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿token‿array with len elements and copy the data from *s at position pos onward.
Definition ellipsis-tarray.h:657
ellipsis‿token‿array * ellipsis‿token‿array‿alloc(size_t len)
Allocate a ellipsis‿token‿array with elements as given by the parameter.
Definition ellipsis-tarray.h:319
ellipsis‿token‿array * ellipsis‿token‿array‿append(ellipsis‿token‿array *restrict s, ellipsis‿token‿array‿base c)
Append a new element to a ellipsis‿token‿array and return a new object.
Definition ellipsis-tarray.h:374
ellipsis‿token‿array * ellipsis‿token‿array‿grow‿_Insta(ellipsis‿token‿array *restrict s, size_t length)
Grow the ellipsis‿token‿array to (at least) the indicated amount of elements return a new one and del...
Definition ellipsis-tarray.c:456
ellipsis‿token‿array * ellipsis‿token‿array‿append‿_Ctra(ellipsis‿token‿array *restrict s, ellipsis‿token‿array‿base c)
Append a new element to a ellipsis‿token‿array and return a new object.
Definition ellipsis-tarray.h:813
void ellipsis‿token‿array‿sort(ellipsis‿token‿array *p, size_t offs, size_t len)
sort a ellipsis‿token‿array in place.
Definition ellipsis-tarray.h:1288
ellipsis‿token‿array * ellipsis‿token‿array‿concat_inplace(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one and delete s.
Definition ellipsis-tarray.h:492
ellipsis‿token‿array const * ellipsis‿token‿array‿cpy_const(ellipsis‿token‿array const *restrict s)
Copy or link to a const-qualified ellipsis‿token‿array.
Definition ellipsis-tarray.h:710
ellipsis‿token‿array * ellipsis‿token‿array‿shrink‿_Insta(ellipsis‿token‿array s[restrict static 1], size_t length)
Shrink the ellipsis‿token‿array to exactly the indicated amount of elements return a new one and dele...
Definition ellipsis-tarray.c:504
ellipsis‿token‿array * ellipsis‿token‿array‿alloc‿_Insta(size_t len)
Allocate a ellipsis‿token‿array with elements as given by the parameter.
Definition ellipsis-tarray.c:272
ellipsis‿token‿array * ellipsis‿token‿array‿concat(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one.
Definition ellipsis-tarray.h:422
int ellipsis‿token‿array‿compareInternal(void const *A, void const *B)
Definition ellipsis-tarray.h:1269
size_t const capacity
Maximal length of this instance.
Definition ellipsis-tarray.h:180
ellipsis‿token‿array‿base const * ellipsis‿token‿array‿search(ellipsis‿token‿array‿base const el[static 1], ellipsis‿token‿array const *p, size_t offs, size_t len)
search for an element in a ellipsis‿token‿array
Definition ellipsis-tarray.h:1308
ellipsis‿token‿array‿base array[]
The current data array.
Definition ellipsis-tarray.h:188
ellipsis‿token‿array * ellipsis‿token‿array‿concat_inplace‿_Insta(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Concatenate two ellipsis‿token‿array into a new one and delete s.
Definition ellipsis-tarray.c:412
ellipsis‿token‿array * ellipsis‿token‿array‿shrink‿_Ctra(ellipsis‿token‿array s[restrict static 1], size_t length)
Shrink the ellipsis‿token‿array to exactly the indicated amount of elements return a new one and dele...
Definition ellipsis-tarray.h:1045
ellipsis‿token‿array const * ellipsis‿token‿array‿cpy_const‿_Insta(ellipsis‿token‿array const *restrict s)
Copy or link to a const-qualified ellipsis‿token‿array.
Definition ellipsis-tarray.c:586
ellipsis‿token‿array * ellipsis‿token‿array‿sub‿_Ctra(ellipsis‿token‿array const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿token‿array with len elements and copy the data from *s at position pos onward.
Definition ellipsis-tarray.h:1096
void ellipsis‿token‿array‿delete(ellipsis‿token‿array const *)
Delete a ellipsis‿token‿array pointed to by the parameter.
Definition ellipsis-tarray.c:615
ellipsis‿token‿array * ellipsis‿token‿array‿shrink(ellipsis‿token‿array s[restrict static 1], size_t length)
Shrink the ellipsis‿token‿array to exactly the indicated amount of elements return a new one and dele...
Definition ellipsis-tarray.h:606
void ellipsis‿token‿array‿move(ellipsis‿token‿array *__LOC_ID_0_3[restrict static 1], ellipsis‿token‿array **restrict __LOC_ID_0_4)
Move a ellipsis‿token‿array pointed to by the second parameter to the one pointed to by the first.
Definition ellipsis-tarray.h:278
ellipsis‿token‿array const * ellipsis‿token‿array‿cpy_const‿_Ctra(ellipsis‿token‿array const *restrict s)
Copy or link to a const-qualified ellipsis‿token‿array.
Definition ellipsis-tarray.h:1149
void ellipsis‿token‿array‿base‿destroy(size_t _n, ellipsis‿token‿array‿base _ar[static _n])
Destroy an element of type ellipsis‿token‿array‿base.
Definition ellipsis-tarray.h:1214
int ellipsis‿token‿array‿compare(ellipsis‿token‿array const *s, ellipsis‿token‿array const *t)
Compare two arrays lexicographically.
Definition ellipsis-tarray.c:119