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

a token list More...

#include <ellipsis-tlist.h>

Collaboration diagram for ellipsis‿token‿list:

Public Member Functions

tokenellipsis‿token‿list‿all (ellipsis‿token‿list[static 1])
 remove all tokens form the list and return the first
 
void ellipsis‿token‿list‿append (ellipsis‿token‿list[static 1], token *)
 apend a token and all its followers to the list
 
void ellipsis‿token‿list‿close (ellipsis‿token‿list[static 1])
 Close a token list for_DEFER_REPLAY_FOR append operations by a producer.
 
size_t ellipsis‿token‿list‿collect_call (size_t len, ellipsis‿token‿list arg[static len], ellipsis‿token‿list in[restrict static 1], bool var, ellipsis‿str32 const *space[static 1])
 collect the arguments for_DEFER_REPLAY_FOR a macro call
 
ellipsis‿token‿listellipsis‿token‿list‿cpy‿_Ctra (ellipsis‿token‿list __LOC_ID_0_5[static const 1])
 create a new token list by deep copying the pointed to token list
 
ellipsis‿token‿listellipsis‿token‿list‿cpy‿_Insta (ellipsis‿token‿list __LOC_ID_0_2[static const 1])
 create a new token list by deep copying the pointed to token list
 
ellipsis‿token‿listellipsis‿token‿list‿cpy (ellipsis‿token‿list __LOC_ID_0_2[static const 1])
 create a new token list by deep copying the pointed to token list
 
void ellipsis‿token‿list‿delete (ellipsis‿token‿list *tl)
 delete all tokens and free the list itself
 
void ellipsis‿token‿list‿destroy (ellipsis‿token‿list[static 1])
 destroy all elements in a token list.
 
bool ellipsis‿token‿list‿equiv (ellipsis‿token‿list *a, ellipsis‿token‿list *b)
 Check if two token lists are token equivalent.
 
tokenellipsis‿token‿list‿first (ellipsis‿token‿list[static 1])
 Access a token list.
 
void ellipsis‿token‿list‿flush (ellipsis‿token‿list target[static 1], ellipsis‿token‿list source[static 1])
 append the whole contents of source to target
 
ellipsis‿token‿listellipsis‿token‿list‿init‿_Ctra (ellipsis‿token‿list __LOC_ID_0_4[static const 1])
 Initialize a token list.
 
ellipsis‿token‿listellipsis‿token‿list‿init‿_Insta (ellipsis‿token‿list __LOC_ID_0_1[static const 1])
 Initialize a token list.
 
ellipsis‿token‿listellipsis‿token‿list‿init (ellipsis‿token‿list __LOC_ID_0_1[static const 1])
 Initialize a token list.
 
bool ellipsis‿token‿list‿is_finished (ellipsis‿token‿list[static 1])
 
tokenellipsis‿token‿list‿last (ellipsis‿token‿list[static 1])
 Access the last element of a token list.
 
void ellipsis‿token‿list‿move (ellipsis‿token‿list *__LOC_ID_0_7[restrict static 1], ellipsis‿token‿list **restrict __LOC_ID_0_8)
 Move a ellipsis‿token‿list pointed to by the second parameter to the one pointed to by the first.
 
ellipsis‿token‿listellipsis‿token‿list‿new (void)
 allocate and return a new empty list
 
void ellipsis‿token‿list‿open (ellipsis‿token‿list[static 1])
 Open a token list for_DEFER_REPLAY_FOR append operations by a producer.
 
tokenellipsis‿token‿list‿pop (ellipsis‿token‿list[static 1])
 pop a token form the list
 
void ellipsis‿token‿list‿push (ellipsis‿token‿list target[static 1], ellipsis‿token‿list source[static 1])
 prepend the whole contents of source to target
 
ellipsis‿str32ellipsis‿token‿list‿stringify‿_Ctra (ellipsis‿token‿list const __LOC_ID_0_6[static const 1])
 stringify the whole source list into one string token
 
ellipsis‿str32ellipsis‿token‿list‿stringify‿_Insta (ellipsis‿token‿list const __LOC_ID_0_3[static const 1])
 stringify the whole source list into one string token
 
ellipsis‿str32ellipsis‿token‿list‿stringify (ellipsis‿token‿list const __LOC_ID_0_3[static const 1])
 stringify the whole source list into one string token
 
token const * ellipsis‿token‿list‿top (ellipsis‿token‿list[static 1])
 Peek into a token list.
 
