eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-carray.h
Go to the documentation of this file.
1
8#ifndef ELLIPSIS_CARRAY_H
9#define ELLIPSIS_CARRAY_H 1
10
11#include <stdlib.h>
12#include <string.h>
13#include <stdio.h>
14
25typedef char const* ellipsis‿carray‿base;
26
31inline void ellipsis‿carray‿base‿destroy(size_t __LOC_ID_0_1, ellipsis‿carray‿base const __LOC_ID_0_2[__LOC_ID_0_1]) {
32 for (size_t __LOC_ID_1_1 = 0; __LOC_ID_1_1 < __LOC_ID_0_1; ++__LOC_ID_1_1) {
33 free((void*)__LOC_ID_0_2[__LOC_ID_1_1]);
34 }
35 memset((void*)__LOC_ID_0_2, 0, __LOC_ID_0_1*sizeof(__LOC_ID_0_2[0]));
36}
37
41inline
42int ellipsis‿carray‿base‿compare(ellipsis‿carray‿base const __LOC_ID_0_3[static 1], ellipsis‿carray‿base const __LOC_ID_0_4[static 1]) {
43 register int __LOC_ID_1_2;
44 if (__LOC_ID_0_3[0]) {
45 if (__LOC_ID_0_4[0]) {
46 __LOC_ID_1_2 = strcmp(__LOC_ID_0_3[0], __LOC_ID_0_4[0]);
47 } else {
48 __LOC_ID_1_2 = -1;
49 }
50 } else {
51 if (__LOC_ID_0_4[0]) {
52 __LOC_ID_1_2 = +1;
53 } else {
54 __LOC_ID_1_2 = 0;
55 }
56 }
57 return __LOC_ID_1_2;
58}
59
60#include <stddef.h>
61#include <string.h>
62#include <stdlib.h>
64
65extern thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic;
66extern thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic;
67extern thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic;
68
70
71#include <stdio.h>
72#include <stdlib.h>
73#include <stdint.h>
74
75#define STRINGIFY(...) STRINGIFY_(__VA_ARGS__)
76#define STRINGIFY_(...) #__VA_ARGS__
77
78#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...) \
79({\
80 static char const contract_format_ ## COUNT[] = \
81 __FILE__ ":" STRINGIFY(__LINE__) ": violation of " CTYPE " `" CSTR "`" __VA_OPT__(", ") __VA_ARGS__ "\n";\
82 (VERB \
83 ? fputs(contract_format_ ## COUNT, stderr) \
84 : 0);\
85 })
86
87#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
88(((false) || (COND)) \
89 ? (void)0 \
90 : (ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR __VA_OPT__(,) __VA_ARGS__) \
91 , ((false) \
92 ? (void)0 \
93 : ACTION())))
94
95#define ELLIPSIS_TO_VOIDS(...) ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))
96
97#define ELLIPSIS_TEST_ICE(...) (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)
98
99#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...) \
100 _Generic( \
101 ELLIPSIS_TEST_ICE(__VA_ARGS__), \
102 ellipsis‿contracts‿is_ice*: (__VA_ARGS__), \
103 default: true)
104
105#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...) \
106 ({\
107 static_assert(ELLIPSIS_CONTRACT_ICE_OR_TRUE(COND), \
108 "compile time violation of " CTYPE " " CSTR \
109 __VA_OPT__(", ") __VA_ARGS__ );\
110 })
111
112#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
113 \
114 do { \
115 _Generic( \
116 ELLIPSIS_TEST_ICE(COND), \
117 ellipsis‿contracts‿is_ice*: ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR __VA_OPT__(,) __VA_ARGS__), \
118 default: ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE __VA_OPT__(,) __VA_ARGS__));\
119 } while(false)
120
183#ifndef DOXYGEN_SPECIAL
184 union {
185#endif
191 size_t const length;
197 [[deprecated("use const member length instead")]]
199#ifndef DOXYGEN_SPECIAL
200 };
201#endif
208 size_t const capacity;
217};
218
219#define ELLIPSIS_CARRAY_OVERLAY(N) \
220 union {\
221 struct {\
222 size_t const length;\
223 size_t const padding;\
224 unsigned const :(offsetof(ellipsis‿carray, array)-2*sizeof(size_t));\
225 ellipsis‿carray‿base array[N];\
226 };\
227 ellipsis‿carray fa;\
228 }
229
230#define ELLIPSIS_CARRAY_STATIC(N, ...) \
231 (({\
232 static const ELLIPSIS_CARRAY_OVERLAY( \
233 sizeof((ellipsis‿carray‿base[]){__VA_ARGS__ }) \
234 /sizeof(ellipsis‿carray‿base)) \
235 __LOC_ID_1_3 = {\
236 .length = (N), \
237 .array = {__VA_ARGS__ }, \
238 };&__LOC_ID_1_3;})->fa)
239
260#if __clang__ && (__clang_major__ < 30)
261#define ELLIPSIS_CARRAY_LITERAL_LOCAL(N, ...) ELLIPSIS_CARRAY_STATIC(N, __VA_ARGS__)
262#else
263#define ELLIPSIS_CARRAY_LITERAL_LOCAL(N, ...) \
264 ((static const ELLIPSIS_CARRAY_OVERLAY( \
265 sizeof((ellipsis‿carray‿base[]){__VA_ARGS__ }) \
266 /sizeof(ellipsis‿carray‿base))) \
267 {\
268 .length = (N), \
269 .array = {__VA_ARGS__ }, \
270 }.fa)
271#endif
272
273#define ELLIPSIS_CARRAY_LITERAL_GLOBAL(N, ...) \
274 ((const ELLIPSIS_CARRAY_OVERLAY( \
275 sizeof((ellipsis‿carray‿base[]){__VA_ARGS__ }) \
276 /sizeof(ellipsis‿carray‿base))) \
277 {\
278 .length = (N), \
279 .array = {__VA_ARGS__ }, \
280 }.fa)
281
282#define ELLIPSIS_CARRAY_LITERAL ELLIPSIS_CARRAY_LITERAL_LOCAL
283
297
306inline void ellipsis‿carray‿move(ellipsis‿carray* __LOC_ID_0_5[restrict static 1], ellipsis‿carray**restrict __LOC_ID_0_6) {
307 if (*__LOC_ID_0_5)
308 ellipsis‿carray‿delete((void*)*__LOC_ID_0_5);
309 if (__LOC_ID_0_6) {
310 *__LOC_ID_0_5= *__LOC_ID_0_6;
311 *__LOC_ID_0_6= nullptr;
312 } else {
313 *__LOC_ID_0_5= nullptr;
314 }
315
316}
317
326inline void ellipsis‿carray‿cmove(ellipsis‿carray const* __LOC_ID_0_7[restrict static 1], ellipsis‿carray const**restrict __LOC_ID_0_8) {
327 if (*__LOC_ID_0_7)
328 ellipsis‿carray‿delete((void*)*__LOC_ID_0_7);
329 if (__LOC_ID_0_8) {
330 *__LOC_ID_0_7= *__LOC_ID_0_8;
331 *__LOC_ID_0_8= nullptr;
332 } else {
333 *__LOC_ID_0_7= nullptr;
334 }
335
336}
337
345GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
346inline
348 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
349 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
350 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
351 }
352 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
353 [[__maybe_unused__]] register bool defer_return_flag = false;
354 if (false) {
355 DEFER_ID_1_1:
356 goto DEFER_END_ID_1_2;
357 } else {
358 (void)0 ;
359 /* defer */
360 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
361 unsigned (*DEFER_LOC_ID_1_1)[DEFER_LOC_ID_0_2] = {};
362 if (false) {
363 DEFER_ID_1_2: {
364 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
365 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
366 {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");}
367 }
368 goto DEFER_ID_1_1;
369 } else
370 (void)0 ;
372 do {
373 /* return mode 2 */
374 defer_return_flag = true;
375 DEFER_LOC_ID_0_1 = ellipsis‿carray‿alloc‿_Insta(len);
376 goto DEFER_ID_1_2;
377 } while(false);
378
379 goto DEFER_ID_1_2;
380 }
381[[__maybe_unused__]] DEFER_END_ID_1_2:;
382 return DEFER_LOC_ID_0_1;
383}
384
400GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
401inline
403 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
404 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
405 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
406 }
407 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
408 [[__maybe_unused__]] register bool defer_return_flag = false;
409 if (false) {
410 DEFER_ID_1_3:
411 goto DEFER_END_ID_1_4;
412 } else {
413 (void)0 ;
414 /* defer */
415 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
416 unsigned (*DEFER_LOC_ID_1_2)[DEFER_LOC_ID_0_2] = {};
417 if (false) {
418 DEFER_ID_1_4: {
419 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
420 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
421 {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");}
422 }
423 goto DEFER_ID_1_3;
424 } else
425 (void)0 ;
426 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);
428 do {
429 /* return mode 2 */
430 defer_return_flag = true;
431 DEFER_LOC_ID_0_1 = ellipsis‿carray‿append‿_Insta(s, c);
432 goto DEFER_ID_1_4;
433 } while(false);
434
435 goto DEFER_ID_1_4;
436 }
437[[__maybe_unused__]] DEFER_END_ID_1_4:;
438 return DEFER_LOC_ID_0_1;
439}
440
448GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
449inline
451 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
452 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
453 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
454 }
455 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
456 [[__maybe_unused__]] register bool defer_return_flag = false;
457 if (false) {
458 DEFER_ID_1_5:
459 goto DEFER_END_ID_1_6;
460 } else {
461 (void)0 ;
462 /* defer */
463 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
464 unsigned (*DEFER_LOC_ID_1_3)[DEFER_LOC_ID_0_2] = {};
465 if (false) {
466 DEFER_ID_1_6: {
467 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
468 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
469 {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");}
470 }
471 goto DEFER_ID_1_5;
472 } else
473 (void)0 ;
474 do {ELLIPSIS_CONTRACT(5, s && t, abort, true, "s ∧ t", "assertion", "argument FA arrays for concatenation must not be null");} while (false);
475 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);
477 do {
478 /* return mode 2 */
479 defer_return_flag = true;
480 DEFER_LOC_ID_0_1 = ellipsis‿carray‿concat‿_Insta(s, t);
481 goto DEFER_ID_1_6;
482 } while(false);
483
484 goto DEFER_ID_1_6;
485 }
486[[__maybe_unused__]] DEFER_END_ID_1_6:;
487 return DEFER_LOC_ID_0_1;
488}
489
518GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
519inline
521 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
522 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
523 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
524 }
525 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
526 [[__maybe_unused__]] register bool defer_return_flag = false;
527 if (false) {
528 DEFER_ID_1_7:
529 goto DEFER_END_ID_1_8;
530 } else {
531 (void)0 ;
532 /* defer */
533 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
534 unsigned (*DEFER_LOC_ID_1_4)[DEFER_LOC_ID_0_2] = {};
535 if (false) {
536 DEFER_ID_1_8: {
537 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
538 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
539 {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");}
540 }
541 goto DEFER_ID_1_7;
542 } else
543 (void)0 ;
545 do {
546 /* return mode 2 */
547 defer_return_flag = true;
548 DEFER_LOC_ID_0_1 = ellipsis‿carray‿concat_inplace‿_Insta(s, t);
549 goto DEFER_ID_1_8;
550 } while(false);
551
552 goto DEFER_ID_1_8;
553 }
554[[__maybe_unused__]] DEFER_END_ID_1_8:;
555 return DEFER_LOC_ID_0_1;
556}
557
573GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
574inline
576 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
577 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
578 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
579 }
580 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
581 [[__maybe_unused__]] register bool defer_return_flag = false;
582 if (false) {
583 DEFER_ID_1_9:
584 goto DEFER_END_ID_1_10;
585 } else {
586 (void)0 ;
587 /* defer */
588 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
589 unsigned (*DEFER_LOC_ID_1_5)[DEFER_LOC_ID_0_2] = {};
590 if (false) {
591 DEFER_ID_1_10: {
592 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
593 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
594 {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");}
595 }
596 goto DEFER_ID_1_9;
597 } else
598 (void)0 ;
599 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);
600 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);
602 do {
603 /* return mode 2 */
604 defer_return_flag = true;
605 DEFER_LOC_ID_0_1 = ellipsis‿carray‿grow‿_Insta(s, length);
606 goto DEFER_ID_1_10;
607 } while(false);
608
609 goto DEFER_ID_1_10;
610 }
611[[__maybe_unused__]] DEFER_END_ID_1_10:;
612 return DEFER_LOC_ID_0_1;
613}
614
632GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
633inline
635 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
636 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
637 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
638 }
639 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
640 [[__maybe_unused__]] register bool defer_return_flag = false;
641 if (false) {
642 DEFER_ID_1_11:
643 goto DEFER_END_ID_1_12;
644 } else {
645 (void)0 ;
646 /* defer */
647 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
648 unsigned (*DEFER_LOC_ID_1_6)[DEFER_LOC_ID_0_2] = {};
649 if (false) {
650 DEFER_ID_1_12: {
651 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
652 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
653 {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");}
654 }
655 goto DEFER_ID_1_11;
656 } else
657 (void)0 ;
658 do {ELLIPSIS_CONTRACT(12, s, abort, true, "s", "assertion", "can only shrink existing array");} while (false);
659 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);
660 do {ELLIPSIS_CONTRACT(14, length <= s->length, abort, true, "length ≤ s→length", "assertion", "can\'t shrink array to make it longer");} while (false);
662 do {
663 /* return mode 2 */
664 defer_return_flag = true;
665 DEFER_LOC_ID_0_1 = ellipsis‿carray‿shrink‿_Insta(s, length);
666 goto DEFER_ID_1_12;
667 } while(false);
668
669 goto DEFER_ID_1_12;
670 }
671[[__maybe_unused__]] DEFER_END_ID_1_12:;
672 return DEFER_LOC_ID_0_1;
673}
674
683GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
684inline
685ellipsis‿carray* ellipsis‿carray‿sub(ellipsis‿carray const*restrict s, size_t pos, size_t len) {
686 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
687 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
688 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
689 }
690 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
691 [[__maybe_unused__]] register bool defer_return_flag = false;
692 if (false) {
693 DEFER_ID_1_13:
694 goto DEFER_END_ID_1_14;
695 } else {
696 (void)0 ;
697 do {ELLIPSIS_CONTRACT(15, s, abort, true, "s", "assertion", "substring from non-existing string");} while (false);
698 do {ELLIPSIS_CONTRACT(16, pos < s->length, abort, true, "pos < s→length", "assertion", "start of substring is out of bounds");} while (false);
699 /* defer */
700 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
701 unsigned (*DEFER_LOC_ID_1_7)[DEFER_LOC_ID_0_2] = {};
702 if (false) {
703 DEFER_ID_1_14: {
704 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
705 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
706 {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");}
707 }
708 goto DEFER_ID_1_13;
709 } else
710 (void)0 ;
712 do {
713 /* return mode 2 */
714 defer_return_flag = true;
715 DEFER_LOC_ID_0_1 = ellipsis‿carray‿sub‿_Insta(s, pos, len);
716 goto DEFER_ID_1_14;
717 } while(false);
718
719 goto DEFER_ID_1_14;
720 }
721[[__maybe_unused__]] DEFER_END_ID_1_14:;
722 return DEFER_LOC_ID_0_1;
723}
724
736GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
737inline
739 typeof(ellipsis‿carray const*) DEFER_LOC_ID_0_1;
740 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
741 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray const*)) {};
742 }
743 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
744 [[__maybe_unused__]] register bool defer_return_flag = false;
745 if (false) {
746 DEFER_ID_1_15:
747 goto DEFER_END_ID_1_16;
748 } else {
749 (void)0 ;
750 do {ELLIPSIS_CONTRACT(18, s, abort, true, "s", "assertion", "copy of non-existing string");} while (false);
751 /* defer */
752 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
753 unsigned (*DEFER_LOC_ID_1_8)[DEFER_LOC_ID_0_2] = {};
754 if (false) {
755 DEFER_ID_1_16: {
756 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
757 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
758 {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");}
759 }
760 goto DEFER_ID_1_15;
761 } else
762 (void)0 ;
764 do {
765 /* return mode 2 */
766 defer_return_flag = true;
767 DEFER_LOC_ID_0_1 = ellipsis‿carray‿cpy_const‿_Insta(s);
768 goto DEFER_ID_1_16;
769 } while(false);
770
771 goto DEFER_ID_1_16;
772 }
773[[__maybe_unused__]] DEFER_END_ID_1_16:;
774 return DEFER_LOC_ID_0_1;
775}
776
784GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
785inline
787 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
788 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
789 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
790 }
791 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
792 [[__maybe_unused__]] register bool defer_return_flag = false;
793 if (false) {
794 DEFER_ID_1_17:
795 goto DEFER_END_ID_1_18;
796 } else {
797 (void)0 ;
798 /* defer */
799 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
800 unsigned (*DEFER_LOC_ID_1_9)[DEFER_LOC_ID_0_2] = {};
801 if (false) {
802 DEFER_ID_1_18: {
803 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
804 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
805 {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");}
806 }
807 goto DEFER_ID_1_17;
808 } else
809 (void)0 ;
811 do {
812 /* return mode 2 */
813 defer_return_flag = true;
814 DEFER_LOC_ID_0_1 = ellipsis‿carray‿alloc‿_Inner(len);
815 goto DEFER_ID_1_18;
816 } while(false);
817
818 goto DEFER_ID_1_18;
819 }
820[[__maybe_unused__]] DEFER_END_ID_1_18:;
821 return DEFER_LOC_ID_0_1;
822}
823
839GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
840inline
842 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
843 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
844 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
845 }
846 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
847 [[__maybe_unused__]] register bool defer_return_flag = false;
848 if (false) {
849 DEFER_ID_1_19:
850 goto DEFER_END_ID_1_20;
851 } else {
852 (void)0 ;
853 /* defer */
854 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
855 unsigned (*DEFER_LOC_ID_1_10)[DEFER_LOC_ID_0_2] = {};
856 if (false) {
857 DEFER_ID_1_20: {
858 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
859 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
860 {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");}
861 }
862 goto DEFER_ID_1_19;
863 } else
864 (void)0 ;
865 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);
867 do {
868 /* return mode 2 */
869 defer_return_flag = true;
870 DEFER_LOC_ID_0_1 = ellipsis‿carray‿append‿_Inner(s, c);
871 goto DEFER_ID_1_20;
872 } while(false);
873
874 goto DEFER_ID_1_20;
875 }
876[[__maybe_unused__]] DEFER_END_ID_1_20:;
877 return DEFER_LOC_ID_0_1;
878}
879
887GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
888inline
890 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
891 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
892 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
893 }
894 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
895 [[__maybe_unused__]] register bool defer_return_flag = false;
896 if (false) {
897 DEFER_ID_1_21:
898 goto DEFER_END_ID_1_22;
899 } else {
900 (void)0 ;
901 /* defer */
902 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
903 unsigned (*DEFER_LOC_ID_1_11)[DEFER_LOC_ID_0_2] = {};
904 if (false) {
905 DEFER_ID_1_22: {
906 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
907 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
908 {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");}
909 }
910 goto DEFER_ID_1_21;
911 } else
912 (void)0 ;
913 do {ELLIPSIS_CONTRACT(24, s && t, unreachable, false, "s ∧ t", "assumption", "argument FA arrays for concatenation must not be null");} while (false);
914 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);
916 do {
917 /* return mode 2 */
918 defer_return_flag = true;
919 DEFER_LOC_ID_0_1 = ellipsis‿carray‿concat‿_Inner(s, t);
920 goto DEFER_ID_1_22;
921 } while(false);
922
923 goto DEFER_ID_1_22;
924 }
925[[__maybe_unused__]] DEFER_END_ID_1_22:;
926 return DEFER_LOC_ID_0_1;
927}
928
957GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
958inline
960 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
961 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
962 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
963 }
964 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
965 [[__maybe_unused__]] register bool defer_return_flag = false;
966 if (false) {
967 DEFER_ID_1_23:
968 goto DEFER_END_ID_1_24;
969 } else {
970 (void)0 ;
971 /* defer */
972 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
973 unsigned (*DEFER_LOC_ID_1_12)[DEFER_LOC_ID_0_2] = {};
974 if (false) {
975 DEFER_ID_1_24: {
976 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
977 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
978 {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");}
979 }
980 goto DEFER_ID_1_23;
981 } else
982 (void)0 ;
984 do {
985 /* return mode 2 */
986 defer_return_flag = true;
987 DEFER_LOC_ID_0_1 = ellipsis‿carray‿concat_inplace‿_Inner(s, t);
988 goto DEFER_ID_1_24;
989 } while(false);
990
991 goto DEFER_ID_1_24;
992 }
993[[__maybe_unused__]] DEFER_END_ID_1_24:;
994 return DEFER_LOC_ID_0_1;
995}
996
1012GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
1013inline
1015 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
1016 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1017 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
1018 }
1019 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1020 [[__maybe_unused__]] register bool defer_return_flag = false;
1021 if (false) {
1022 DEFER_ID_1_25:
1023 goto DEFER_END_ID_1_26;
1024 } else {
1025 (void)0 ;
1026 /* defer */
1027 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1028 unsigned (*DEFER_LOC_ID_1_13)[DEFER_LOC_ID_0_2] = {};
1029 if (false) {
1030 DEFER_ID_1_26: {
1031 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1032 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1033 {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");}
1034 }
1035 goto DEFER_ID_1_25;
1036 } else
1037 (void)0 ;
1038 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);
1039 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);
1041 do {
1042 /* return mode 2 */
1043 defer_return_flag = true;
1044 DEFER_LOC_ID_0_1 = ellipsis‿carray‿grow‿_Inner(s, length);
1045 goto DEFER_ID_1_26;
1046 } while(false);
1047
1048 goto DEFER_ID_1_26;
1049 }
1050[[__maybe_unused__]] DEFER_END_ID_1_26:;
1051 return DEFER_LOC_ID_0_1;
1052}
1053
1071GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
1072inline
1074 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
1075 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1076 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
1077 }
1078 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1079 [[__maybe_unused__]] register bool defer_return_flag = false;
1080 if (false) {
1081 DEFER_ID_1_27:
1082 goto DEFER_END_ID_1_28;
1083 } else {
1084 (void)0 ;
1085 /* defer */
1086 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1087 unsigned (*DEFER_LOC_ID_1_14)[DEFER_LOC_ID_0_2] = {};
1088 if (false) {
1089 DEFER_ID_1_28: {
1090 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1091 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1092 {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");}
1093 }
1094 goto DEFER_ID_1_27;
1095 } else
1096 (void)0 ;
1097 do {ELLIPSIS_CONTRACT(31, s, unreachable, false, "s", "assumption", "can only shrink existing array");} while (false);
1098 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);
1099 do {ELLIPSIS_CONTRACT(33, length <= s->length, unreachable, false, "length ≤ s→length", "assumption", "can\'t shrink array to make it longer");} while (false);
1101 do {
1102 /* return mode 2 */
1103 defer_return_flag = true;
1104 DEFER_LOC_ID_0_1 = ellipsis‿carray‿shrink‿_Inner(s, length);
1105 goto DEFER_ID_1_28;
1106 } while(false);
1107
1108 goto DEFER_ID_1_28;
1109 }
1110[[__maybe_unused__]] DEFER_END_ID_1_28:;
1111 return DEFER_LOC_ID_0_1;
1112}
1113
1122GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
1123inline
1124ellipsis‿carray* ellipsis‿carray‿sub‿_Ctra(ellipsis‿carray const*restrict s, size_t pos, size_t len) {
1125 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
1126 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1127 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
1128 }
1129 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1130 [[__maybe_unused__]] register bool defer_return_flag = false;
1131 if (false) {
1132 DEFER_ID_1_29:
1133 goto DEFER_END_ID_1_30;
1134 } else {
1135 (void)0 ;
1136 do {ELLIPSIS_CONTRACT(34, s, unreachable, false, "s", "assumption", "substring from non-existing string");} while (false);
1137 do {ELLIPSIS_CONTRACT(35, pos < s->length, unreachable, false, "pos < s→length", "assumption", "start of substring is out of bounds");} while (false);
1138 /* defer */
1139 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1140 unsigned (*DEFER_LOC_ID_1_15)[DEFER_LOC_ID_0_2] = {};
1141 if (false) {
1142 DEFER_ID_1_30: {
1143 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1144 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1145 {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");}
1146 }
1147 goto DEFER_ID_1_29;
1148 } else
1149 (void)0 ;
1151 do {
1152 /* return mode 2 */
1153 defer_return_flag = true;
1154 DEFER_LOC_ID_0_1 = ellipsis‿carray‿sub‿_Inner(s, pos, len);
1155 goto DEFER_ID_1_30;
1156 } while(false);
1157
1158 goto DEFER_ID_1_30;
1159 }
1160[[__maybe_unused__]] DEFER_END_ID_1_30:;
1161 return DEFER_LOC_ID_0_1;
1162}
1163
1175GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
1176inline
1178 typeof(ellipsis‿carray const*) DEFER_LOC_ID_0_1;
1179 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1180 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray const*)) {};
1181 }
1182 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1183 [[__maybe_unused__]] register bool defer_return_flag = false;
1184 if (false) {
1185 DEFER_ID_1_31:
1186 goto DEFER_END_ID_1_32;
1187 } else {
1188 (void)0 ;
1189 do {ELLIPSIS_CONTRACT(37, s, unreachable, false, "s", "assumption", "copy of non-existing string");} while (false);
1190 /* defer */
1191 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1192 unsigned (*DEFER_LOC_ID_1_16)[DEFER_LOC_ID_0_2] = {};
1193 if (false) {
1194 DEFER_ID_1_32: {
1195 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1196 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1197 {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");}
1198 }
1199 goto DEFER_ID_1_31;
1200 } else
1201 (void)0 ;
1203 do {
1204 /* return mode 2 */
1205 defer_return_flag = true;
1206 DEFER_LOC_ID_0_1 = ellipsis‿carray‿cpy_const‿_Inner(s);
1207 goto DEFER_ID_1_32;
1208 } while(false);
1209
1210 goto DEFER_ID_1_32;
1211 }
1212[[__maybe_unused__]] DEFER_END_ID_1_32:;
1213 return DEFER_LOC_ID_0_1;
1214}
1215
1229GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns") ellipsis‿carray* ellipsis‿carray‿remove(ellipsis‿carray s[restrict static 1], size_t);
1230
1241
1250GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷carray" " need to keep pointer returns")
1251inline
1253 typeof(ellipsis‿carray*) DEFER_LOC_ID_0_1;
1254 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1255 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿carray*)) {};
1256 }
1257 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1258 [[__maybe_unused__]] register bool defer_return_flag = false;
1259 if (false) {
1260 DEFER_ID_1_33:
1261 goto DEFER_END_ID_1_34;
1262 } else {
1263 (void)0 ;
1264 ELLIPSIS_CONTRACT(39, __LOC_ID_0_9, abort, true, "__LOC(0, 1)", "precondition", "copy of non-existing string");
1265 do {
1266 /* return mode 2 */
1267 defer_return_flag = true;
1268 DEFER_LOC_ID_0_1 = ellipsis‿carray‿sub(__LOC_ID_0_9, 0, __LOC_ID_0_9->length);
1269 goto DEFER_ID_1_33;
1270 } while(false);
1271
1272 goto DEFER_ID_1_33;
1273 }
1274[[__maybe_unused__]] DEFER_END_ID_1_34:;
1275 return DEFER_LOC_ID_0_1;
1276}
1277
1281inline
1282int ellipsis‿carray‿compareInternal(void const* A, void const* B) {
1283 ellipsis‿carray‿base const* a = A;
1284 ellipsis‿carray‿base const* b = B;
1286}
1287
1300inline
1301void ellipsis‿carray‿sort(ellipsis‿carray* p, size_t offs, size_t len) {
1302 extern void (qsort)(void*, size_t, size_t, int (*)(const void*, const void*));
1303 if (offs < p->length) {
1304 size_t rlen = p->length - offs;
1305 if (rlen < len) len = rlen;
1306 if (len > 1) {
1307 qsort((void*)(p->array+offs), len, sizeof(ellipsis‿carray‿base), ellipsis‿carray‿compareInternal);
1308 }
1309 }
1310}
1311
1320inline
1321ellipsis‿carray‿base const* ellipsis‿carray‿search(ellipsis‿carray‿base const el[static 1], ellipsis‿carray const* p, size_t offs, size_t len) {
1322 extern void* (bsearch)(void const*, void const*, size_t, size_t, int (*)(const void*, const void*));
1323 if (offs < p->length) {
1324 size_t rlen = p->length - offs;
1325 if (rlen < len) len = rlen;
1326 if (len > 0) {
1327 return bsearch((void const*)el, (void const*)(p->array+offs), len, sizeof(ellipsis‿carray‿base), ellipsis‿carray‿compareInternal);
1328 }
1329 }
1330 return nullptr;
1331}
1332
1333#endif
ellipsis‿carray * ellipsis‿carray‿shrink‿_Inner(ellipsis‿carray s[restrict static 1], size_t length)
Definition ellipsis-carray.c:228
ellipsis‿carray const * ellipsis‿carray‿cpy_const‿_Inner(ellipsis‿carray const *restrict s)
Definition ellipsis-carray.c:257
ellipsis‿carray * ellipsis‿carray‿alloc‿_Inner(size_t len)
Definition ellipsis-carray.c:147
ellipsis‿carray * ellipsis‿carray‿concat‿_Inner(ellipsis‿carray const *s, ellipsis‿carray const *t)
Definition ellipsis-carray.c:168
ellipsis‿carray * ellipsis‿carray‿concat_inplace‿_Inner(ellipsis‿carray const *s0, ellipsis‿carray const *t)
Definition ellipsis-carray.c:183
ellipsis‿carray * ellipsis‿carray‿grow‿_Inner(ellipsis‿carray *restrict s, size_t length)
Definition ellipsis-carray.c:202
ellipsis‿carray * ellipsis‿carray‿sub‿_Inner(ellipsis‿carray const *s, size_t pos, size_t len)
Definition ellipsis-carray.c:240
ellipsis‿carray * ellipsis‿carray‿append‿_Inner(ellipsis‿carray *restrict s, s->array[0] c)
Definition ellipsis-carray.c:159
thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic
#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-carray.h:112
thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic
thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic
@ keep
Definition ellipsis-category.h:56
#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
static ellipsis‿token‿dictionary functions
Definition ellipsis-macros.c:89
A structure with a flexible array member of base type ellipsis‿carray‿base.
Definition ellipsis-carray.h:182
ellipsis‿carray * ellipsis‿carray‿alloc‿_Insta(size_t len)
Allocate a ellipsis‿carray with elements as given by the parameter.
Definition ellipsis-carray.c:272
int ellipsis‿carray‿base‿compare(ellipsis‿carray‿base const __LOC_ID_0_3[static 1], ellipsis‿carray‿base const __LOC_ID_0_4[static 1])
Definition ellipsis-carray.h:42
int ellipsis‿carray‿compare(ellipsis‿carray const *s, ellipsis‿carray const *t)
Compare two arrays lexicographically.
Definition ellipsis-carray.c:119
ellipsis‿carray * ellipsis‿carray‿concat_inplace‿_Ctra(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one and delete s.
Definition ellipsis-carray.h:959
ellipsis‿carray * ellipsis‿carray‿append(ellipsis‿carray *restrict s, ellipsis‿carray‿base c)
Append a new element to a ellipsis‿carray and return a new object.
Definition ellipsis-carray.h:402
size_t const length
Current length of this instance.
Definition ellipsis-carray.h:191
ellipsis‿carray * ellipsis‿carray‿cpy(ellipsis‿carray const *restrict __LOC_ID_0_9)
Allocate a ellipsis‿carray and copy the data to which the parameter points into it.
Definition ellipsis-carray.h:1252
void ellipsis‿carray‿base‿destroy(size_t __LOC_ID_0_1, ellipsis‿carray‿base const __LOC_ID_0_2[__LOC_ID_0_1])
Destroy a ellipsis‿carray‿base by freeing the pointed-to character array.
Definition ellipsis-carray.h:31
ellipsis‿carray const * ellipsis‿carray‿cpy_const(ellipsis‿carray const *restrict s)
Copy or link to a const-qualified ellipsis‿carray.
Definition ellipsis-carray.h:738
ellipsis‿carray‿base array[]
The current data array.
Definition ellipsis-carray.h:216
ellipsis‿carray * ellipsis‿carray‿grow‿_Ctra(ellipsis‿carray *restrict s, size_t length)
Grow the ellipsis‿carray to (at least) the indicated amount of elements return a new one and delete t...
Definition ellipsis-carray.h:1014
ellipsis‿carray * ellipsis‿carray‿alloc‿_Ctra(size_t len)
Allocate a ellipsis‿carray with elements as given by the parameter.
Definition ellipsis-carray.h:786
void ellipsis‿carray‿move(ellipsis‿carray *__LOC_ID_0_5[restrict static 1], ellipsis‿carray **restrict __LOC_ID_0_6)
Move a ellipsis‿carray pointed to by the second parameter to the one pointed to by the first.
Definition ellipsis-carray.h:306
ellipsis‿carray * ellipsis‿carray‿grow‿_Insta(ellipsis‿carray *restrict s, size_t length)
Grow the ellipsis‿carray to (at least) the indicated amount of elements return a new one and delete t...
Definition ellipsis-carray.c:456
ellipsis‿carray const * ellipsis‿carray‿cpy_const‿_Insta(ellipsis‿carray const *restrict s)
Copy or link to a const-qualified ellipsis‿carray.
Definition ellipsis-carray.c:586
ellipsis‿carray * ellipsis‿carray‿sub‿_Insta(ellipsis‿carray const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿carray with len elements and copy the data from *s at position pos onward.
Definition ellipsis-carray.c:544
ellipsis‿carray * ellipsis‿carray‿sub(ellipsis‿carray const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿carray with len elements and copy the data from *s at position pos onward.
Definition ellipsis-carray.h:685
size_t length_mod
Modifiable length of this instance.
Definition ellipsis-carray.h:198
int ellipsis‿carray‿compareInternal(void const *A, void const *B)
Definition ellipsis-carray.h:1282
ellipsis‿carray * ellipsis‿carray‿shrink‿_Ctra(ellipsis‿carray s[restrict static 1], size_t length)
Shrink the ellipsis‿carray to exactly the indicated amount of elements return a new one and delete th...
Definition ellipsis-carray.h:1073
void ellipsis‿carray‿delete(ellipsis‿carray const *)
Delete a ellipsis‿carray pointed to by the parameter.
Definition ellipsis-carray.c:615
void ellipsis‿carray‿cmove(ellipsis‿carray const *__LOC_ID_0_7[restrict static 1], ellipsis‿carray const **restrict __LOC_ID_0_8)
Move a ellipsis‿carray const pointed to by the second parameter to the one pointed to by the first.
Definition ellipsis-carray.h:326
ellipsis‿carray‿base const * ellipsis‿carray‿search(ellipsis‿carray‿base const el[static 1], ellipsis‿carray const *p, size_t offs, size_t len)
search for an element in a ellipsis‿carray
Definition ellipsis-carray.h:1321
ellipsis‿carray * ellipsis‿carray‿append‿_Ctra(ellipsis‿carray *restrict s, ellipsis‿carray‿base c)
Append a new element to a ellipsis‿carray and return a new object.
Definition ellipsis-carray.h:841
ellipsis‿carray * ellipsis‿carray‿concat_inplace(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one and delete s.
Definition ellipsis-carray.h:520
ellipsis‿carray * ellipsis‿carray‿concat‿_Insta(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one.
Definition ellipsis-carray.c:353
void ellipsis‿carray‿sort(ellipsis‿carray *p, size_t offs, size_t len)
sort a ellipsis‿carray in place.
Definition ellipsis-carray.h:1301
ellipsis‿carray * ellipsis‿carray‿alloc(size_t len)
Allocate a ellipsis‿carray with elements as given by the parameter.
Definition ellipsis-carray.h:347
ellipsis‿carray * ellipsis‿carray‿grow(ellipsis‿carray *restrict s, size_t length)
Grow the ellipsis‿carray to (at least) the indicated amount of elements return a new one and delete t...
Definition ellipsis-carray.h:575
ellipsis‿carray * ellipsis‿carray‿concat_inplace‿_Insta(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one and delete s.
Definition ellipsis-carray.c:412
ellipsis‿carray * ellipsis‿carray‿shrink(ellipsis‿carray s[restrict static 1], size_t length)
Shrink the ellipsis‿carray to exactly the indicated amount of elements return a new one and delete th...
Definition ellipsis-carray.h:634
ellipsis‿carray * ellipsis‿carray‿append‿_Insta(ellipsis‿carray *restrict s, ellipsis‿carray‿base c)
Append a new element to a ellipsis‿carray and return a new object.
Definition ellipsis-carray.c:316
char const * ellipsis‿carray‿base
A pointer to a private character array.
Definition ellipsis-carray.h:25
size_t const capacity
Maximal length of this instance.
Definition ellipsis-carray.h:208
ellipsis‿carray * ellipsis‿carray‿shrink‿_Insta(ellipsis‿carray s[restrict static 1], size_t length)
Shrink the ellipsis‿carray to exactly the indicated amount of elements return a new one and delete th...
Definition ellipsis-carray.c:504
ellipsis‿carray * ellipsis‿carray‿remove(ellipsis‿carray s[restrict static 1], size_t)
Remove (at most) the indicated amount of elements from the ellipsis‿carray return a new one and delet...
Definition ellipsis-carray.c:108
ellipsis‿carray * ellipsis‿carray‿sub‿_Ctra(ellipsis‿carray const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿carray with len elements and copy the data from *s at position pos onward.
Definition ellipsis-carray.h:1124
ellipsis‿carray * ellipsis‿carray‿concat‿_Ctra(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one.
Definition ellipsis-carray.h:889
ellipsis‿carray const * ellipsis‿carray‿cpy_const‿_Ctra(ellipsis‿carray const *restrict s)
Copy or link to a const-qualified ellipsis‿carray.
Definition ellipsis-carray.h:1177
ellipsis‿carray * ellipsis‿carray‿concat(ellipsis‿carray const *s, ellipsis‿carray const *t)
Concatenate two ellipsis‿carray into a new one.
Definition ellipsis-carray.h:450