eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis‿str32 Struct Reference

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‿str32ellipsis‿str32‿alloc‿_Ctra (size_t len)
 Allocate a ellipsis‿str32 with elements as given by the parameter.
 
ellipsis‿str32ellipsis‿str32‿alloc‿_Insta (size_t len)
 Allocate a ellipsis‿str32 with elements as given by the parameter.
 
ellipsis‿str32ellipsis‿str32‿alloc (size_t len)
 Allocate a ellipsis‿str32 with elements as given by the parameter.
 
ellipsis‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿str32‿concat‿_Ctra (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one.
 
ellipsis‿str32ellipsis‿str32‿concat‿_Insta (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one.
 
ellipsis‿str32ellipsis‿str32‿concat (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one.
 
ellipsis‿str32ellipsis‿str32‿concat_inplace‿_Ctra (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one and delete s.
 
ellipsis‿str32ellipsis‿str32‿concat_inplace‿_Insta (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one and delete s.
 
ellipsis‿str32ellipsis‿str32‿concat_inplace (ellipsis‿str32 const *s, ellipsis‿str32 const *t)
 Concatenate two ellipsis‿str32 into a new one and delete s.
 
ellipsis‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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‿str32ellipsis‿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.
 

Detailed Description

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 stored
  • capacity, 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.

See also
ELLIPSIS_STR32_LITERAL for the creation of a literal of this type.

Source definitions for this type

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.

# include_source "generate/xfiles/ellipsis-fa-xcode.eLh"__prefix__(bind ELLIPSIS_FA_NAME ellipsis_str32)

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.

See also
ellipsis‿str32‿base‿destroy for the policy when elements are removed
ellipsis‿str32‿base‿compare for the policy when two elements are compared

A similar mechanism is in place for the .c file.

Warning
This is a file generated by eĿlipsis version 20250309, do not modify

Member Typedef Documentation

◆ ellipsis‿str32‿base

typedef char32_t ellipsis‿str32‿base

Member Function Documentation

◆ ellipsis‿str32‿alloc‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿alloc‿_Ctra ( size_t  len)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿alloc‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿alloc‿_Insta ( size_t  len)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿alloc()

ellipsis‿str32 * ellipsis‿str32‿alloc ( size_t  len)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿append‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿append‿_Ctra ( ellipsis‿str32 *restrict  s,
ellipsis‿str32‿base  c 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿append‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿append‿_Insta ( ellipsis‿str32 *restrict  s,
ellipsis‿str32‿base  c 
)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿append()

ellipsis‿str32 * ellipsis‿str32‿append ( ellipsis‿str32 *restrict  s,
ellipsis‿str32‿base  c 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿base‿compare()

int ellipsis‿str32‿base‿compare ( ellipsis‿str32‿base const *  __LOC_ID_0_1,
ellipsis‿str32‿base const *  __LOC_ID_0_2 
)
inline

compare two char32_t by value

Referenced by ellipsis‿str32‿compareInternal().

Here is the caller graph for this function:

◆ ellipsis‿str32‿base‿destroy()

void ellipsis‿str32‿base‿destroy ( size_t  _n,
ellipsis‿str32‿base  _ar[static _n] 
)
inline

Destroy an element of type ellipsis‿str32‿base.

This is a synthesized function that sets all bytes of the array to 0.

See also
ellipsis‿str32‿remove
ellipsis‿str32‿delete

◆ ellipsis‿str32‿cmove()

void ellipsis‿str32‿cmove ( ellipsis‿str32 const *  __LOC_ID_0_5[restrict static 1],
ellipsis‿str32 const **restrict  __LOC_ID_0_6 
)
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().

Here is the call graph for this function:

◆ ellipsis‿str32‿compare()

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.

References array, and length.

◆ ellipsis‿str32‿compareInternal()

int ellipsis‿str32‿compareInternal ( void const *  A,
void const *  B 
)
inline

References ellipsis‿str32‿base‿compare().

Referenced by ellipsis‿str32‿search(), and ellipsis‿str32‿sort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿concat‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿concat‿_Ctra ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿concat‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿concat‿_Insta ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿concat()

ellipsis‿str32 * ellipsis‿str32‿concat ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿concat_inplace‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿concat_inplace‿_Ctra ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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

A structure with a flexible array member of base type ellipsis‿str32‿base.
Definition ellipsis-str32.h:156
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.
Definition ellipsis-str32.h:1241
ellipsis‿str32 * ellipsis‿str32‿concat(ellipsis‿str32 const *s, ellipsis‿str32 const *t)
Concatenate two ellipsis‿str32 into a new one.
Definition ellipsis-str32.h:424
void ellipsis‿str32‿delete(ellipsis‿str32 const *)
Delete a ellipsis‿str32 pointed to by the parameter.
Definition ellipsis-str32.c:625

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿concat_inplace‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿concat_inplace‿_Insta ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿concat_inplace()

ellipsis‿str32 * ellipsis‿str32‿concat_inplace ( ellipsis‿str32 const *  s,
ellipsis‿str32 const *  t 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿construct()

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.

◆ ellipsis‿str32‿cpy()

ellipsis‿str32 * ellipsis‿str32‿cpy ( ellipsis‿str32 const *restrict  __LOC_ID_0_7)
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.

Here is the call graph for this function:

◆ ellipsis‿str32‿cpy_const‿_Ctra()

ellipsis‿str32 const * ellipsis‿str32‿cpy_const‿_Ctra ( ellipsis‿str32 const *restrict  s)
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.

See also
ELLIPSIS_STR32_LITERAL

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿cpy_const‿_Insta()

ellipsis‿str32 const * ellipsis‿str32‿cpy_const‿_Insta ( ellipsis‿str32 const *restrict  s)
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.

See also
ELLIPSIS‿str32_literal

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

end inner defer anchor, level 1

Referenced by ellipsis‿str32‿cpy_const().

Here is the caller graph for this function:

◆ ellipsis‿str32‿cpy_const()

ellipsis‿str32 const * ellipsis‿str32‿cpy_const ( ellipsis‿str32 const *restrict  s)
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.

See also
ELLIPSIS_STR32_LITERAL

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿delete()

void ellipsis‿str32‿delete ( ellipsis‿str32 const *  )

Delete a ellipsis‿str32 pointed to by the parameter.

Remarks
This function may be presented with a literal as produced by ELLIPSIS_STR32_LITERAL and will just do nothing, then.

This uses the function ellipsis‿str32‿base‿destroy on deleted elements.

References array, and length.

Referenced by ellipsis‿str32‿cmove(), and ellipsis‿str32‿move().

Here is the caller graph for this function:

◆ ellipsis‿str32‿fputs()

int ellipsis‿str32‿fputs ( ellipsis‿str32 const *  restrict,
FILE *   
)

Write a ellipsis‿str32 to a stream.

◆ ellipsis‿str32‿grow‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿grow‿_Ctra ( ellipsis‿str32 *restrict  s,
size_t  length 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿grow‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿grow‿_Insta ( ellipsis‿str32 *restrict  s,
size_t  length 
)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿grow()

ellipsis‿str32 * ellipsis‿str32‿grow ( ellipsis‿str32 *restrict  s,
size_t  length 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿move()

void ellipsis‿str32‿move ( ellipsis‿str32 __LOC_ID_0_3[restrict static 1],
ellipsis‿str32 **restrict  __LOC_ID_0_4 
)
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().

Here is the call graph for this function:

◆ ellipsis‿str32‿remove()

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.

◆ ellipsis‿str32‿search()

ellipsis‿str32‿base const * ellipsis‿str32‿search ( ellipsis‿str32‿base const  el[static 1],
ellipsis‿str32 const *  p,
size_t  offs,
size_t  len 
)
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.

Here is the call graph for this function:

◆ ellipsis‿str32‿shrink‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿shrink‿_Ctra ( ellipsis‿str32  s[restrict static 1],
size_t  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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿shrink‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿shrink‿_Insta ( ellipsis‿str32  s[restrict static 1],
size_t  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

end inner defer anchor, level 1

Referenced by ellipsis‿str32‿shrink().

Here is the caller graph for this function:

◆ ellipsis‿str32‿shrink()

ellipsis‿str32 * ellipsis‿str32‿shrink ( ellipsis‿str32  s[restrict static 1],
size_t  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‿_Insta(), ellipsis‿str32‿shrink(), ELLIPSIS_CONTRACT, and length.

Referenced by ellipsis‿str32‿shrink().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿sort()

void ellipsis‿str32‿sort ( ellipsis‿str32 p,
size_t  offs,
size_t  len 
)
inline

sort a ellipsis‿str32 in place.

Sort array of length len starting from offs according to comparison function ellipsis‿str32‿base‿compare.

  • If offs is outside the range, nothing is done.
  • len is adjusted to the minimum of len and ellipsis‿str32‿length-pos.
  • If len is zero, nothing is done.

References array, ellipsis‿str32‿compareInternal(), and length.

Here is the call graph for this function:

◆ ellipsis‿str32‿sub‿_Ctra()

ellipsis‿str32 * ellipsis‿str32‿sub‿_Ctra ( ellipsis‿str32 const *restrict  s,
size_t  pos,
size_t  len 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ellipsis‿str32‿sub‿_Insta()

ellipsis‿str32 * ellipsis‿str32‿sub‿_Insta ( ellipsis‿str32 const *restrict  s,
size_t  pos,
size_t  len 
)
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().

Here is the caller graph for this function:

◆ ellipsis‿str32‿sub()

ellipsis‿str32 * ellipsis‿str32‿sub ( ellipsis‿str32 const *restrict  s,
size_t  pos,
size_t  len 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ELLIPSIS_STR32_CONSTRUCT

#define ELLIPSIS_STR32_CONSTRUCT (   S)    ellipsis_str32_construct(sizeof S - 1, "" S "")
related

Construct a ellipsis‿str32 from a string literal and return a pointer to it.

◆ ELLIPSIS_STR32_LITERAL_LOCAL

#define ELLIPSIS_STR32_LITERAL_LOCAL (   N,
  ... 
)
related
Value:
((static const ELLIPSIS_STR32_OVERLAY( \
sizeof((ellipsis‿str32‿base[]){__VA_ARGS__ }) \
{\
.length = (N), \
.array = {__VA_ARGS__ }, \
}.fa)
#define ELLIPSIS_STR32_OVERLAY(N)
Definition ellipsis-str32.h:193
char32_t ellipsis‿str32‿base
Definition ellipsis-str32.h:20
ellipsis‿str32‿base array[]
The current data array.
Definition ellipsis-str32.h:190

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.

Remarks
Because of current restrictions in C23 that constexpr compound literals may not be of union type, this is not yet provided as constexpr.

◆ ELLIPSIS_STR32_STRING_LITERAL

#define ELLIPSIS_STR32_STRING_LITERAL (   S)    ELLIPSIS_STR32_LITERAL((sizeof(U"" S)/sizeof(U'0')) - 1, U"" S U"")
related

Construct a ellipsis‿str32 const from a string literal.

Use this as in

__directive__ always
Always expand the code up to the next #end or #endif.
Definition directives.c:151
#define ELLIPSIS_STR32_STRING_LITERAL(S)
Construct a ellipsis‿str32 const from a string literal.
Definition ellipsis-str32.h:1371

or

ellipsis‿str32 const* ulways = &ELLIPSIS_STR32_STRING_LITERAL(U"ulways");
Remarks
Other than for ELLIPSIS_STR32_CONSTRUCT() the resulting lvalue has static storage duration and is const-qualified.
The argument should be an ordinary or UTF-32 string literal.

Field Documentation

◆ array

◆ capacity

size_t const capacity
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().

◆ length

◆ length_mod

size_t length_mod
private

The documentation for this struct was generated from the following files: