A structure with a flexible array member of base type ellipsis‿str32‿base. More...
#include <ellipsis-str32.h>
Public Types | |
typedef char32_t | ellipsis‿str32‿base |
Public Member Functions | |
ellipsis‿str32 * | ellipsis‿str32‿alloc‿_Ctra (size_t len) |
Allocate a ellipsis‿str32 with elements as given by the parameter. | |
ellipsis‿str32 * | ellipsis‿str32‿alloc‿_Insta (size_t len) |
Allocate a ellipsis‿str32 with elements as given by the parameter. | |
ellipsis‿str32 * | ellipsis‿str32‿alloc (size_t len) |
Allocate a ellipsis‿str32 with elements as given by the parameter. | |
ellipsis‿str32 * | ellipsis‿str32‿append‿_Ctra (ellipsis‿str32 *restrict s, ellipsis‿str32‿base c) |
Append a new element to a ellipsis‿str32 and return a new object. | |
ellipsis‿str32 * | ellipsis‿str32‿append‿_Insta (ellipsis‿str32 *restrict s, ellipsis‿str32‿base c) |
Append a new element to a ellipsis‿str32 and return a new object. | |
ellipsis‿str32 * | ellipsis‿str32‿append (ellipsis‿str32 *restrict s, ellipsis‿str32‿base c) |
Append a new element to a ellipsis‿str32 and return a new object. | |
int | ellipsis‿str32‿base‿compare (ellipsis‿str32‿base const *__LOC_ID_0_1, ellipsis‿str32‿base const *__LOC_ID_0_2) |
compare two char32_t by value | |
void | ellipsis‿str32‿base‿destroy (size_t _n, ellipsis‿str32‿base _ar[static _n]) |
Destroy an element of type ellipsis‿str32‿base. | |
void | ellipsis‿str32‿cmove (ellipsis‿str32 const *__LOC_ID_0_5[restrict static 1], ellipsis‿str32 const **restrict __LOC_ID_0_6) |
Move a ellipsis‿str32 const pointed to by the second parameter to the one pointed to by the first. | |
int | ellipsis‿str32‿compare (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Compare two arrays lexicographically. | |
int | ellipsis‿str32‿compareInternal (void const *A, void const *B) |
ellipsis‿str32 * | ellipsis‿str32‿concat‿_Ctra (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one. | |
ellipsis‿str32 * | ellipsis‿str32‿concat‿_Insta (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one. | |
ellipsis‿str32 * | ellipsis‿str32‿concat (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one. | |
ellipsis‿str32 * | ellipsis‿str32‿concat_inplace‿_Ctra (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one and delete s . | |
ellipsis‿str32 * | ellipsis‿str32‿concat_inplace‿_Insta (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one and delete s . | |
ellipsis‿str32 * | ellipsis‿str32‿concat_inplace (ellipsis‿str32 const *s, ellipsis‿str32 const *t) |
Concatenate two ellipsis‿str32 into a new one and delete s . | |
ellipsis‿str32 * | ellipsis‿str32‿construct (size_t __LOC_ID_0_8, char const [static __LOC_ID_0_8]) |
Construct a ellipsis‿str32 from a character array of length len . | |
ellipsis‿str32 * | ellipsis‿str32‿cpy (ellipsis‿str32 const *restrict __LOC_ID_0_7) |
Allocate a ellipsis‿str32 and copy the data to which the parameter points into it. | |
ellipsis‿str32 const * | ellipsis‿str32‿cpy_const‿_Ctra (ellipsis‿str32 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str32 . | |
ellipsis‿str32 const * | ellipsis‿str32‿cpy_const‿_Insta (ellipsis‿str32 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str32 . | |
ellipsis‿str32 const * | ellipsis‿str32‿cpy_const (ellipsis‿str32 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str32 . | |
void | ellipsis‿str32‿delete (ellipsis‿str32 const *) |
Delete a ellipsis‿str32 pointed to by the parameter. | |
int | ellipsis‿str32‿fputs (ellipsis‿str32 const *restrict, FILE *) |
Write a ellipsis‿str32 to a stream. | |
ellipsis‿str32 * | ellipsis‿str32‿grow‿_Ctra (ellipsis‿str32 *restrict s, size_t length) |
Grow the ellipsis‿str32 to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿str32 * | ellipsis‿str32‿grow‿_Insta (ellipsis‿str32 *restrict s, size_t length) |
Grow the ellipsis‿str32 to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿str32 * | ellipsis‿str32‿grow (ellipsis‿str32 *restrict s, size_t length) |
Grow the ellipsis‿str32 to (at least) the indicated amount of elements return a new one and delete the old one, if any. | |
void | ellipsis‿str32‿move (ellipsis‿str32 *__LOC_ID_0_3[restrict static 1], ellipsis‿str32 **restrict __LOC_ID_0_4) |
Move a ellipsis‿str32 pointed to by the second parameter to the one pointed to by the first. | |
ellipsis‿str32 * | ellipsis‿str32‿remove (ellipsis‿str32 s[restrict static 1], size_t) |
Remove (at most) the indicated amount of elements from the ellipsis‿str32 return a new one and delete s . | |
ellipsis‿str32‿base const * | ellipsis‿str32‿search (ellipsis‿str32‿base const el[static 1], ellipsis‿str32 const *p, size_t offs, size_t len) |
search for an element in a ellipsis‿str32 | |
ellipsis‿str32 * | ellipsis‿str32‿shrink‿_Ctra (ellipsis‿str32 s[restrict static 1], size_t length) |
Shrink the ellipsis‿str32 to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿str32 * | ellipsis‿str32‿shrink‿_Insta (ellipsis‿str32 s[restrict static 1], size_t length) |
Shrink the ellipsis‿str32 to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
ellipsis‿str32 * | ellipsis‿str32‿shrink (ellipsis‿str32 s[restrict static 1], size_t length) |
Shrink the ellipsis‿str32 to exactly the indicated amount of elements return a new one and delete the old one, if any. | |
void | ellipsis‿str32‿sort (ellipsis‿str32 *p, size_t offs, size_t len) |
sort a ellipsis‿str32 in place. | |
ellipsis‿str32 * | ellipsis‿str32‿sub‿_Ctra (ellipsis‿str32 const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿str32 with len elements and copy the data from *s at position pos onward. | |
ellipsis‿str32 * | ellipsis‿str32‿sub‿_Insta (ellipsis‿str32 const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿str32 with len elements and copy the data from *s at position pos onward. | |
ellipsis‿str32 * | ellipsis‿str32‿sub (ellipsis‿str32 const *restrict s, size_t pos, size_t len) |
Allocate a ellipsis‿str32 with len elements and copy the data from *s at position pos onward. | |
Data Fields | |
ellipsis‿str32‿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_STR32_CONSTRUCT(S) ellipsis_str32_construct(sizeof S - 1, "" S "") |
Construct a ellipsis‿str32 from a string literal and return a pointer to it. | |
#define | ELLIPSIS_STR32_LITERAL_LOCAL(N, ...) |
Create a literal of type ellipsis‿str32 , where the array component is initialized with the arguments. | |
#define | ELLIPSIS_STR32_STRING_LITERAL(S) ELLIPSIS_STR32_LITERAL((sizeof(U"" S)/sizeof(U'0')) - 1, U"" S U"") |
Construct a ellipsis‿str32 const from a string literal. | |
A structure with a flexible array member of base type ellipsis‿str32‿base.
The ellipsis‿str32
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‿str32
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‿str32) set to the name that the new array structure should have. Before that, the type ¤::base
(here ellipsis‿str32‿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_str32
) 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‿str32‿base‿destroy and ellipsis‿str32‿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 char32_t ellipsis‿str32‿base |
|
inline |
Allocate a ellipsis‿str32
with elements as given by the parameter.
If such a ellipsis‿str32
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‿str32‿alloc‿_Ctra(), ellipsis‿str32‿alloc‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿alloc‿_Ctra().
|
inline |
Allocate a ellipsis‿str32
with elements as given by the parameter.
If such a ellipsis‿str32
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‿str32‿alloc().
|
inline |
Allocate a ellipsis‿str32
with elements as given by the parameter.
If such a ellipsis‿str32
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‿str32‿alloc‿_Insta(), ellipsis‿str32‿alloc(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿alloc().
|
inline |
Append a new element to a ellipsis‿str32
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‿str32
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‿str32‿append‿_Ctra(), ellipsis‿str32‿append‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿append‿_Ctra().
|
inline |
Append a new element to a ellipsis‿str32
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‿str32
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‿str32‿append().
|
inline |
Append a new element to a ellipsis‿str32
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‿str32
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‿str32‿append‿_Insta(), ellipsis‿str32‿append(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿append().
|
inline |
compare two char32_t
by value
Referenced by ellipsis‿str32‿compareInternal().
|
inline |
Destroy an element of type ellipsis‿str32‿base.
This is a synthesized function that sets all bytes of the array to 0
.
|
inline |
Move a ellipsis‿str32 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‿str32‿delete().
int ellipsis‿str32‿compare | ( | ellipsis‿str32 const * | s, |
ellipsis‿str32 const * | t | ||
) |
Compare two arrays lexicographically.
This uses the function ellipsis‿str32‿base‿compare to compare the elements.
|
inline |
References ellipsis‿str32‿base‿compare().
Referenced by ellipsis‿str32‿search(), and ellipsis‿str32‿sort().
|
inline |
Concatenate two ellipsis‿str32
into a new one.
If such a ellipsis‿str32
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‿str32‿concat‿_Ctra(), ellipsis‿str32‿concat‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿concat‿_Ctra().
|
inline |
Concatenate two ellipsis‿str32
into a new one.
If such a ellipsis‿str32
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‿str32‿concat().
|
inline |
Concatenate two ellipsis‿str32
into a new one.
If such a ellipsis‿str32
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‿str32‿concat‿_Insta(), ellipsis‿str32‿concat(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿concat().
|
inline |
Concatenate two ellipsis‿str32
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‿str32‿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‿str32‿concat_inplace‿_Ctra(), ellipsis‿str32‿concat_inplace‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿concat_inplace‿_Ctra().
|
inline |
Concatenate two ellipsis‿str32
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‿str32‿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‿str32‿concat_inplace().
|
inline |
Concatenate two ellipsis‿str32
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‿str32‿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‿str32‿concat_inplace‿_Insta(), ellipsis‿str32‿concat_inplace(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿concat_inplace().
ellipsis‿str32 * ellipsis‿str32‿construct | ( | size_t | __LOC_ID_0_8, |
char const | [static __LOC_ID_0_8] | ||
) |
Construct a ellipsis‿str32
from a character array of length len
.
The primary user interface is a macro of the same name that additionally to the function call itself provides some more error checks.
|
inline |
Allocate a ellipsis‿str32
and copy the data to which the parameter points into it.
If such a ellipsis‿str32
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‿str32‿sub(), and ELLIPSIS_CONTRACT.
|
inline |
Copy or link to a const
-qualified ellipsis‿str32
.
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‿str32‿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‿str32‿cpy_const‿_Ctra(), ellipsis‿str32‿cpy_const‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿cpy_const‿_Ctra().
|
inline |
Copy or link to a const
-qualified ellipsis‿str32
.
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‿str32‿cpy is produced.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿str32‿cpy_const().
|
inline |
Copy or link to a const
-qualified ellipsis‿str32
.
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‿str32‿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‿str32‿cpy_const‿_Insta(), ellipsis‿str32‿cpy_const(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str32‿cpy_const().
void ellipsis‿str32‿delete | ( | ellipsis‿str32 const * | ) |
Delete a ellipsis‿str32
pointed to by the parameter.
ELLIPSIS_STR32_LITERAL
and will just do nothing, then.This uses the function ellipsis‿str32‿base‿destroy on deleted elements.
Referenced by ellipsis‿str32‿cmove(), and ellipsis‿str32‿move().
int ellipsis‿str32‿fputs | ( | ellipsis‿str32 const * | restrict, |
FILE * | |||
) |
Write a ellipsis‿str32
to a stream.
|
inline |
Grow the ellipsis‿str32
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‿str32‿grow‿_Ctra(), ellipsis‿str32‿grow‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿grow‿_Ctra().
|
inline |
Grow the ellipsis‿str32
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‿str32‿grow().
|
inline |
Grow the ellipsis‿str32
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‿str32‿grow‿_Insta(), ellipsis‿str32‿grow(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿grow().
|
inline |
Move a ellipsis‿str32
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‿str32‿delete().
ellipsis‿str32 * ellipsis‿str32‿remove | ( | ellipsis‿str32 | s[restrict static 1], |
size_t | |||
) |
Remove (at most) the indicated amount of elements from the ellipsis‿str32
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 uses the function ellipsis‿str32‿base‿destroy on removed elements.
References ELLIPSIS_CONTRACT.
|
inline |
search for an element in a ellipsis‿str32
The same restrictions for offs
and len
hold as for ellipsis‿str32‿sort
.
The return is the same as for the bsearch
C library feature.
References array, ellipsis‿str32‿compareInternal(), and length.
|
inline |
Shrink the ellipsis‿str32
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‿str32‿shrink‿_Ctra(), ellipsis‿str32‿shrink‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿shrink‿_Ctra().
|
inline |
Shrink the ellipsis‿str32
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‿str32‿shrink().
|
inline |
Shrink the ellipsis‿str32
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‿str32‿shrink‿_Insta(), ellipsis‿str32‿shrink(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿shrink().
|
inline |
sort a ellipsis‿str32
in place.
Sort array of length len
starting from offs
according to comparison function ellipsis‿str32‿base‿compare.
offs
is outside the range, nothing is done.len
is adjusted to the minimum of len
and ellipsis‿str32‿length-pos
.len
is zero, nothing is done. References array, ellipsis‿str32‿compareInternal(), and length.
|
inline |
Allocate a ellipsis‿str32
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str32
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‿str32‿sub‿_Ctra(), ellipsis‿str32‿sub‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿sub‿_Ctra().
|
inline |
Allocate a ellipsis‿str32
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str32
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‿str32‿sub().
|
inline |
Allocate a ellipsis‿str32
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str32
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‿str32‿sub‿_Insta(), ellipsis‿str32‿sub(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str32‿cpy(), and ellipsis‿str32‿sub().
|
related |
Construct a ellipsis‿str32
from a string literal and return a pointer to it.
|
related |
Create a literal of type ellipsis‿str32
, where the array
component is initialized with the arguments.
This results in an lvalue of type ellipsis‿str32
for an object that has static storage duration and that is const
-qualified.
Most functions that are provided for ellipsis‿str32
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‿str32‿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
.
|
related |
Construct a ellipsis‿str32 const
from a string literal.
Use this as in
or
const
-qualified.ellipsis‿str32‿base array[] |
The current data array.
Referenced by ellipsis‿directive‿embed_common(), ellipsis‿directive‿expand(), ellipsis‿directive‿include_common(), ellipsis‿directive‿line_common(), ellipsis‿expression‿prefix(), ellipsis‿expression‿recurse(), ellipsis‿filter(), ellipsis‿include‿fopen32(), ellipsis‿infra‿find(), ellipsis‿macros‿repair(), ellipsis‿output‿vrbs(), ellipsis‿special‿scan‿str32‿_Inner(), ellipsis‿str32‿alloc‿_Inner(), ellipsis‿str32‿compare(), ellipsis‿str32‿concat‿_Inner(), ellipsis‿str32‿concat_inplace‿_Inner(), ellipsis‿str32‿delete(), ellipsis‿str32‿search(), ellipsis‿str32‿sort(), ellipsis‿str32‿sub‿_Inner(), ellipsis‿token‿dictionary‿find_pos(), ellipsis‿token::ellipsis‿token‿is_inner(), and ellipsis‿tokenize().
|
private |
Maximal length of this instance.
Also serves to encode the fact that a ellipsis‿str32
is statically allocated. Do not mess with it.
Referenced by ellipsis‿str32‿concat_inplace‿_Inner(), ellipsis‿str32‿grow‿_Ctra(), ellipsis‿str32‿grow(), ellipsis‿str32‿shrink‿_Ctra(), and ellipsis‿str32‿shrink().
size_t const length |
Current length of this instance.
Referenced by ellipsis‿directive‿embed_common(), ellipsis‿directive‿expand(), ellipsis‿directive‿include_common(), ellipsis‿directive‿line_common(), ellipsis‿expression‿recurse(), ellipsis‿expression‿resolve_defined(), ellipsis‿filter(), ellipsis‿include‿fopen32(), ellipsis‿infra‿find(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿macros‿cb‿defined(), ellipsis‿macros‿cb‿has_extension(), ellipsis‿macros‿cb‿has_feature(), ellipsis‿macros‿cb‿is_identifier(), ellipsis‿macros‿repair(), ellipsis‿special‿scan‿str32‿_Inner(), ellipsis‿str32‿alloc‿_Inner(), ellipsis‿str32‿compare(), ellipsis‿str32‿concat‿_Inner(), ellipsis‿str32‿concat_inplace‿_Inner(), ellipsis‿str32‿delete(), ellipsis‿str32‿grow‿_Ctra(), ellipsis‿str32‿grow‿_Inner(), ellipsis‿str32‿grow(), ellipsis‿str32‿search(), ellipsis‿str32‿shrink‿_Ctra(), ellipsis‿str32‿shrink(), ellipsis‿str32‿sort(), ellipsis‿str32‿sub‿_Ctra(), ellipsis‿str32‿sub‿_Inner(), ellipsis‿str32‿sub(), ellipsis‿token‿dictionary‿find_pos(), ellipsis‿token::ellipsis‿token‿is_inner(), ellipsis‿token‿list‿stringify‿_Inner(), and ellipsis‿tokenize().
|
private |
Modifiable length of this instance.
Referenced by ellipsis‿str32‿alloc‿_Inner(), ellipsis‿str32‿concat_inplace‿_Inner(), and ellipsis‿str32‿sub‿_Inner().