void ellipsis‿token‿list‿wait (ellipsis‿token‿list[static 1])
 Wait until the token list is finished.
 

Private Attributes

Internal members
Warning
Do not access these directly
mtx_t mtx
 
cnd_t cnd
 
tokenfirst
 
tokenlast
 
bool finished
 

Detailed Description

a token list

Do not use any of its members directly, but only through its functions.

This list is meant to be thread safe. A producer may append new elements into an open list, and a consumer may then pop these from the list. The consumer is blocked if there is no element left and the list is not closed.

Member Function Documentation

◆ ellipsis‿token‿list‿all()

token * ellipsis‿token‿list‿all ( ellipsis‿token‿list  [static 1])

remove all tokens form the list and return the first

References cnd, ellipsis‿error‿finished, ELLIPSIS_WARNING, finished, first, last, and mtx.

◆ ellipsis‿token‿list‿append()

void ellipsis‿token‿list‿append ( ellipsis‿token‿list  [static 1],
token  
)

apend a token and all its followers to the list

References cnd, first, last, mtx, and ellipsis‿token::next.

◆ ellipsis‿token‿list‿close()

void ellipsis‿token‿list‿close ( ellipsis‿token‿list  [static 1])

Close a token list for_DEFER_REPLAY_FOR append operations by a producer.

This unblocks possible waiters.

References cnd, finished, and mtx.

◆ ellipsis‿token‿list‿collect_call()

size_t ellipsis‿token‿list‿collect_call ( size_t  len,
ellipsis‿token‿list  arg[static len],
ellipsis‿token‿list  in[restrict static 1],
bool  var,
ellipsis‿str32 const *  space[static 1] 
)

collect the arguments for_DEFER_REPLAY_FOR a macro call

len is the total number of arguments that is to be expected, including a possible final ... list. Or said differently, the function switches to the next argument whenever a top-level comma is encountered but only until the last possible argument in position len-1. Then commas, are included in this final argument.

Parenthesis have to be properly nested, and only commas that are not between such matching parenthesis account as being top-level.

◆ ellipsis‿token‿list‿cpy‿_Ctra()

ellipsis‿token‿list * ellipsis‿token‿list‿cpy‿_Ctra ( ellipsis‿token‿list  __LOC_ID_0_5[static const 1])
inline

create a new token list by deep copying the pointed to token list

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‿token‿list‿cpy‿_Inner(), and ELLIPSIS_CONTRACT.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿cpy‿_Insta()

ellipsis‿token‿list * ellipsis‿token‿list‿cpy‿_Insta ( ellipsis‿token‿list  __LOC_ID_0_2[static const 1])
inline

create a new token list by deep copying the pointed to token list

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

end inner defer anchor, level 1

◆ ellipsis‿token‿list‿cpy()

ellipsis‿token‿list * ellipsis‿token‿list‿cpy ( ellipsis‿token‿list  __LOC_ID_0_2[static const 1])
inline

create a new token list by deep copying the pointed to token list

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_CONTRACT.

◆ ellipsis‿token‿list‿delete()

void ellipsis‿token‿list‿delete ( ellipsis‿token‿list tl)
inline

delete all tokens and free the list itself

References ellipsis‿token‿list‿destroy().

Here is the call graph for this function:

◆ ellipsis‿token‿list‿destroy()

void ellipsis‿token‿list‿destroy ( ellipsis‿token‿list  [static 1])

destroy all elements in a token list.

Any object of the ellipsis‿token‿list type has to be destroyed by this function. Otherwise the elements are leaked.

References ellipsis‿token‿list‿all().

Here is the call graph for this function:

◆ ellipsis‿token‿list‿equiv()

bool ellipsis‿token‿list‿equiv ( ellipsis‿token‿list a,
ellipsis‿token‿list b 
)

Check if two token lists are token equivalent.

◆ ellipsis‿token‿list‿first()

token * ellipsis‿token‿list‿first ( ellipsis‿token‿list  [static 1])

Access a token list.

References first.

◆ ellipsis‿token‿list‿flush()

void ellipsis‿token‿list‿flush ( ellipsis‿token‿list  target[static 1],
ellipsis‿token‿list  source[static 1] 
)

append the whole contents of source to target

References cnd, ellipsis‿token‿list‿close(), first, last, mtx, and ellipsis‿token::next.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿init‿_Ctra()

ellipsis‿token‿list * ellipsis‿token‿list‿init‿_Ctra ( ellipsis‿token‿list  __LOC_ID_0_4[static const 1])
inline

Initialize a token list.

Any object of the ellipsis‿token‿list type has to be initialized by this function.

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‿token‿list‿init‿_Inner(), and ELLIPSIS_CONTRACT.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿init‿_Insta()

ellipsis‿token‿list * ellipsis‿token‿list‿init‿_Insta ( ellipsis‿token‿list  __LOC_ID_0_1[static const 1])
inline

Initialize a token list.

Any object of the ellipsis‿token‿list type has to be initialized by this function.

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

end inner defer anchor, level 1

◆ ellipsis‿token‿list‿init()

ellipsis‿token‿list * ellipsis‿token‿list‿init ( ellipsis‿token‿list  __LOC_ID_0_1[static const 1])
inline

Initialize a token list.

Any object of the ellipsis‿token‿list type has to be initialized by this function.

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_CONTRACT.

◆ ellipsis‿token‿list‿is_finished()

bool ellipsis‿token‿list‿is_finished ( ellipsis‿token‿list  [static 1])

References finished, and mtx.

◆ ellipsis‿token‿list‿last()

token * ellipsis‿token‿list‿last ( ellipsis‿token‿list  [static 1])

Access the last element of a token list.

References last.

◆ ellipsis‿token‿list‿move()

void ellipsis‿token‿list‿move ( ellipsis‿token‿list __LOC_ID_0_7[restrict static 1],
ellipsis‿token‿list **restrict  __LOC_ID_0_8 
)
inline

Move a ellipsis‿token‿list 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.

◆ ellipsis‿token‿list‿new()

ellipsis‿token‿list * ellipsis‿token‿list‿new ( void  )
inline

allocate and return a new empty list

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿malloc, and ELLIPSIS_CONTRACT.

◆ ellipsis‿token‿list‿open()

void ellipsis‿token‿list‿open ( ellipsis‿token‿list  [static 1])

Open a token list for_DEFER_REPLAY_FOR append operations by a producer.

References finished, and mtx.

◆ ellipsis‿token‿list‿pop()

token * ellipsis‿token‿list‿pop ( ellipsis‿token‿list  [static 1])

pop a token form the list

Return a null pointer if the list is empty.

References _Atomic(), cnd, ellipsis‿error‿finished, ELLIPSIS_WARNING, finished, first, last, mtx, and ellipsis‿token::next.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿push()

void ellipsis‿token‿list‿push ( ellipsis‿token‿list  target[static 1],
ellipsis‿token‿list  source[static 1] 
)

prepend the whole contents of source to target

References cnd, ellipsis‿token‿list‿close(), ELLIPSIS_BUG, first, last, mtx, and ellipsis‿token::next.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿stringify‿_Ctra()

ellipsis‿str32 * ellipsis‿token‿list‿stringify‿_Ctra ( ellipsis‿token‿list const  __LOC_ID_0_6[static const 1])
inline

stringify the whole source list into one string token

The source is not modified. The return token is newly allocated.

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‿token‿list‿stringify‿_Inner(), and ELLIPSIS_CONTRACT.

Here is the call graph for this function:

◆ ellipsis‿token‿list‿stringify‿_Insta()

ellipsis‿str32 * ellipsis‿token‿list‿stringify‿_Insta ( ellipsis‿token‿list const  __LOC_ID_0_3[static const 1])
inline

stringify the whole source list into one string token

The source is not modified. The return token is newly allocated.

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

end inner defer anchor, level 1

◆ ellipsis‿token‿list‿stringify()

ellipsis‿str32 * ellipsis‿token‿list‿stringify ( ellipsis‿token‿list const  __LOC_ID_0_3[static const 1])
inline

stringify the whole source list into one string token

The source is not modified. The return token is newly allocated.

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_CONTRACT.

◆ ellipsis‿token‿list‿top()

token const * ellipsis‿token‿list‿top ( ellipsis‿token‿list  [static 1])

Peek into a token list.

References first.

◆ ellipsis‿token‿list‿wait()

void ellipsis‿token‿list‿wait ( ellipsis‿token‿list  [static 1])

Wait until the token list is finished.

References cnd, ellipsis‿error‿finished, ELLIPSIS_WARNING, finished, and mtx.

Field Documentation

◆ cnd

◆ finished

◆ first

◆ last

◆ mtx


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