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

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

Detailed Description

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 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_STR8_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‿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.

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

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.

See also
ellipsis‿str8‿base‿destroy for the policy when elements are removed
ellipsis‿str8‿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

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 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_STR8_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‿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.

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

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.

See also
ellipsis‿str8‿base‿destroy for the policy when elements are removed
ellipsis‿str8‿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‿str8‿base [1/2]

typedef unsigned char ellipsis‿str8‿base

◆ ellipsis‿str8‿base [2/2]

typedef unsigned char ellipsis‿str8‿base

Member Function Documentation

◆ ellipsis‿str8‿alloc‿_Ctra()

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

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

◆ ellipsis‿str8‿alloc‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿alloc()

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

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

◆ ellipsis‿str8‿append‿_Ctra()

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

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

◆ ellipsis‿str8‿append‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿append()

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

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

◆ ellipsis‿str8‿base‿compare()

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

Referenced by ellipsis‿str8‿compareInternal().

Here is the caller graph for this function:

◆ ellipsis‿str8‿base‿destroy()

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

Destroy an element of type ellipsis‿str8‿base.

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

See also
ellipsis‿str8‿remove
ellipsis‿str8‿delete

◆ ellipsis‿str8‿cmove()

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

Here is the call graph for this function:

◆ ellipsis‿str8‿compare()

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.

References array, and length.

◆ ellipsis‿str8‿compareInternal()

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

References ellipsis‿str8‿base‿compare().

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

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

◆ ellipsis‿str8‿concat‿_Ctra()

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

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

◆ ellipsis‿str8‿concat‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿concat()

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

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

◆ ellipsis‿str8‿concat_inplace‿_Ctra()

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

return ellipsis‿str8‿concat(tmp, t);
A structure with a flexible array member of base type ellipsis‿str8‿base.
Definition ellipsis-str8.h:150
ellipsis‿str8 * ellipsis‿str8‿cpy(ellipsis‿str8 const *restrict __LOC_ID_0_7)
Allocate a ellipsis‿str8 and copy the data to which the parameter points into it.
Definition ellipsis-str8.h:1235
ellipsis‿str8 * ellipsis‿str8‿concat(ellipsis‿str8 const *s, ellipsis‿str8 const *t)
Concatenate two ellipsis‿str8 into a new one.
Definition ellipsis-str8.h:418
void ellipsis‿str8‿delete(ellipsis‿str8 const *)
Delete a ellipsis‿str8 pointed to by the parameter.
Definition ellipsis-str8.c:624

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

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

◆ ellipsis‿str8‿concat_inplace‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿concat_inplace()

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

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

◆ ellipsis‿str8‿construct()

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.

◆ ellipsis‿str8‿cpy()

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

Here is the call graph for this function:

◆ ellipsis‿str8‿cpy_const‿_Ctra()

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

See also
ELLIPSIS_STR8_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‿str8‿cpy_const‿_Ctra(), ellipsis‿str8‿cpy_const‿_Inner(), and ELLIPSIS_CONTRACT.

Referenced by ellipsis‿str8‿cpy_const‿_Ctra().

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

◆ ellipsis‿str8‿cpy_const‿_Insta()

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

See also
ELLIPSIS‿str8_literal

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

end inner defer anchor, level 1

Referenced by ellipsis‿str8‿cpy_const().

Here is the caller graph for this function:

◆ ellipsis‿str8‿cpy_const()

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

See also
ELLIPSIS_STR8_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‿str8‿cpy_const‿_Insta(), ellipsis‿str8‿cpy_const(), and ELLIPSIS_CONTRACT.

Referenced by ellipsis‿str8‿cpy_const().

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

◆ ellipsis‿str8‿delete()

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

Delete a ellipsis‿str8 pointed to by the parameter.

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

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

References array, and length.

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿dup()

char * ellipsis‿str8‿dup ( ellipsis‿str8 const *  restrict)

Duplicate a ellipsis‿str8.

◆ ellipsis‿str8‿fputs()

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

Write a ellipsis‿str8 to a stream.

◆ ellipsis‿str8‿grow‿_Ctra()

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

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

◆ ellipsis‿str8‿grow‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿grow()

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

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

◆ ellipsis‿str8‿move()

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

Here is the call graph for this function:

◆ ellipsis‿str8‿remove()

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.

◆ ellipsis‿str8‿search()

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

Here is the call graph for this function:

◆ ellipsis‿str8‿shrink‿_Ctra()

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

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

◆ ellipsis‿str8‿shrink‿_Insta()

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

end inner defer anchor, level 1

Referenced by ellipsis‿str8‿shrink().

Here is the caller graph for this function:

◆ ellipsis‿str8‿shrink()

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

Referenced by ellipsis‿str8‿shrink().

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

◆ ellipsis‿str8‿sort()

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

sort a ellipsis‿str8 in place.

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

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

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

Here is the call graph for this function:

◆ ellipsis‿str8‿sub‿_Ctra()

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

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

◆ ellipsis‿str8‿sub‿_Insta()

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

Here is the caller graph for this function:

◆ ellipsis‿str8‿sub()

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

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

Friends And Related Symbol Documentation

◆ ELLIPSIS_STR8_CONSTRUCT

ELLIPSIS_STR8_CONSTRUCT (   S)
related

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

◆ ELLIPSIS_STR8_LITERAL_LOCAL

ELLIPSIS_STR8_LITERAL_LOCAL (   N,
  ... 
)
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.

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_STR8_STRING_LITERAL

ELLIPSIS_STR8_STRING_LITERAL (   S)
related

Construct a ellipsis‿str8 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_STR8_STRING_LITERAL(S)
Construct a ellipsis‿str8 const from a string literal.
Definition ellipsis-str8.h:1365

or

ellipsis‿str8 const* ulways = &ELLIPSIS_STR8_STRING_LITERAL(u8"ulways");
Remarks
Other than for ELLIPSIS_STR8_CONSTRUCT() the resulting lvalue has static storage duration and is const-qualified.
The argument should be an ordinary or UTF-8 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‿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().

◆ length

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

◆ length_mod


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