A structure with a flexible array member of base type ellipsis‿sarray‿base. More...
#include <ellipsis-sarray.h>
Public Types | |
typedef size_t | ellipsis‿sarray‿base |
Public Member Functions | |
ellipsis‿sarray * | ellipsis‿sarray‿alloc‿_Ctra (size_t len) |
Allocate a ellipsis‿sarray with elements as given by the parameter. | |
ellipsis‿sarray * | ellipsis‿sarray‿alloc‿_Insta (size_t len) |
Allocate a ellipsis‿sarray with elements as given by the parameter. | |
ellipsis‿sarray * | ellipsis‿sarray‿alloc (size_t len) |
Allocate a ellipsis‿sarray with elements as given by the parameter. | |
ellipsis‿sarray * | ellipsis‿sarray‿append‿_Ctra (ellipsis‿sarray *restrict s, ellipsis‿sarray‿base c) |
Append a new element to a ellipsis‿sarray and return a new object. | |
ellipsis‿sarray * | ellipsis‿sarray‿append‿_Insta (ellipsis‿sarray *restrict s, ellipsis‿sarray‿base c) |
Append a new element to a ellipsis‿sarray and return a new object. | |
ellipsis‿sarray * | ellipsis‿sarray‿append (ellipsis‿sarray *restrict s, ellipsis‿sarray‿base c) |
Append a new element to a ellipsis‿sarray and return a new object. | |
int | ellipsis‿sarray‿base‿compare (ellipsis‿sarray‿base const _a[static 1], ellipsis‿sarray‿base const _b[static 1]) |
Compare two elements of type ellipsis‿sarray‿base. | |
void | ellipsis‿sarray‿base‿destroy (size_t _n, ellipsis‿sarray‿base _ar[static _n]) |
Destroy an element of type ellipsis‿sarray‿base. | |
void | ellipsis‿sarray‿cmove (ellipsis‿sarray const *__LOC_ID_0_3[restrict static 1], ellipsis‿sarray const **restrict __LOC_ID_0_4) |
Move a ellipsis‿sarray const pointed to by the second parameter to the one pointed to by the first. | |
int | ellipsis‿sarray‿compare (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Compare two arrays lexicographically. | |
int | ellipsis‿sarray‿compareInternal (void const *A, void const *B) |
ellipsis‿sarray * | ellipsis‿sarray‿concat‿_Ctra (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one. | |
ellipsis‿sarray * | ellipsis‿sarray‿concat‿_Insta (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one. | |
ellipsis‿sarray * | ellipsis‿sarray‿concat (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one. | |
ellipsis‿sarray * | ellipsis‿sarray‿concat_inplace‿_Ctra (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one and delete s . | |
ellipsis‿sarray * | ellipsis‿sarray‿concat_inplace‿_Insta (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one and delete s . | |
ellipsis‿sarray * | ellipsis‿sarray‿concat_inplace (ellipsis‿sarray const *s, ellipsis‿sarray const *t) |
Concatenate two ellipsis‿sarray into a new one and delete s . | |
ellipsis‿sarray * | ellipsis‿sarray‿cpy (ellipsis‿sarray const *restrict __LOC_ID_0_5) |
Allocate a ellipsis‿sarray and copy the data to which the parameter points into it. | |
ellipsis‿sarray const * | ellipsis‿sarray‿cpy_const‿_Ctra (ellipsis‿sarray const *restrict s) |
Copy or link to a const -qualified ellipsis‿sarray . | |
ellipsis‿sarray const * | ellipsis‿sarray‿cpy_const‿_Insta (ellipsis‿sarray const *restrict s) |
Copy or link to a const -qualified ellipsis‿sarray . | |
ellipsis‿sarray const * | ellipsis‿sarray‿cpy_const (ellipsis‿sarray const *restrict s) |
Copy or link to a const -qualified ellipsis‿sarray . | |
void | ellipsis‿sarray‿delete (ellipsis‿sarray const *) |
Delete a ellipsis‿sarray pointed to by the parameter. | |
ellipsis‿sarray * | ellipsis‿sarray‿grow‿_Ctra (ellipsis‿sarray *restrict s, size_t length) |
Grow the ellipsis‿sarray to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿sarray * | ellipsis‿sarray‿grow‿_Insta (ellipsis‿sarray *restrict s, size_t length) |
Grow the ellipsis‿sarray to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿sarray * | ellipsis‿sarray‿grow (ellipsis‿sarray *restrict s, size_t length) |
Grow the ellipsis‿sarray to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
void | ellipsis‿sarray‿move (ellipsis‿sarray *__LOC_ID_0_1[restrict static 1], ellipsis‿sarray **restrict __LOC_ID_0_2) |
Move a ellipsis‿sarray pointed to by the second parameter to the one pointed to by the first. | |
ellipsis‿sarray * | ellipsis‿sarray‿remove (ellipsis‿sarray s[restrict static 1], size_t) |
Remove (at most) the indicated amount of elements from the ellipsis‿sarray return a new one and delete s . | |
ellipsis‿sarray‿base const * | ellipsis‿sarray‿search (ellipsis‿sarray‿base const el[static 1], ellipsis‿sarray const *p, size_t offs, size_t len) |
search for an element in a ellipsis‿sarray | |
ellipsis‿sarray * | ellipsis‿sarray‿shrink‿_Ctra (ellipsis‿sarray s[restrict static 1], size_t length) |
Shrink the ellipsis‿sarray to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿sarray * | ellipsis‿sarray‿shrink‿_Insta (ellipsis‿sarray s[restrict static 1], size_t length) |
Shrink the ellipsis‿sarray to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿sarray * | ellipsis‿sarray‿shrink (ellipsis‿sarray s[restrict static 1], size_t length) |
Shrink the ellipsis‿sarray to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
void | ellipsis‿sarray‿sort (ellipsis‿sarray *p, size_t offs, size_t len) |
sort a ellipsis‿sarray in place. | |
ellipsis‿sarray * | ellipsis‿sarray‿sub‿_Ctra (ellipsis‿sarray const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿sarray with len elements and copy the data from *s at position pos onward. | |
ellipsis‿sarray * | ellipsis‿sarray‿sub‿_Insta (ellipsis‿sarray const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿sarray with len elements and copy the data from *s at position pos onward. | |
ellipsis‿sarray * | ellipsis‿sarray‿sub (ellipsis‿sarray const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿sarray with len elements and copy the data from *s at position pos onward. | |
Data Fields | |
ellipsis‿sarray‿base | array [] |
The current data array. | |
size_t const | length |
Current length of this instance. | |
Private Attributes | |
size_t const | capacity |
Maximal length of this instance. | |
size_t | length_mod |
Modifiable length of this instance. | |
Related Symbols | |
(Note that these are not member symbols.) | |
#define | ELLIPSIS_SARRAY_LITERAL_LOCAL(N, ...) |
Create a literal of type ellipsis‿sarray , where the array component is initialized with the arguments. | |
A structure with a flexible array member of base type ellipsis‿sarray‿base.
The ellipsis‿sarray
type by itself only works if allocated, you should never declare a variable of it; but see below for creating literals of this type. Functions and macros are provided to allocate, delete, copy etc.
ellipsis‿sarray
keeps track of two different lengths
length
, an actual length that holds the number of elements that are currently storedcapacity
, a maximal length to which the current fa structure may be expanded without reallocation. The special value 0
indicates that this instance is a literal and may not be reallocated at all.The purpose is to handle additions and removal of elements relatively efficient, without having to reallocated and copy the whole structure each time.
Use the member length
to query the current length and array
to access the members. Do not touch the other members.
The contents of this file here is automatically expanded from the meta-source file "generate/xfiles/ellipsis-fa-xcode.eLh". That source has to be included by eĿlipsis with a unit name (here ellipsis‿sarray) set to the name that the new array structure should have. Before that, the type ¤::base
(here ellipsis‿sarray‿base) has to be defined to the base type of the array. The include should then be done by using include_source; when doing so the macro ELLIPSIS_FA_NAME
(here ellipsis_sarray
) has to be set to a non-composed name that will be used as a prefix for the macros that are defined.
There are two other features that can be used to fine-tune the type. They depend on the macros ELLIPSIS_HAS_DESTROY
and ELLIPSIS_HAS_COMPARE
that can be added with similar __prefix__(bind ...)
arguments as above. If these are defined, ellipsis‿sarray‿base‿destroy and ellipsis‿sarray‿base‿compare are supposed to pre-exist, respectively; if they are not defined, the corresponding function is synthesized to a default.
A similar mechanism is in place for the .c
file.
typedef size_t ellipsis‿sarray‿base |
|
inline |
Allocate a ellipsis‿sarray
with elements as given by the parameter.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿alloc‿_Ctra(), ellipsis‿sarray‿alloc‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿alloc‿_Ctra().
|
inline |
Allocate a ellipsis‿sarray
with elements as given by the parameter.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿alloc().
|
inline |
Allocate a ellipsis‿sarray
with elements as given by the parameter.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿alloc‿_Insta(), ellipsis‿sarray‿alloc(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿alloc().
|
inline |
Append a new element to a ellipsis‿sarray
and return a new object.
If the array is statically allocated an allocated copy of it is made first.
A pointer to a new or the old array may be returned, and so you should update all pointer variables that previous held the pointer accordingly.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned and the old array is maintained.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿append‿_Ctra(), ellipsis‿sarray‿append‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿append‿_Ctra().
|
inline |
Append a new element to a ellipsis‿sarray
and return a new object.
If the array is statically allocated an allocated copy of it is made first.
A pointer to a new or the old array may be returned, and so you should update all pointer variables that previous held the pointer accordingly.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned and the old array is maintained.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿append().
|
inline |
Append a new element to a ellipsis‿sarray
and return a new object.
If the array is statically allocated an allocated copy of it is made first.
A pointer to a new or the old array may be returned, and so you should update all pointer variables that previous held the pointer accordingly.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned and the old array is maintained.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿append‿_Insta(), ellipsis‿sarray‿append(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿append().
|
inline |
Compare two elements of type ellipsis‿sarray‿base.
This is a synthesized function that compares the byte representation of the pointed-to elements.
Referenced by ellipsis‿sarray‿compareInternal().
|
inline |
Destroy an element of type ellipsis‿sarray‿base.
This is a synthesized function that sets all bytes of the array to 0
.
|
inline |
Move a ellipsis‿sarray const
pointed to by the second parameter to the one pointed to by the first.
If target
is not null before, the old pointed-to object is deleted.
References ellipsis‿sarray‿delete().
int ellipsis‿sarray‿compare | ( | ellipsis‿sarray const * | s, |
ellipsis‿sarray const * | t | ||
) |
Compare two arrays lexicographically.
This synthesizes and uses a function ellipsis‿sarray‿base‿compare that compares two pointed-to elements of type ellipsis‿sarray‿base, comparing the byte representation of the pointed-to elements.
|
inline |
References ellipsis‿sarray‿base‿compare().
Referenced by ellipsis‿sarray‿search(), and ellipsis‿sarray‿sort().
|
inline |
Concatenate two ellipsis‿sarray
into a new one.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿concat‿_Ctra(), ellipsis‿sarray‿concat‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿concat‿_Ctra().
|
inline |
Concatenate two ellipsis‿sarray
into a new one.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿concat().
|
inline |
Concatenate two ellipsis‿sarray
into a new one.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿concat‿_Insta(), ellipsis‿sarray‿concat(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿concat().
|
inline |
Concatenate two ellipsis‿sarray
into a new one and delete s
.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
The effect is mostly as if in the following
only that the storage of s
may be reused more efficiently.
If s
is a literal, a copy of it is made and then it is concatenated.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Note that in particular, as for ellipsis‿sarray‿delete(), *s
may be deleted although it is const
-qualified.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿concat_inplace‿_Ctra(), ellipsis‿sarray‿concat_inplace‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿concat_inplace‿_Ctra().
|
inline |
Concatenate two ellipsis‿sarray
into a new one and delete s
.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
The effect is mostly as if in the following
only that the storage of s
may be reused more efficiently.
If s
is a literal, a copy of it is made and then it is concatenated.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Note that in particular, as for ellipsis‿sarray‿delete(), *s
may be deleted although it is const
-qualified.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿concat_inplace().
|
inline |
Concatenate two ellipsis‿sarray
into a new one and delete s
.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
The effect is mostly as if in the following
only that the storage of s
may be reused more efficiently.
If s
is a literal, a copy of it is made and then it is concatenated.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Note that in particular, as for ellipsis‿sarray‿delete(), *s
may be deleted although it is const
-qualified.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿concat_inplace‿_Insta(), ellipsis‿sarray‿concat_inplace(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿concat_inplace().
|
inline |
Allocate a ellipsis‿sarray
and copy the data to which the parameter points into it.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿sub(), and ELLIPSIS_CONTRACT.
|
inline |
Copy or link to a const
-qualified ellipsis‿sarray
.
If the pointed to object has been allocated statically, only a pointer to that object is returned. If the object has been allocated dynamically, a copy as by ellipsis‿sarray‿cpy is produced.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿cpy_const‿_Ctra(), ellipsis‿sarray‿cpy_const‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿cpy_const‿_Ctra().
|
inline |
Copy or link to a const
-qualified ellipsis‿sarray
.
If the pointed to object has been allocated statically, only a pointer to that object is returned. If the object has been allocated dynamically, a copy as by ellipsis‿sarray‿cpy is produced.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿cpy_const().
|
inline |
Copy or link to a const
-qualified ellipsis‿sarray
.
If the pointed to object has been allocated statically, only a pointer to that object is returned. If the object has been allocated dynamically, a copy as by ellipsis‿sarray‿cpy is produced.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿cpy_const‿_Insta(), ellipsis‿sarray‿cpy_const(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿sarray‿cpy_const().
void ellipsis‿sarray‿delete | ( | ellipsis‿sarray const * | ) |
Delete a ellipsis‿sarray
pointed to by the parameter.
ELLIPSIS_SARRAY_LITERAL
and will just do nothing, then.This synthesizes and uses a function ellipsis‿sarray‿base‿destroy on the deleted elements, setting the byte representation of the pointed-to elements to 0
.
Referenced by ellipsis‿sarray‿cmove(), and ellipsis‿sarray‿move().
|
inline |
Grow the ellipsis‿sarray
to (at least) the indicated amount of elements return a new one and delete the old one, if any.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
If s
is non-null and cannot be grown, s
is returned unchanged.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References capacity, ellipsis‿sarray‿grow‿_Ctra(), ellipsis‿sarray‿grow‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿grow‿_Ctra().
|
inline |
Grow the ellipsis‿sarray
to (at least) the indicated amount of elements return a new one and delete the old one, if any.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
If s
is non-null and cannot be grown, s
is returned unchanged.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿grow().
|
inline |
Grow the ellipsis‿sarray
to (at least) the indicated amount of elements return a new one and delete the old one, if any.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
If s
is null on entry a new array is returned, if possible, otherwise a null pointer is returned.
If s
is non-null and cannot be grown, s
is returned unchanged.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References capacity, ellipsis‿sarray‿grow‿_Insta(), ellipsis‿sarray‿grow(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿grow().
|
inline |
Move a ellipsis‿sarray
pointed to by the second parameter to the one pointed to by the first.
If target
is not null before, the old pointed-to object is deleted.
References ellipsis‿sarray‿delete().
ellipsis‿sarray * ellipsis‿sarray‿remove | ( | ellipsis‿sarray | s[restrict static 1], |
size_t | |||
) |
Remove (at most) the indicated amount of elements from the ellipsis‿sarray
return a new one and delete s
.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
This synthesizes and uses a function ellipsis‿sarray‿base‿destroy on the removed elements, setting the byte representation of the pointed-to elements to 0
.
References ELLIPSIS_CONTRACT.
|
inline |
search for an element in a ellipsis‿sarray
The same restrictions for offs
and len
hold as for ellipsis‿sarray‿sort
.
The return is the same as for the bsearch
C library feature.
References array, ellipsis‿sarray‿compareInternal(), and length.
|
inline |
Shrink the ellipsis‿sarray
to exactly the indicated amount of elements return a new one and delete the old one, if any.
If the requested length is larger than the current, s
is unchanged and is returned.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Use this function to reduce the memory footprint if you find that necessary once you know that the used length of your array will remain stable.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References capacity, ellipsis‿sarray‿shrink‿_Ctra(), ellipsis‿sarray‿shrink‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿shrink‿_Ctra().
|
inline |
Shrink the ellipsis‿sarray
to exactly the indicated amount of elements return a new one and delete the old one, if any.
If the requested length is larger than the current, s
is unchanged and is returned.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Use this function to reduce the memory footprint if you find that necessary once you know that the used length of your array will remain stable.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿shrink().
|
inline |
Shrink the ellipsis‿sarray
to exactly the indicated amount of elements return a new one and delete the old one, if any.
If the requested length is larger than the current, s
is unchanged and is returned.
*s
may or not be replaced to an new object for internal maintenance reasons. Do not expect it to remain the same and update the pointers you are holding to it.
Use this function to reduce the memory footprint if you find that necessary once you know that the used length of your array will remain stable.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References capacity, ellipsis‿sarray‿shrink‿_Insta(), ellipsis‿sarray‿shrink(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿shrink().
|
inline |
sort a ellipsis‿sarray
in place.
Sort array of length len
starting from offs
according to comparison function ellipsis‿sarray‿base‿compare.
offs
is outside the range, nothing is done.len
is adjusted to the minimum of len
and ellipsis‿sarray‿length-pos
.len
is zero, nothing is done. References array, ellipsis‿sarray‿compareInternal(), and length.
|
inline |
Allocate a ellipsis‿sarray
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿sub‿_Ctra(), ellipsis‿sarray‿sub‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿sub‿_Ctra().
|
inline |
Allocate a ellipsis‿sarray
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿sarray‿sub().
|
inline |
Allocate a ellipsis‿sarray
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿sarray
cannot be allocated, a null pointer is returned.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
defer needs braces and a semicolon
end inner defer anchor, level 1
References ellipsis‿sarray‿sub‿_Insta(), ellipsis‿sarray‿sub(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿sarray‿cpy(), and ellipsis‿sarray‿sub().
|
related |
Create a literal of type ellipsis‿sarray
, where the array
component is initialized with the arguments.
This results in an lvalue of type ellipsis‿sarray
for an object that has static storage duration and that is const
-qualified.
Most functions that are provided for ellipsis‿sarray
need to be able to reallocate the structure, so they will produce an error on a literal that is created with this macro. A notable exception of this is ellipsis‿sarray‿delete
which will just do nothing on such an object.
constexpr
compound literals may not be of union type, this is not yet provided as constexpr
. ellipsis‿sarray‿base array[] |
The current data array.
Referenced by ellipsis‿infra‿fileno(), ellipsis‿infra‿line(), ellipsis‿infra‿newline(), ellipsis‿sarray‿alloc‿_Inner(), ellipsis‿sarray‿compare(), ellipsis‿sarray‿concat‿_Inner(), ellipsis‿sarray‿concat_inplace‿_Inner(), ellipsis‿sarray‿delete(), ellipsis‿sarray‿search(), ellipsis‿sarray‿sort(), and ellipsis‿sarray‿sub‿_Inner().
|
private |
Maximal length of this instance.
Also serves to encode the fact that a ellipsis‿sarray
is statically allocated. Do not mess with it.
Referenced by ellipsis‿sarray‿concat_inplace‿_Inner(), ellipsis‿sarray‿grow‿_Ctra(), ellipsis‿sarray‿grow(), ellipsis‿sarray‿shrink‿_Ctra(), and ellipsis‿sarray‿shrink().
size_t const length |
Current length of this instance.
Referenced by ellipsis‿infra‿down(), ellipsis‿infra‿fileno(), ellipsis‿infra‿line(), ellipsis‿infra‿newline(), ellipsis‿sarray‿alloc‿_Inner(), ellipsis‿sarray‿compare(), ellipsis‿sarray‿concat‿_Inner(), ellipsis‿sarray‿concat_inplace‿_Inner(), ellipsis‿sarray‿delete(), ellipsis‿sarray‿grow‿_Ctra(), ellipsis‿sarray‿grow‿_Inner(), ellipsis‿sarray‿grow(), ellipsis‿sarray‿search(), ellipsis‿sarray‿shrink‿_Ctra(), ellipsis‿sarray‿shrink(), ellipsis‿sarray‿sort(), ellipsis‿sarray‿sub‿_Ctra(), ellipsis‿sarray‿sub‿_Inner(), and ellipsis‿sarray‿sub().
|
private |
Modifiable length of this instance.
Referenced by ellipsis‿sarray‿alloc‿_Inner(), ellipsis‿sarray‿concat_inplace‿_Inner(), and ellipsis‿sarray‿sub‿_Inner().