A structure with a flexible array member of base type ellipsis‿str8‿base. More...
#include <ellipsis-str8.h>
Public Types | |
typedef unsigned char | ellipsis‿str8‿base |
typedef unsigned char | ellipsis‿str8‿base |
Public Member Functions | |
ellipsis‿str8 * | ellipsis‿str8‿alloc‿_Ctra (size_t len) |
Allocate a ellipsis‿str8 with elements as given by the parameter. | |
ellipsis‿str8 * | ellipsis‿str8‿alloc‿_Insta (size_t len) |
Allocate a ellipsis‿str8 with elements as given by the parameter. | |
ellipsis‿str8 * | ellipsis‿str8‿alloc (size_t len) |
Allocate a ellipsis‿str8 with elements as given by the parameter. | |
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. | |
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. | |
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. | |
int | ellipsis‿str8‿base‿compare (ellipsis‿str8‿base const *__LOC_ID_0_1, ellipsis‿str8‿base const *__LOC_ID_0_2) |
void | ellipsis‿str8‿base‿destroy (size_t _n, ellipsis‿str8‿base _ar[static _n]) |
Destroy an element of type ellipsis‿str8‿base. | |
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. | |
int | ellipsis‿str8‿compare (ellipsis‿str8 const *s, ellipsis‿str8 const *t) |
Compare two arrays lexicographically. | |
int | ellipsis‿str8‿compareInternal (void const *A, void const *B) |
ellipsis‿str8 * | ellipsis‿str8‿concat‿_Ctra (ellipsis‿str8 const *s, ellipsis‿str8 const *t) |
Concatenate two ellipsis‿str8 into a new one. | |
ellipsis‿str8 * | ellipsis‿str8‿concat‿_Insta (ellipsis‿str8 const *s, ellipsis‿str8 const *t) |
Concatenate two ellipsis‿str8 into a new one. | |
ellipsis‿str8 * | ellipsis‿str8‿concat (ellipsis‿str8 const *s, ellipsis‿str8 const *t) |
Concatenate two ellipsis‿str8 into a new one. | |
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 . | |
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 . | |
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 . | |
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‿cpy (ellipsis‿str8 const *restrict __LOC_ID_0_7) |
Allocate a ellipsis‿str8 and copy the data to which the parameter points into it. | |
ellipsis‿str8 const * | ellipsis‿str8‿cpy_const‿_Ctra (ellipsis‿str8 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str8 . | |
ellipsis‿str8 const * | ellipsis‿str8‿cpy_const‿_Insta (ellipsis‿str8 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str8 . | |
ellipsis‿str8 const * | ellipsis‿str8‿cpy_const (ellipsis‿str8 const *restrict s) |
Copy or link to a const -qualified ellipsis‿str8 . | |
void | ellipsis‿str8‿delete (ellipsis‿str8 const *) |
Delete a ellipsis‿str8 pointed to by the parameter. | |
char * | ellipsis‿str8‿dup (ellipsis‿str8 const *restrict) |
Duplicate a ellipsis‿str8 . | |
int | ellipsis‿str8‿fputs (ellipsis‿str8 const *restrict, FILE *) |
Write a ellipsis‿str8 to a stream. | |
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 old one, if any. | |
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 old one, if any. | |
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 old one, if any. | |
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. | |
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 s . | |
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 | |
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 old one, if any. | |
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 old one, if any. | |
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 old one, if any. | |
void | ellipsis‿str8‿sort (ellipsis‿str8 *p, size_t offs, size_t len) |
sort a ellipsis‿str8 in place. | |
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. | |
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. | |
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. | |
Data Fields | |
ellipsis‿str8‿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_STR8_CONSTRUCT(S) |
Construct a ellipsis‿str8 from a string literal and return a pointer to it. | |
#define | ELLIPSIS_STR8_LITERAL_LOCAL(N, ...) |
Create a literal of type ellipsis‿str8 , where the array component is initialized with the arguments. | |
#define | ELLIPSIS_STR8_STRING_LITERAL(S) |
Construct a ellipsis‿str8 const from a string literal. | |
A structure with a flexible array member of base type ellipsis‿str8‿base.
The ellipsis‿str8
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‿str8
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‿str8) set to the name that the new array structure should have. Before that, the type ¤::base
(here ellipsis‿str8‿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_str8
) 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‿str8‿base‿destroy and ellipsis‿str8‿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.
The ellipsis‿str8
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‿str8
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‿str8) set to the name that the new array structure should have. Before that, the type ¤::base
(here ellipsis‿str8‿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_str8
) 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‿str8‿base‿destroy and ellipsis‿str8‿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 unsigned char ellipsis‿str8‿base |
typedef unsigned char ellipsis‿str8‿base |
|
inline |
Allocate a ellipsis‿str8
with elements as given by the parameter.
If such a ellipsis‿str8
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‿str8‿alloc‿_Ctra(), ellipsis‿str8‿alloc‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿alloc‿_Ctra().
|
inline |
Allocate a ellipsis‿str8
with elements as given by the parameter.
If such a ellipsis‿str8
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‿str8‿alloc().
|
inline |
Allocate a ellipsis‿str8
with elements as given by the parameter.
If such a ellipsis‿str8
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‿str8‿alloc‿_Insta(), ellipsis‿str8‿alloc(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿alloc().
|
inline |
Append a new element to a ellipsis‿str8
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‿str8
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‿str8‿append‿_Ctra(), ellipsis‿str8‿append‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿append‿_Ctra().
|
inline |
Append a new element to a ellipsis‿str8
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‿str8
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‿str8‿append().
|
inline |
Append a new element to a ellipsis‿str8
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‿str8
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‿str8‿append‿_Insta(), ellipsis‿str8‿append(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿append().
|
inline |
|
inline |
Destroy an element of type ellipsis‿str8‿base.
This is a synthesized function that sets all bytes of the array to 0
.
|
inline |
Move a ellipsis‿str8 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‿str8‿delete().
int ellipsis‿str8‿compare | ( | ellipsis‿str8 const * | s, |
ellipsis‿str8 const * | t | ||
) |
Compare two arrays lexicographically.
This uses the function ellipsis‿str8‿base‿compare to compare the elements.
|
inline |
References ellipsis‿str8‿base‿compare().
Referenced by ellipsis‿str8‿search(), and ellipsis‿str8‿sort().
|
inline |
Concatenate two ellipsis‿str8
into a new one.
If such a ellipsis‿str8
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‿str8‿concat‿_Ctra(), ellipsis‿str8‿concat‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿concat‿_Ctra().
|
inline |
Concatenate two ellipsis‿str8
into a new one.
If such a ellipsis‿str8
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‿str8‿concat().
|
inline |
Concatenate two ellipsis‿str8
into a new one.
If such a ellipsis‿str8
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‿str8‿concat‿_Insta(), ellipsis‿str8‿concat(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿concat().
|
inline |
Concatenate two ellipsis‿str8
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‿str8‿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‿str8‿concat_inplace‿_Ctra(), ellipsis‿str8‿concat_inplace‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿concat_inplace‿_Ctra().
|
inline |
Concatenate two ellipsis‿str8
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‿str8‿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‿str8‿concat_inplace().
|
inline |
Concatenate two ellipsis‿str8
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‿str8‿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‿str8‿concat_inplace‿_Insta(), ellipsis‿str8‿concat_inplace(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿concat_inplace().
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.
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‿str8
and copy the data to which the parameter points into it.
If such a ellipsis‿str8
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‿str8‿sub(), and ELLIPSIS_CONTRACT.
|
inline |
Copy or link to a const
-qualified ellipsis‿str8
.
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‿str8‿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‿str8‿cpy_const‿_Ctra(), ellipsis‿str8‿cpy_const‿_Inner(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿cpy_const‿_Ctra().
|
inline |
Copy or link to a const
-qualified ellipsis‿str8
.
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‿str8‿cpy is produced.
start inner defer anchor at level 1
DEFER_TYPE needs a semicolon
end inner defer anchor, level 1
Referenced by ellipsis‿str8‿cpy_const().
|
inline |
Copy or link to a const
-qualified ellipsis‿str8
.
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‿str8‿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‿str8‿cpy_const‿_Insta(), ellipsis‿str8‿cpy_const(), and ELLIPSIS_CONTRACT.
Referenced by ellipsis‿str8‿cpy_const().
void ellipsis‿str8‿delete | ( | ellipsis‿str8 const * | ) |
Delete a ellipsis‿str8
pointed to by the parameter.
ELLIPSIS_STR8_LITERAL
and will just do nothing, then.This uses the function ellipsis‿str8‿base‿destroy on deleted elements.
Referenced by ellipsis‿str8‿cmove(), and ellipsis‿str8‿move().
char * ellipsis‿str8‿dup | ( | ellipsis‿str8 const * | restrict | ) |
Duplicate a ellipsis‿str8
.
int ellipsis‿str8‿fputs | ( | ellipsis‿str8 const * | restrict, |
FILE * | |||
) |
Write a ellipsis‿str8
to a stream.
|
inline |
Grow the ellipsis‿str8
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‿str8‿grow‿_Ctra(), ellipsis‿str8‿grow‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿grow‿_Ctra().
|
inline |
Grow the ellipsis‿str8
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‿str8‿grow().
|
inline |
Grow the ellipsis‿str8
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‿str8‿grow‿_Insta(), ellipsis‿str8‿grow(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿grow().
|
inline |
Move a ellipsis‿str8
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‿str8‿delete().
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 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‿str8‿base‿destroy on removed elements.
References ELLIPSIS_CONTRACT.
|
inline |
search for an element in a ellipsis‿str8
The same restrictions for offs
and len
hold as for ellipsis‿str8‿sort
.
The return is the same as for the bsearch
C library feature.
References array, ellipsis‿str8‿compareInternal(), and length.
|
inline |
Shrink the ellipsis‿str8
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‿str8‿shrink‿_Ctra(), ellipsis‿str8‿shrink‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿shrink‿_Ctra().
|
inline |
Shrink the ellipsis‿str8
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‿str8‿shrink().
|
inline |
Shrink the ellipsis‿str8
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‿str8‿shrink‿_Insta(), ellipsis‿str8‿shrink(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿shrink().
|
inline |
sort a ellipsis‿str8
in place.
Sort array of length len
starting from offs
according to comparison function ellipsis‿str8‿base‿compare.
offs
is outside the range, nothing is done.len
is adjusted to the minimum of len
and ellipsis‿str8‿length-pos
.len
is zero, nothing is done. References array, ellipsis‿str8‿compareInternal(), and length.
|
inline |
Allocate a ellipsis‿str8
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str8
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‿str8‿sub‿_Ctra(), ellipsis‿str8‿sub‿_Inner(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿sub‿_Ctra().
|
inline |
Allocate a ellipsis‿str8
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str8
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‿str8‿sub().
|
inline |
Allocate a ellipsis‿str8
with len
elements and copy the data from *s
at position pos
onward.
If such a ellipsis‿str8
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‿str8‿sub‿_Insta(), ellipsis‿str8‿sub(), ELLIPSIS_CONTRACT, and length.
Referenced by ellipsis‿str8‿cpy(), and ellipsis‿str8‿sub().
|
related |
Construct a ellipsis‿str8
from a string literal and return a pointer to it.
|
related |
Create a literal of type ellipsis‿str8
, where the array
component is initialized with the arguments.
This results in an lvalue of type ellipsis‿str8
for an object that has static storage duration and that is const
-qualified.
Most functions that are provided for ellipsis‿str8
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‿str8‿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‿str8 const
from a string literal.
Use this as in
or
const
-qualified.ellipsis‿str8‿base array |
The current data array.
Referenced by ellipsis‿directive‿embed_common(), ellipsis‿include‿fopen(), ellipsis‿language‿c‿_Once‿init‿user(), ellipsis‿language‿html‿_Once‿init‿user(), ellipsis‿language‿lex‿_Once‿init‿user(), ellipsis‿language‿markdown‿_Once‿init‿user(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿output‿byte(), ellipsis‿output‿verbatim(), ellipsis‿special‿directive‿lex(), ellipsis‿special‿scan‿str32‿_Inner(), ellipsis‿special‿scan‿str8‿_Inner(), ellipsis‿str8‿alloc‿_Inner(), ellipsis‿str8‿compare(), ellipsis‿str8‿concat‿_Inner(), ellipsis‿str8‿concat_inplace‿_Inner(), ellipsis‿str8‿construct(), ellipsis‿str8‿delete(), ellipsis‿str8‿search(), ellipsis‿str8‿sort(), ellipsis‿str8‿sub‿_Inner(), ellipsis‿tokenize(), main(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), specials_sort(), and specials_sort().
|
private |
Maximal length of this instance.
Also serves to encode the fact that a ellipsis‿str8
is statically allocated. Do not mess with it.
Referenced by ellipsis‿str8‿concat_inplace‿_Inner(), ellipsis‿str8‿grow‿_Ctra(), ellipsis‿str8‿grow(), ellipsis‿str8‿shrink‿_Ctra(), and ellipsis‿str8‿shrink().
size_t const length |
Current length of this instance.
Referenced by ellipsis‿base64‿encode‿_Inner(), ellipsis‿directive‿embed_common(), ellipsis‿include‿fopen(), ellipsis‿lex‿nonspace‿_Inner(), ellipsis‿output‿byte(), ellipsis‿special‿c‿find(), ellipsis‿special‿c_comment‿find(), ellipsis‿special‿c_directive‿find(), ellipsis‿special‿c_directive1‿find(), ellipsis‿special‿c_include‿find(), ellipsis‿special‿c_pragma‿find(), ellipsis‿special‿decoration‿find(), ellipsis‿special‿directive‿find(), ellipsis‿special‿directive‿lex(), ellipsis‿special‿directive_define‿find(), ellipsis‿special‿directive_if‿find(), ellipsis‿special‿directive_include‿find(), ellipsis‿special‿empty‿find(), ellipsis‿special‿html‿find(), ellipsis‿special‿html_comment‿find(), ellipsis‿special‿html_directive‿find(), ellipsis‿special‿lex‿find(), ellipsis‿special‿lex_comment‿find(), ellipsis‿special‿lex_directive‿find(), ellipsis‿special‿markdown‿find(), ellipsis‿special‿markdown_decoration‿find(), ellipsis‿special‿scan‿str32‿_Inner(), ellipsis‿special‿scan‿str8‿_Inner(), ellipsis‿str8‿alloc‿_Inner(), ellipsis‿str8‿compare(), ellipsis‿str8‿concat‿_Inner(), ellipsis‿str8‿concat_inplace‿_Inner(), ellipsis‿str8‿delete(), ellipsis‿str8‿grow‿_Ctra(), ellipsis‿str8‿grow‿_Inner(), ellipsis‿str8‿grow(), ellipsis‿str8‿search(), ellipsis‿str8‿shrink‿_Ctra(), ellipsis‿str8‿shrink(), ellipsis‿str8‿sort(), ellipsis‿str8‿sub‿_Ctra(), ellipsis‿str8‿sub‿_Inner(), ellipsis‿str8‿sub(), ellipsis‿tokenize(), and main().
|
private |
Modifiable length of this instance.
Referenced by ellipsis‿str8‿alloc‿_Inner(), ellipsis‿str8‿concat_inplace‿_Inner(), ellipsis‿str8‿construct(), and ellipsis‿str8‿sub‿_Inner().