5#define ELLIPSIS_STR8_H 1
22 if (!__LOC_ID_0_1[0] + !__LOC_ID_0_2[0]) {
23 return !__LOC_ID_0_2[0] - !__LOC_ID_0_1[0];
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);
43#define STRINGIFY(...) STRINGIFY_(__VA_ARGS__)
44#define STRINGIFY_(...) #__VA_ARGS__
46#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...) \
48 static char const contract_format_ ## COUNT[] = \
49 __FILE__ ":" STRINGIFY(__LINE__) ": violation of " CTYPE " `" CSTR "`" __VA_OPT__(", ") __VA_ARGS__ "\n";\
51 ? fputs(contract_format_ ## COUNT, stderr) \
55#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
58 : (ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR __VA_OPT__(,) __VA_ARGS__) \
63#define ELLIPSIS_TO_VOIDS(...) ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))
65#define ELLIPSIS_TEST_ICE(...) (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)
67#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...) \
69 ELLIPSIS_TEST_ICE(__VA_ARGS__), \
70 ellipsis‿contracts‿is_ice*: (__VA_ARGS__), \
73#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...) \
75 static_assert(ELLIPSIS_CONTRACT_ICE_OR_TRUE(COND), \
76 "compile time violation of " CTYPE " " CSTR \
77 __VA_OPT__(", ") __VA_ARGS__ );\
80#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...) \
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__));\
151#ifndef DOXYGEN_SPECIAL
165 [[deprecated(
"use const member length instead")]]
167#ifndef DOXYGEN_SPECIAL
187#define ELLIPSIS_STR8_OVERLAY(N) \
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];\
198#define ELLIPSIS_STR8_STATIC(N, ...) \
200 static const ELLIPSIS_STR8_OVERLAY( \
201 sizeof((ellipsis‿str8‿base[]){__VA_ARGS__ }) \
202 /sizeof(ellipsis‿str8‿base)) \
205 .array = {__VA_ARGS__ }, \
206 };&__LOC_ID_1_1;})->fa)
228#if __clang__ && (__clang_major__ < 30)
229#define ELLIPSIS_STR8_LITERAL_LOCAL(N, ...) ELLIPSIS_STR8_STATIC(N, __VA_ARGS__)
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))) \
237 .array = {__VA_ARGS__ }, \
241#define ELLIPSIS_STR8_LITERAL_GLOBAL(N, ...) \
242 ((const ELLIPSIS_STR8_OVERLAY( \
243 sizeof((ellipsis‿str8‿base[]){__VA_ARGS__ }) \
244 /sizeof(ellipsis‿str8‿base))) \
247 .array = {__VA_ARGS__ }, \
250#define ELLIPSIS_STR8_LITERAL ELLIPSIS_STR8_LITERAL_LOCAL
278 *__LOC_ID_0_3= *__LOC_ID_0_4;
279 *__LOC_ID_0_4=
nullptr;
281 *__LOC_ID_0_3=
nullptr;
298 *__LOC_ID_0_5= *__LOC_ID_0_6;
299 *__LOC_ID_0_6=
nullptr;
301 *__LOC_ID_0_5=
nullptr;
317 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
320 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
321 [[__maybe_unused__]]
register bool defer_return_flag =
false;
324 goto DEFER_END_ID_1_2;
328 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
329 unsigned (*DEFER_LOC_ID_1_1)[DEFER_LOC_ID_0_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");}
342 defer_return_flag =
true;
349[[__maybe_unused__]] DEFER_END_ID_1_2:;
350 return DEFER_LOC_ID_0_1;
372 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
375 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
376 [[__maybe_unused__]]
register bool defer_return_flag =
false;
379 goto DEFER_END_ID_1_4;
383 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
384 unsigned (*DEFER_LOC_ID_1_2)[DEFER_LOC_ID_0_2] = {};
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");}
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);
398 defer_return_flag =
true;
405[[__maybe_unused__]] DEFER_END_ID_1_4:;
406 return DEFER_LOC_ID_0_1;
420 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
423 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
424 [[__maybe_unused__]]
register bool defer_return_flag =
false;
427 goto DEFER_END_ID_1_6;
431 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
432 unsigned (*DEFER_LOC_ID_1_3)[DEFER_LOC_ID_0_2] = {};
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");}
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);
447 defer_return_flag =
true;
454[[__maybe_unused__]] DEFER_END_ID_1_6:;
455 return DEFER_LOC_ID_0_1;
490 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
493 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
494 [[__maybe_unused__]]
register bool defer_return_flag =
false;
497 goto DEFER_END_ID_1_8;
501 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
502 unsigned (*DEFER_LOC_ID_1_4)[DEFER_LOC_ID_0_2] = {};
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");}
515 defer_return_flag =
true;
522[[__maybe_unused__]] DEFER_END_ID_1_8:;
523 return DEFER_LOC_ID_0_1;
545 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
548 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
549 [[__maybe_unused__]]
register bool defer_return_flag =
false;
552 goto DEFER_END_ID_1_10;
556 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
557 unsigned (*DEFER_LOC_ID_1_5)[DEFER_LOC_ID_0_2] = {};
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");}
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);
572 defer_return_flag =
true;
579[[__maybe_unused__]] DEFER_END_ID_1_10:;
580 return DEFER_LOC_ID_0_1;
604 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
607 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
608 [[__maybe_unused__]]
register bool defer_return_flag =
false;
611 goto DEFER_END_ID_1_12;
615 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
616 unsigned (*DEFER_LOC_ID_1_6)[DEFER_LOC_ID_0_2] = {};
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");}
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);
632 defer_return_flag =
true;
639[[__maybe_unused__]] DEFER_END_ID_1_12:;
640 return DEFER_LOC_ID_0_1;
655 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
658 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
659 [[__maybe_unused__]]
register bool defer_return_flag =
false;
662 goto DEFER_END_ID_1_14;
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);
668 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
669 unsigned (*DEFER_LOC_ID_1_7)[DEFER_LOC_ID_0_2] = {};
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");}
682 defer_return_flag =
true;
689[[__maybe_unused__]] DEFER_END_ID_1_14:;
690 return DEFER_LOC_ID_0_1;
708 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
711 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
712 [[__maybe_unused__]]
register bool defer_return_flag =
false;
715 goto DEFER_END_ID_1_16;
718 do {
ELLIPSIS_CONTRACT(18, s, abort,
true,
"s",
"assertion",
"copy of non-existing string");}
while (
false);
720 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
721 unsigned (*DEFER_LOC_ID_1_8)[DEFER_LOC_ID_0_2] = {};
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");}
734 defer_return_flag =
true;
741[[__maybe_unused__]] DEFER_END_ID_1_16:;
742 return DEFER_LOC_ID_0_1;
756 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
759 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
760 [[__maybe_unused__]]
register bool defer_return_flag =
false;
763 goto DEFER_END_ID_1_18;
767 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
768 unsigned (*DEFER_LOC_ID_1_9)[DEFER_LOC_ID_0_2] = {};
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");}
781 defer_return_flag =
true;
788[[__maybe_unused__]] DEFER_END_ID_1_18:;
789 return DEFER_LOC_ID_0_1;
811 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
814 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
815 [[__maybe_unused__]]
register bool defer_return_flag =
false;
818 goto DEFER_END_ID_1_20;
822 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
823 unsigned (*DEFER_LOC_ID_1_10)[DEFER_LOC_ID_0_2] = {};
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");}
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);
837 defer_return_flag =
true;
844[[__maybe_unused__]] DEFER_END_ID_1_20:;
845 return DEFER_LOC_ID_0_1;
859 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
862 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
863 [[__maybe_unused__]]
register bool defer_return_flag =
false;
866 goto DEFER_END_ID_1_22;
870 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
871 unsigned (*DEFER_LOC_ID_1_11)[DEFER_LOC_ID_0_2] = {};
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");}
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);
886 defer_return_flag =
true;
893[[__maybe_unused__]] DEFER_END_ID_1_22:;
894 return DEFER_LOC_ID_0_1;
929 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
932 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
933 [[__maybe_unused__]]
register bool defer_return_flag =
false;
936 goto DEFER_END_ID_1_24;
940 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
941 unsigned (*DEFER_LOC_ID_1_12)[DEFER_LOC_ID_0_2] = {};
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");}
954 defer_return_flag =
true;
961[[__maybe_unused__]] DEFER_END_ID_1_24:;
962 return DEFER_LOC_ID_0_1;
984 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
987 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
988 [[__maybe_unused__]]
register bool defer_return_flag =
false;
991 goto DEFER_END_ID_1_26;
995 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
996 unsigned (*DEFER_LOC_ID_1_13)[DEFER_LOC_ID_0_2] = {};
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");}
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);
1011 defer_return_flag =
true;
1018[[__maybe_unused__]] DEFER_END_ID_1_26:;
1019 return DEFER_LOC_ID_0_1;
1043 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
1046 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
1047 [[__maybe_unused__]]
register bool defer_return_flag =
false;
1050 goto DEFER_END_ID_1_28;
1054 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
1055 unsigned (*DEFER_LOC_ID_1_14)[DEFER_LOC_ID_0_2] = {};
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");}
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);
1071 defer_return_flag =
true;
1078[[__maybe_unused__]] DEFER_END_ID_1_28:;
1079 return DEFER_LOC_ID_0_1;
1094 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
1097 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
1098 [[__maybe_unused__]]
register bool defer_return_flag =
false;
1101 goto DEFER_END_ID_1_30;
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);
1107 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
1108 unsigned (*DEFER_LOC_ID_1_15)[DEFER_LOC_ID_0_2] = {};
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");}
1121 defer_return_flag =
true;
1128[[__maybe_unused__]] DEFER_END_ID_1_30:;
1129 return DEFER_LOC_ID_0_1;
1147 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
1150 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
1151 [[__maybe_unused__]]
register bool defer_return_flag =
false;
1154 goto DEFER_END_ID_1_32;
1157 do {
ELLIPSIS_CONTRACT(37, s, unreachable,
false,
"s",
"assumption",
"copy of non-existing string");}
while (
false);
1159 [[__maybe_unused__, __deprecated__(
"dummy variable for better diagnostics")]]
1160 unsigned (*DEFER_LOC_ID_1_16)[DEFER_LOC_ID_0_2] = {};
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");}
1173 defer_return_flag =
true;
1180[[__maybe_unused__]] DEFER_END_ID_1_32:;
1181 return DEFER_LOC_ID_0_1;
1211 memset(_ar, 0, _n*
sizeof(_ar[0]));
1237 if (__func__[0] ==
'm' && __func__[1] ==
'a' && __func__[2] ==
'i' && __func__[3] ==
'n' && !__func__[4]) {
1240 [[__maybe_unused__]]
register unsigned DEFER_LOC_ID_0_2 = 1U;
1241 [[__maybe_unused__]]
register bool defer_return_flag =
false;
1244 goto DEFER_END_ID_1_34;
1247 ELLIPSIS_CONTRACT(39, __LOC_ID_0_7, abort,
true,
"__LOC(0, 1)",
"precondition",
"copy of non-existing string");
1250 defer_return_flag =
true;
1257[[__maybe_unused__]] DEFER_END_ID_1_34:;
1258 return DEFER_LOC_ID_0_1;
1285 extern void (qsort)(
void*, size_t, size_t, int (*)(
const void*,
const void*));
1287 size_t rlen = p->
length - offs;
1288 if (rlen < len) len = rlen;
1305 extern void* (bsearch)(
void const*,
void const*,
size_t,
size_t,
int (*)(
const void*,
const void*));
1307 size_t rlen = p->
length - offs;
1308 if (rlen < len) len = rlen;
1329#ifndef DOXYGEN_SPECIAL
1330#define ellipsis‿str8‿construct(LEN, S) ELLIPSIS_ERROR_CHECK(ellipsis‿str8‿construct, "unable to duplicate string", LEN, S)
1339#define ELLIPSIS_STR8_CONSTRUCT(S) ellipsis‿str8‿construct(sizeof S - 1, "" S "")
1365#define ELLIPSIS_STR8_STRING_LITERAL(S) ELLIPSIS_STR8_LITERAL(sizeof(S)-1, u8"" S u8"")
1381#ifndef DOXYGEN_SPECIAL
1382#define ellipsis‿str8‿dup(S) ELLIPSIS_ERROR_CHECK(ellipsis‿str8‿dup, "unable to duplicate string", S)
#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