eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-str8.h
Go to the documentation of this file.
1
2/* This is a file generated by eĿlipsis version 20250309, do not modify */
3
4#ifndef ELLIPSIS_STR8_H
5#define ELLIPSIS_STR8_H 1
6
7#include <uchar.h>
8#include <stdio.h>
9#include <string.h>
10#include "ellipsis-error.h"
11
15typedef unsigned char ellipsis‿str8‿base;
16
20inline
22 if (!__LOC_ID_0_1[0] + !__LOC_ID_0_2[0]) {
23 return !__LOC_ID_0_2[0] - !__LOC_ID_0_1[0];
24 }
25 return (__LOC_ID_0_1[0] < __LOC_ID_0_2[0]) ? -1 : (__LOC_ID_0_1[0] > __LOC_ID_0_2[0] ? +1 : 0);
26}
27
28#include <stddef.h>
29#include <string.h>
30#include <stdlib.h>
32
33extern thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic;
34extern thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic;
35extern thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic;
36
38
39#include <stdio.h>
40#include <stdlib.h>
41#include <stdint.h>
42
43#define STRINGIFY(...) STRINGIFY_(__VA_ARGS__)
44#define STRINGIFY_(...) #__VA_ARGS__
45
46#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...) \
47({\
48 static char const contract_format_ ## COUNT[] = \
49 __FILE__ ":" STRINGIFY(__LINE__) ": violation of " CTYPE " `" CSTR "`" __VA_OPT__(", ") __VA_ARGS__ "\n";\
50 (VERB \
51 ? fputs(contract_format_ ## COUNT, stderr) \
52 : 0);\
53 })
54
55#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
56(((false) || (COND)) \
57 ? (void)0 \
58 : (ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR __VA_OPT__(,) __VA_ARGS__) \
59 , ((false) \
60 ? (void)0 \
61 : ACTION())))
62
63#define ELLIPSIS_TO_VOIDS(...) ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))
64
65#define ELLIPSIS_TEST_ICE(...) (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)
66
67#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...) \
68 _Generic( \
69 ELLIPSIS_TEST_ICE(__VA_ARGS__), \
70 ellipsis‿contracts‿is_ice*: (__VA_ARGS__), \
71 default: true)
72
73#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...) \
74 ({\
75 static_assert(ELLIPSIS_CONTRACT_ICE_OR_TRUE(COND), \
76 "compile time violation of " CTYPE " " CSTR \
77 __VA_OPT__(", ") __VA_ARGS__ );\
78 })
79
80#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
81 \
82 do { \
83 _Generic( \
84 ELLIPSIS_TEST_ICE(COND), \
85 ellipsis‿contracts‿is_ice*: ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR __VA_OPT__(,) __VA_ARGS__), \
86 default: ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE __VA_OPT__(,) __VA_ARGS__));\
87 } while(false)
88
149typedef struct ellipsis‿str8 ellipsis‿str8;
151#ifndef DOXYGEN_SPECIAL
152 union {
153#endif
159 size_t const length;
165 [[deprecated("use const member length instead")]]
167#ifndef DOXYGEN_SPECIAL
168 };
169#endif
176 size_t const capacity;
185};
186
187#define ELLIPSIS_STR8_OVERLAY(N) \
188 union {\
189 struct {\
190 size_t const length;\
191 size_t const padding;\
192 unsigned const :(offsetof(ellipsis‿str8, array)-2*sizeof(size_t));\
193 ellipsis‿str8‿base array[N];\
194 };\
195 ellipsis‿str8 fa;\
196 }
197
198#define ELLIPSIS_STR8_STATIC(N, ...) \
199 (({\
200 static const ELLIPSIS_STR8_OVERLAY( \
201 sizeof((ellipsis‿str8‿base[]){__VA_ARGS__ }) \
202 /sizeof(ellipsis‿str8‿base)) \
203 __LOC_ID_1_1 = {\
204 .length = (N), \
205 .array = {__VA_ARGS__ }, \
206 };&__LOC_ID_1_1;})->fa)
207
228#if __clang__ && (__clang_major__ < 30)
229#define ELLIPSIS_STR8_LITERAL_LOCAL(N, ...) ELLIPSIS_STR8_STATIC(N, __VA_ARGS__)
230#else
231#define ELLIPSIS_STR8_LITERAL_LOCAL(N, ...) \
232 ((static const ELLIPSIS_STR8_OVERLAY( \
233 sizeof((ellipsis‿str8‿base[]){__VA_ARGS__ }) \
234 /sizeof(ellipsis‿str8‿base))) \
235 {\
236 .length = (N), \
237 .array = {__VA_ARGS__ }, \
238 }.fa)
239#endif
240
241#define ELLIPSIS_STR8_LITERAL_GLOBAL(N, ...) \
242 ((const ELLIPSIS_STR8_OVERLAY( \
243 sizeof((ellipsis‿str8‿base[]){__VA_ARGS__ }) \
244 /sizeof(ellipsis‿str8‿base))) \
245 {\
246 .length = (N), \
247 .array = {__VA_ARGS__ }, \
248 }.fa)
249
250#define ELLIPSIS_STR8_LITERAL ELLIPSIS_STR8_LITERAL_LOCAL
251
265
274inline void ellipsis‿str8‿move(ellipsis‿str8* __LOC_ID_0_3[restrict static 1], ellipsis‿str8**restrict __LOC_ID_0_4) {
275 if (*__LOC_ID_0_3)
276 ellipsis‿str8‿delete((void*)*__LOC_ID_0_3);
277 if (__LOC_ID_0_4) {
278 *__LOC_ID_0_3= *__LOC_ID_0_4;
279 *__LOC_ID_0_4= nullptr;
280 } else {
281 *__LOC_ID_0_3= nullptr;
282 }
283
284}
285
294inline void ellipsis‿str8‿cmove(ellipsis‿str8 const* __LOC_ID_0_5[restrict static 1], ellipsis‿str8 const**restrict __LOC_ID_0_6) {
295 if (*__LOC_ID_0_5)
296 ellipsis‿str8‿delete((void*)*__LOC_ID_0_5);
297 if (__LOC_ID_0_6) {
298 *__LOC_ID_0_5= *__LOC_ID_0_6;
299 *__LOC_ID_0_6= nullptr;
300 } else {
301 *__LOC_ID_0_5= nullptr;
302 }
303
304}
305
313GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
314inline
316 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
317 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
318 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
319 }
320 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
321 [[__maybe_unused__]] register bool defer_return_flag = false;
322 if (false) {
323 DEFER_ID_1_1:
324 goto DEFER_END_ID_1_2;
325 } else {
326 (void)0 ;
327 /* defer */
328 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
329 unsigned (*DEFER_LOC_ID_1_1)[DEFER_LOC_ID_0_2] = {};
330 if (false) {
331 DEFER_ID_1_2: {
332 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
333 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
334 {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");}
335 }
336 goto DEFER_ID_1_1;
337 } else
338 (void)0 ;
340 do {
341 /* return mode 2 */
342 defer_return_flag = true;
343 DEFER_LOC_ID_0_1 = ellipsis‿str8‿alloc‿_Insta(len);
344 goto DEFER_ID_1_2;
345 } while(false);
346
347 goto DEFER_ID_1_2;
348 }
349[[__maybe_unused__]] DEFER_END_ID_1_2:;
350 return DEFER_LOC_ID_0_1;
351}
352
368GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
369inline
371 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
372 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
373 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
374 }
375 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
376 [[__maybe_unused__]] register bool defer_return_flag = false;
377 if (false) {
378 DEFER_ID_1_3:
379 goto DEFER_END_ID_1_4;
380 } else {
381 (void)0 ;
382 /* defer */
383 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
384 unsigned (*DEFER_LOC_ID_1_2)[DEFER_LOC_ID_0_2] = {};
385 if (false) {
386 DEFER_ID_1_4: {
387 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
388 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
389 {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");}
390 }
391 goto DEFER_ID_1_3;
392 } else
393 (void)0 ;
394 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);
396 do {
397 /* return mode 2 */
398 defer_return_flag = true;
399 DEFER_LOC_ID_0_1 = ellipsis‿str8‿append‿_Insta(s, c);
400 goto DEFER_ID_1_4;
401 } while(false);
402
403 goto DEFER_ID_1_4;
404 }
405[[__maybe_unused__]] DEFER_END_ID_1_4:;
406 return DEFER_LOC_ID_0_1;
407}
408
416GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
417inline
419 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
420 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
421 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
422 }
423 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
424 [[__maybe_unused__]] register bool defer_return_flag = false;
425 if (false) {
426 DEFER_ID_1_5:
427 goto DEFER_END_ID_1_6;
428 } else {
429 (void)0 ;
430 /* defer */
431 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
432 unsigned (*DEFER_LOC_ID_1_3)[DEFER_LOC_ID_0_2] = {};
433 if (false) {
434 DEFER_ID_1_6: {
435 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
436 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
437 {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");}
438 }
439 goto DEFER_ID_1_5;
440 } else
441 (void)0 ;
442 do {ELLIPSIS_CONTRACT(5, s && t, abort, true, "s ∧ t", "assertion", "argument FA arrays for concatenation must not be null");} while (false);
443 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);
445 do {
446 /* return mode 2 */
447 defer_return_flag = true;
448 DEFER_LOC_ID_0_1 = ellipsis‿str8‿concat‿_Insta(s, t);
449 goto DEFER_ID_1_6;
450 } while(false);
451
452 goto DEFER_ID_1_6;
453 }
454[[__maybe_unused__]] DEFER_END_ID_1_6:;
455 return DEFER_LOC_ID_0_1;
456}
457
486GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
487inline
489 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
490 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
491 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
492 }
493 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
494 [[__maybe_unused__]] register bool defer_return_flag = false;
495 if (false) {
496 DEFER_ID_1_7:
497 goto DEFER_END_ID_1_8;
498 } else {
499 (void)0 ;
500 /* defer */
501 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
502 unsigned (*DEFER_LOC_ID_1_4)[DEFER_LOC_ID_0_2] = {};
503 if (false) {
504 DEFER_ID_1_8: {
505 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
506 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
507 {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");}
508 }
509 goto DEFER_ID_1_7;
510 } else
511 (void)0 ;
513 do {
514 /* return mode 2 */
515 defer_return_flag = true;
516 DEFER_LOC_ID_0_1 = ellipsis‿str8‿concat_inplace‿_Insta(s, t);
517 goto DEFER_ID_1_8;
518 } while(false);
519
520 goto DEFER_ID_1_8;
521 }
522[[__maybe_unused__]] DEFER_END_ID_1_8:;
523 return DEFER_LOC_ID_0_1;
524}
525
541GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
542inline
544 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
545 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
546 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
547 }
548 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
549 [[__maybe_unused__]] register bool defer_return_flag = false;
550 if (false) {
551 DEFER_ID_1_9:
552 goto DEFER_END_ID_1_10;
553 } else {
554 (void)0 ;
555 /* defer */
556 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
557 unsigned (*DEFER_LOC_ID_1_5)[DEFER_LOC_ID_0_2] = {};
558 if (false) {
559 DEFER_ID_1_10: {
560 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
561 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
562 {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");}
563 }
564 goto DEFER_ID_1_9;
565 } else
566 (void)0 ;
567 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);
568 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);
570 do {
571 /* return mode 2 */
572 defer_return_flag = true;
573 DEFER_LOC_ID_0_1 = ellipsis‿str8‿grow‿_Insta(s, length);
574 goto DEFER_ID_1_10;
575 } while(false);
576
577 goto DEFER_ID_1_10;
578 }
579[[__maybe_unused__]] DEFER_END_ID_1_10:;
580 return DEFER_LOC_ID_0_1;
581}
582
600GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
601inline
603 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
604 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
605 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
606 }
607 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
608 [[__maybe_unused__]] register bool defer_return_flag = false;
609 if (false) {
610 DEFER_ID_1_11:
611 goto DEFER_END_ID_1_12;
612 } else {
613 (void)0 ;
614 /* defer */
615 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
616 unsigned (*DEFER_LOC_ID_1_6)[DEFER_LOC_ID_0_2] = {};
617 if (false) {
618 DEFER_ID_1_12: {
619 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
620 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
621 {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");}
622 }
623 goto DEFER_ID_1_11;
624 } else
625 (void)0 ;
626 do {ELLIPSIS_CONTRACT(12, s, abort, true, "s", "assertion", "can only shrink existing array");} while (false);
627 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);
628 do {ELLIPSIS_CONTRACT(14, length <= s->length, abort, true, "length ≤ s→length", "assertion", "can\'t shrink array to make it longer");} while (false);
630 do {
631 /* return mode 2 */
632 defer_return_flag = true;
633 DEFER_LOC_ID_0_1 = ellipsis‿str8‿shrink‿_Insta(s, length);
634 goto DEFER_ID_1_12;
635 } while(false);
636
637 goto DEFER_ID_1_12;
638 }
639[[__maybe_unused__]] DEFER_END_ID_1_12:;
640 return DEFER_LOC_ID_0_1;
641}
642
651GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
652inline
653ellipsis‿str8* ellipsis‿str8‿sub(ellipsis‿str8 const*restrict s, size_t pos, size_t len) {
654 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
655 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
656 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
657 }
658 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
659 [[__maybe_unused__]] register bool defer_return_flag = false;
660 if (false) {
661 DEFER_ID_1_13:
662 goto DEFER_END_ID_1_14;
663 } else {
664 (void)0 ;
665 do {ELLIPSIS_CONTRACT(15, s, abort, true, "s", "assertion", "substring from non-existing string");} while (false);
666 do {ELLIPSIS_CONTRACT(16, pos < s->length, abort, true, "pos < s→length", "assertion", "start of substring is out of bounds");} while (false);
667 /* defer */
668 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
669 unsigned (*DEFER_LOC_ID_1_7)[DEFER_LOC_ID_0_2] = {};
670 if (false) {
671 DEFER_ID_1_14: {
672 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
673 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
674 {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");}
675 }
676 goto DEFER_ID_1_13;
677 } else
678 (void)0 ;
680 do {
681 /* return mode 2 */
682 defer_return_flag = true;
683 DEFER_LOC_ID_0_1 = ellipsis‿str8‿sub‿_Insta(s, pos, len);
684 goto DEFER_ID_1_14;
685 } while(false);
686
687 goto DEFER_ID_1_14;
688 }
689[[__maybe_unused__]] DEFER_END_ID_1_14:;
690 return DEFER_LOC_ID_0_1;
691}
692
704GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
705inline
707 typeof(ellipsis‿str8 const*) DEFER_LOC_ID_0_1;
708 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
709 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8 const*)) {};
710 }
711 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
712 [[__maybe_unused__]] register bool defer_return_flag = false;
713 if (false) {
714 DEFER_ID_1_15:
715 goto DEFER_END_ID_1_16;
716 } else {
717 (void)0 ;
718 do {ELLIPSIS_CONTRACT(18, s, abort, true, "s", "assertion", "copy of non-existing string");} while (false);
719 /* defer */
720 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
721 unsigned (*DEFER_LOC_ID_1_8)[DEFER_LOC_ID_0_2] = {};
722 if (false) {
723 DEFER_ID_1_16: {
724 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
725 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
726 {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");}
727 }
728 goto DEFER_ID_1_15;
729 } else
730 (void)0 ;
732 do {
733 /* return mode 2 */
734 defer_return_flag = true;
735 DEFER_LOC_ID_0_1 = ellipsis‿str8‿cpy_const‿_Insta(s);
736 goto DEFER_ID_1_16;
737 } while(false);
738
739 goto DEFER_ID_1_16;
740 }
741[[__maybe_unused__]] DEFER_END_ID_1_16:;
742 return DEFER_LOC_ID_0_1;
743}
744
752GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
753inline
755 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
756 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
757 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
758 }
759 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
760 [[__maybe_unused__]] register bool defer_return_flag = false;
761 if (false) {
762 DEFER_ID_1_17:
763 goto DEFER_END_ID_1_18;
764 } else {
765 (void)0 ;
766 /* defer */
767 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
768 unsigned (*DEFER_LOC_ID_1_9)[DEFER_LOC_ID_0_2] = {};
769 if (false) {
770 DEFER_ID_1_18: {
771 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
772 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
773 {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");}
774 }
775 goto DEFER_ID_1_17;
776 } else
777 (void)0 ;
779 do {
780 /* return mode 2 */
781 defer_return_flag = true;
782 DEFER_LOC_ID_0_1 = ellipsis‿str8‿alloc‿_Inner(len);
783 goto DEFER_ID_1_18;
784 } while(false);
785
786 goto DEFER_ID_1_18;
787 }
788[[__maybe_unused__]] DEFER_END_ID_1_18:;
789 return DEFER_LOC_ID_0_1;
790}
791
807GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
808inline
810 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
811 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
812 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
813 }
814 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
815 [[__maybe_unused__]] register bool defer_return_flag = false;
816 if (false) {
817 DEFER_ID_1_19:
818 goto DEFER_END_ID_1_20;
819 } else {
820 (void)0 ;
821 /* defer */
822 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
823 unsigned (*DEFER_LOC_ID_1_10)[DEFER_LOC_ID_0_2] = {};
824 if (false) {
825 DEFER_ID_1_20: {
826 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
827 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
828 {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");}
829 }
830 goto DEFER_ID_1_19;
831 } else
832 (void)0 ;
833 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);
835 do {
836 /* return mode 2 */
837 defer_return_flag = true;
838 DEFER_LOC_ID_0_1 = ellipsis‿str8‿append‿_Inner(s, c);
839 goto DEFER_ID_1_20;
840 } while(false);
841
842 goto DEFER_ID_1_20;
843 }
844[[__maybe_unused__]] DEFER_END_ID_1_20:;
845 return DEFER_LOC_ID_0_1;
846}
847
855GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
856inline
858 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
859 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
860 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
861 }
862 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
863 [[__maybe_unused__]] register bool defer_return_flag = false;
864 if (false) {
865 DEFER_ID_1_21:
866 goto DEFER_END_ID_1_22;
867 } else {
868 (void)0 ;
869 /* defer */
870 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
871 unsigned (*DEFER_LOC_ID_1_11)[DEFER_LOC_ID_0_2] = {};
872 if (false) {
873 DEFER_ID_1_22: {
874 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
875 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
876 {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");}
877 }
878 goto DEFER_ID_1_21;
879 } else
880 (void)0 ;
881 do {ELLIPSIS_CONTRACT(24, s && t, unreachable, false, "s ∧ t", "assumption", "argument FA arrays for concatenation must not be null");} while (false);
882 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);
884 do {
885 /* return mode 2 */
886 defer_return_flag = true;
887 DEFER_LOC_ID_0_1 = ellipsis‿str8‿concat‿_Inner(s, t);
888 goto DEFER_ID_1_22;
889 } while(false);
890
891 goto DEFER_ID_1_22;
892 }
893[[__maybe_unused__]] DEFER_END_ID_1_22:;
894 return DEFER_LOC_ID_0_1;
895}
896
925GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
926inline
928 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
929 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
930 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
931 }
932 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
933 [[__maybe_unused__]] register bool defer_return_flag = false;
934 if (false) {
935 DEFER_ID_1_23:
936 goto DEFER_END_ID_1_24;
937 } else {
938 (void)0 ;
939 /* defer */
940 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
941 unsigned (*DEFER_LOC_ID_1_12)[DEFER_LOC_ID_0_2] = {};
942 if (false) {
943 DEFER_ID_1_24: {
944 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
945 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
946 {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");}
947 }
948 goto DEFER_ID_1_23;
949 } else
950 (void)0 ;
952 do {
953 /* return mode 2 */
954 defer_return_flag = true;
955 DEFER_LOC_ID_0_1 = ellipsis‿str8‿concat_inplace‿_Inner(s, t);
956 goto DEFER_ID_1_24;
957 } while(false);
958
959 goto DEFER_ID_1_24;
960 }
961[[__maybe_unused__]] DEFER_END_ID_1_24:;
962 return DEFER_LOC_ID_0_1;
963}
964
980GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
981inline
983 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
984 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
985 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
986 }
987 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
988 [[__maybe_unused__]] register bool defer_return_flag = false;
989 if (false) {
990 DEFER_ID_1_25:
991 goto DEFER_END_ID_1_26;
992 } else {
993 (void)0 ;
994 /* defer */
995 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
996 unsigned (*DEFER_LOC_ID_1_13)[DEFER_LOC_ID_0_2] = {};
997 if (false) {
998 DEFER_ID_1_26: {
999 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1000 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1001 {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");}
1002 }
1003 goto DEFER_ID_1_25;
1004 } else
1005 (void)0 ;
1006 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);
1007 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);
1009 do {
1010 /* return mode 2 */
1011 defer_return_flag = true;
1012 DEFER_LOC_ID_0_1 = ellipsis‿str8‿grow‿_Inner(s, length);
1013 goto DEFER_ID_1_26;
1014 } while(false);
1015
1016 goto DEFER_ID_1_26;
1017 }
1018[[__maybe_unused__]] DEFER_END_ID_1_26:;
1019 return DEFER_LOC_ID_0_1;
1020}
1021
1039GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
1040inline
1042 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
1043 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1044 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
1045 }
1046 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1047 [[__maybe_unused__]] register bool defer_return_flag = false;
1048 if (false) {
1049 DEFER_ID_1_27:
1050 goto DEFER_END_ID_1_28;
1051 } else {
1052 (void)0 ;
1053 /* defer */
1054 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1055 unsigned (*DEFER_LOC_ID_1_14)[DEFER_LOC_ID_0_2] = {};
1056 if (false) {
1057 DEFER_ID_1_28: {
1058 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1059 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1060 {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");}
1061 }
1062 goto DEFER_ID_1_27;
1063 } else
1064 (void)0 ;
1065 do {ELLIPSIS_CONTRACT(31, s, unreachable, false, "s", "assumption", "can only shrink existing array");} while (false);
1066 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);
1067 do {ELLIPSIS_CONTRACT(33, length <= s->length, unreachable, false, "length ≤ s→length", "assumption", "can\'t shrink array to make it longer");} while (false);
1069 do {
1070 /* return mode 2 */
1071 defer_return_flag = true;
1072 DEFER_LOC_ID_0_1 = ellipsis‿str8‿shrink‿_Inner(s, length);
1073 goto DEFER_ID_1_28;
1074 } while(false);
1075
1076 goto DEFER_ID_1_28;
1077 }
1078[[__maybe_unused__]] DEFER_END_ID_1_28:;
1079 return DEFER_LOC_ID_0_1;
1080}
1081
1090GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
1091inline
1092ellipsis‿str8* ellipsis‿str8‿sub‿_Ctra(ellipsis‿str8 const*restrict s, size_t pos, size_t len) {
1093 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
1094 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1095 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
1096 }
1097 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1098 [[__maybe_unused__]] register bool defer_return_flag = false;
1099 if (false) {
1100 DEFER_ID_1_29:
1101 goto DEFER_END_ID_1_30;
1102 } else {
1103 (void)0 ;
1104 do {ELLIPSIS_CONTRACT(34, s, unreachable, false, "s", "assumption", "substring from non-existing string");} while (false);
1105 do {ELLIPSIS_CONTRACT(35, pos < s->length, unreachable, false, "pos < s→length", "assumption", "start of substring is out of bounds");} while (false);
1106 /* defer */
1107 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1108 unsigned (*DEFER_LOC_ID_1_15)[DEFER_LOC_ID_0_2] = {};
1109 if (false) {
1110 DEFER_ID_1_30: {
1111 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1112 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1113 {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");}
1114 }
1115 goto DEFER_ID_1_29;
1116 } else
1117 (void)0 ;
1119 do {
1120 /* return mode 2 */
1121 defer_return_flag = true;
1122 DEFER_LOC_ID_0_1 = ellipsis‿str8‿sub‿_Inner(s, pos, len);
1123 goto DEFER_ID_1_30;
1124 } while(false);
1125
1126 goto DEFER_ID_1_30;
1127 }
1128[[__maybe_unused__]] DEFER_END_ID_1_30:;
1129 return DEFER_LOC_ID_0_1;
1130}
1131
1143GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
1144inline
1146 typeof(ellipsis‿str8 const*) DEFER_LOC_ID_0_1;
1147 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1148 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8 const*)) {};
1149 }
1150 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1151 [[__maybe_unused__]] register bool defer_return_flag = false;
1152 if (false) {
1153 DEFER_ID_1_31:
1154 goto DEFER_END_ID_1_32;
1155 } else {
1156 (void)0 ;
1157 do {ELLIPSIS_CONTRACT(37, s, unreachable, false, "s", "assumption", "copy of non-existing string");} while (false);
1158 /* defer */
1159 [[__maybe_unused__, __deprecated__("dummy variable for better diagnostics")]]
1160 unsigned (*DEFER_LOC_ID_1_16)[DEFER_LOC_ID_0_2] = {};
1161 if (false) {
1162 DEFER_ID_1_32: {
1163 [[__maybe_unused__, __deprecated__("invalid termination of a deferred block")]]
1164 register bool const defer_return_flag = false, defer_break_flag = false, defer_continue_flag = false;
1165 {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");}
1166 }
1167 goto DEFER_ID_1_31;
1168 } else
1169 (void)0 ;
1171 do {
1172 /* return mode 2 */
1173 defer_return_flag = true;
1174 DEFER_LOC_ID_0_1 = ellipsis‿str8‿cpy_const‿_Inner(s);
1175 goto DEFER_ID_1_32;
1176 } while(false);
1177
1178 goto DEFER_ID_1_32;
1179 }
1180[[__maybe_unused__]] DEFER_END_ID_1_32:;
1181 return DEFER_LOC_ID_0_1;
1182}
1183
1197GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns") ellipsis‿str8* ellipsis‿str8‿remove(ellipsis‿str8 s[restrict static 1], size_t);
1198
1209inline
1211 memset(_ar, 0, _n*sizeof(_ar[0]));
1212}
1213
1224
1233GNU_ATTR_RETURNS_NONNULL STDC_ATTR_NODISCARD("functions for " "ellipsis∷str8" " need to keep pointer returns")
1234inline
1236 typeof(ellipsis‿str8*) DEFER_LOC_ID_0_1;
1237 if (__func__[0] == 'm' && __func__[1] == 'a' && __func__[2] == 'i' && __func__[3] == 'n' && !__func__[4]) {
1238 DEFER_LOC_ID_0_1 = (typeof(ellipsis‿str8*)) {};
1239 }
1240 [[__maybe_unused__]] register unsigned DEFER_LOC_ID_0_2 = 1U;
1241 [[__maybe_unused__]] register bool defer_return_flag = false;
1242 if (false) {
1243 DEFER_ID_1_33:
1244 goto DEFER_END_ID_1_34;
1245 } else {
1246 (void)0 ;
1247 ELLIPSIS_CONTRACT(39, __LOC_ID_0_7, abort, true, "__LOC(0, 1)", "precondition", "copy of non-existing string");
1248 do {
1249 /* return mode 2 */
1250 defer_return_flag = true;
1251 DEFER_LOC_ID_0_1 = ellipsis‿str8‿sub(__LOC_ID_0_7, 0, __LOC_ID_0_7->length);
1252 goto DEFER_ID_1_33;
1253 } while(false);
1254
1255 goto DEFER_ID_1_33;
1256 }
1257[[__maybe_unused__]] DEFER_END_ID_1_34:;
1258 return DEFER_LOC_ID_0_1;
1259}
1260
1264inline
1265int ellipsis‿str8‿compareInternal(void const* A, void const* B) {
1266 ellipsis‿str8‿base const* a = A;
1267 ellipsis‿str8‿base const* b = B;
1269}
1270
1283inline
1284void ellipsis‿str8‿sort(ellipsis‿str8* p, size_t offs, size_t len) {
1285 extern void (qsort)(void*, size_t, size_t, int (*)(const void*, const void*));
1286 if (offs < p->length) {
1287 size_t rlen = p->length - offs;
1288 if (rlen < len) len = rlen;
1289 if (len > 1) {
1290 qsort((void*)(p->array+offs), len, sizeof(ellipsis‿str8‿base), ellipsis‿str8‿compareInternal);
1291 }
1292 }
1293}
1294
1303inline
1304ellipsis‿str8‿base const* ellipsis‿str8‿search(ellipsis‿str8‿base const el[static 1], ellipsis‿str8 const* p, size_t offs, size_t len) {
1305 extern void* (bsearch)(void const*, void const*, size_t, size_t, int (*)(const void*, const void*));
1306 if (offs < p->length) {
1307 size_t rlen = p->length - offs;
1308 if (rlen < len) len = rlen;
1309 if (len > 0) {
1310 return bsearch((void const*)el, (void const*)(p->array+offs), len, sizeof(ellipsis‿str8‿base), ellipsis‿str8‿compareInternal);
1311 }
1312 }
1313 return nullptr;
1314}
1315
1327ellipsis‿str8* ellipsis‿str8‿construct(size_t __LOC_ID_0_8, char const s[static __LOC_ID_0_8]);
1328
1329#ifndef DOXYGEN_SPECIAL
1330#define ellipsis‿str8‿construct(LEN, S) ELLIPSIS_ERROR_CHECK(ellipsis‿str8‿construct, "unable to duplicate string", LEN, S)
1331#endif
1332
1339#define ELLIPSIS_STR8_CONSTRUCT(S) ellipsis‿str8‿construct(sizeof S - 1, "" S "")
1340
1365#define ELLIPSIS_STR8_STRING_LITERAL(S) ELLIPSIS_STR8_LITERAL(sizeof(S)-1, u8"" S u8"")
1366
1372int ellipsis‿str8‿fputs(ellipsis‿str8 const*restrict, FILE *);
1373
1380
1381#ifndef DOXYGEN_SPECIAL
1382#define ellipsis‿str8‿dup(S) ELLIPSIS_ERROR_CHECK(ellipsis‿str8‿dup, "unable to duplicate string", S)
1383#endif
1384
1385#endif
#define GNU_ATTR_COUNTED_BY(...)
Definition ellipsis-error.h:59
#define STDC_ATTR_NODISCARD(...)
Definition ellipsis-error.h:68
#define GNU_ATTR_MALLOC(...)
Definition ellipsis-error.h:44
#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
ellipsis‿str8 * ellipsis‿str8‿concat_inplace‿_Inner(ellipsis‿str8 const *s0, ellipsis‿str8 const *t)
Definition ellipsis-str8.c:192
ellipsis‿str8 * ellipsis‿str8‿shrink‿_Inner(ellipsis‿str8 s[restrict static 1], size_t length)
Definition ellipsis-str8.c:237
ellipsis‿str8 * ellipsis‿str8‿alloc‿_Inner(size_t len)
Definition ellipsis-str8.c:156
ellipsis‿str8 * ellipsis‿str8‿append‿_Inner(ellipsis‿str8 *restrict s, s->array[0] c)
Definition ellipsis-str8.c:168
ellipsis‿str8 * ellipsis‿str8‿grow‿_Inner(ellipsis‿str8 *restrict s, size_t length)
Definition ellipsis-str8.c:211
ellipsis‿str8 const * ellipsis‿str8‿cpy_const‿_Inner(ellipsis‿str8 const *restrict s)
Definition ellipsis-str8.c:266
ellipsis‿str8 * ellipsis‿str8‿sub‿_Inner(ellipsis‿str8 const *s, size_t pos, size_t len)
Definition ellipsis-str8.c:249
ellipsis‿str8 * ellipsis‿str8‿concat‿_Inner(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Definition ellipsis-str8.c:177
thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic
#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-str8.h:80
thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic
thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic
A structure with a flexible array member of base type ellipsis‿str8‿base.
Definition ellipsis-str8.h:150
ellipsis‿str8 * ellipsis‿str8‿concat‿_Ctra(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one.
Definition ellipsis-str8.h:857
ellipsis‿str8 * ellipsis‿str8‿sub(ellipsis‿str8 const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿str8 with len elements and copy the data from *s at position pos onward.
Definition ellipsis-str8.h:653
ellipsis‿str8 const * ellipsis‿str8‿cpy_const‿_Insta(ellipsis‿str8 const *restrict s)
Copy or link to a const-qualified ellipsis‿str8.
Definition ellipsis-str8.c:595
ellipsis‿str8 * ellipsis‿str8‿cpy(ellipsis‿str8 const *restrict __LOC_ID_0_7)
Allocate a ellipsis‿str8 and copy the data to which the parameter points into it.
Definition ellipsis-str8.h:1235
size_t const length
Current length of this instance.
Definition ellipsis-str8.h:159
ellipsis‿str8 * ellipsis‿str8‿concat_inplace(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one and delete s.
Definition ellipsis-str8.h:488
void ellipsis‿str8‿base‿destroy(size_t _n, ellipsis‿str8‿base _ar[static _n])
Destroy an element of type ellipsis‿str8‿base.
Definition ellipsis-str8.h:1210
ellipsis‿str8 * ellipsis‿str8‿append(ellipsis‿str8 *restrict s, ellipsis‿str8‿base c)
Append a new element to a ellipsis‿str8 and return a new object.
Definition ellipsis-str8.h:370
ellipsis‿str8 const * ellipsis‿str8‿cpy_const(ellipsis‿str8 const *restrict s)
Copy or link to a const-qualified ellipsis‿str8.
Definition ellipsis-str8.h:706
int ellipsis‿str8‿compare(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Compare two arrays lexicographically.
Definition ellipsis-str8.c:128
ellipsis‿str8 * ellipsis‿str8‿append‿_Ctra(ellipsis‿str8 *restrict s, ellipsis‿str8‿base c)
Append a new element to a ellipsis‿str8 and return a new object.
Definition ellipsis-str8.h:809
ellipsis‿str8 * ellipsis‿str8‿concat(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one.
Definition ellipsis-str8.h:418
ellipsis‿str8 * ellipsis‿str8‿concat‿_Insta(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one.
Definition ellipsis-str8.c:362
size_t length_mod
Modifiable length of this instance.
Definition ellipsis-str8.h:166
ellipsis‿str8‿base array[]
The current data array.
Definition ellipsis-str8.h:184
char * ellipsis‿str8‿dup(ellipsis‿str8 const *restrict)
Duplicate a ellipsis‿str8.
ellipsis‿str8 * ellipsis‿str8‿remove(ellipsis‿str8 s[restrict static 1], size_t)
Remove (at most) the indicated amount of elements from the ellipsis‿str8 return a new one and delete ...
Definition ellipsis-str8.c:117
ellipsis‿str8 * ellipsis‿str8‿alloc‿_Ctra(size_t len)
Allocate a ellipsis‿str8 with elements as given by the parameter.
Definition ellipsis-str8.h:754
ellipsis‿str8 const * ellipsis‿str8‿cpy_const‿_Ctra(ellipsis‿str8 const *restrict s)
Copy or link to a const-qualified ellipsis‿str8.
Definition ellipsis-str8.h:1145
void ellipsis‿str8‿cmove(ellipsis‿str8 const *__LOC_ID_0_5[restrict static 1], ellipsis‿str8 const **restrict __LOC_ID_0_6)
Move a ellipsis‿str8 const pointed to by the second parameter to the one pointed to by the first.
Definition ellipsis-str8.h:294
ellipsis‿str8 * ellipsis‿str8‿shrink(ellipsis‿str8 s[restrict static 1], size_t length)
Shrink the ellipsis‿str8 to exactly the indicated amount of elements return a new one and delete the ...
Definition ellipsis-str8.h:602
ellipsis‿str8 * ellipsis‿str8‿sub‿_Insta(ellipsis‿str8 const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿str8 with len elements and copy the data from *s at position pos onward.
Definition ellipsis-str8.c:553
ellipsis‿str8 * ellipsis‿str8‿concat_inplace‿_Insta(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one and delete s.
Definition ellipsis-str8.c:421
void ellipsis‿str8‿delete(ellipsis‿str8 const *)
Delete a ellipsis‿str8 pointed to by the parameter.
Definition ellipsis-str8.c:624
ellipsis‿str8 * ellipsis‿str8‿shrink‿_Ctra(ellipsis‿str8 s[restrict static 1], size_t length)
Shrink the ellipsis‿str8 to exactly the indicated amount of elements return a new one and delete the ...
Definition ellipsis-str8.h:1041
ellipsis‿str8 * ellipsis‿str8‿shrink‿_Insta(ellipsis‿str8 s[restrict static 1], size_t length)
Shrink the ellipsis‿str8 to exactly the indicated amount of elements return a new one and delete the ...
Definition ellipsis-str8.c:513
void ellipsis‿str8‿move(ellipsis‿str8 *__LOC_ID_0_3[restrict static 1], ellipsis‿str8 **restrict __LOC_ID_0_4)
Move a ellipsis‿str8 pointed to by the second parameter to the one pointed to by the first.
Definition ellipsis-str8.h:274
ellipsis‿str8‿base const * ellipsis‿str8‿search(ellipsis‿str8‿base const el[static 1], ellipsis‿str8 const *p, size_t offs, size_t len)
search for an element in a ellipsis‿str8
Definition ellipsis-str8.h:1304
ellipsis‿str8 * ellipsis‿str8‿append‿_Insta(ellipsis‿str8 *restrict s, ellipsis‿str8‿base c)
Append a new element to a ellipsis‿str8 and return a new object.
Definition ellipsis-str8.c:325
ellipsis‿str8 * ellipsis‿str8‿grow(ellipsis‿str8 *restrict s, size_t length)
Grow the ellipsis‿str8 to (at least) the indicated amount of elements return a new one and delete the...
Definition ellipsis-str8.h:543
ellipsis‿str8 * ellipsis‿str8‿construct(size_t __LOC_ID_0_8, char const s[static __LOC_ID_0_8])
Construct a ellipsis‿str8 from a string literal and return a pointer to it.
ellipsis‿str8 * ellipsis‿str8‿sub‿_Ctra(ellipsis‿str8 const *restrict s, size_t pos, size_t len)
Allocate a ellipsis‿str8 with len elements and copy the data from *s at position pos onward.
Definition ellipsis-str8.h:1092
ellipsis‿str8 * ellipsis‿str8‿alloc(size_t len)
Allocate a ellipsis‿str8 with elements as given by the parameter.
Definition ellipsis-str8.h:315
ellipsis‿str8 * ellipsis‿str8‿concat_inplace‿_Ctra(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one and delete s.
Definition ellipsis-str8.h:927
size_t const capacity
Maximal length of this instance.
Definition ellipsis-str8.h:176
ellipsis‿str8 * ellipsis‿str8‿grow‿_Ctra(ellipsis‿str8 *restrict s, size_t length)
Grow the ellipsis‿str8 to (at least) the indicated amount of elements return a new one and delete the...
Definition ellipsis-str8.h:982
ellipsis‿str8 * ellipsis‿str8‿grow‿_Insta(ellipsis‿str8 *restrict s, size_t length)
Grow the ellipsis‿str8 to (at least) the indicated amount of elements return a new one and delete the...
Definition ellipsis-str8.c:465
void ellipsis‿str8‿sort(ellipsis‿str8 *p, size_t offs, size_t len)
sort a ellipsis‿str8 in place.
Definition ellipsis-str8.h:1284
ellipsis‿str8 * ellipsis‿str8‿alloc‿_Insta(size_t len)
Allocate a ellipsis‿str8 with elements as given by the parameter.
Definition ellipsis-str8.c:281
int ellipsis‿str8‿compareInternal(void const *A, void const *B)
Definition ellipsis-str8.h:1265
int ellipsis‿str8‿base‿compare(ellipsis‿str8‿base const *__LOC_ID_0_1, ellipsis‿str8‿base const *__LOC_ID_0_2)
Definition ellipsis-str8.h:21
int ellipsis‿str8‿fputs(ellipsis‿str8 const *restrict, FILE *)
Write a ellipsis‿str8 to a stream.
unsigned char ellipsis‿str8‿base
Definition ellipsis-str8.h:15