eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-filter.c File Reference
Include dependency graph for ellipsis-filter.c:

Macros

#define ELLIPSIS_CONTRACT(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...)
 
#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR, ...)
 
#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...)
 
#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE, ...)
 
#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR, ...)
 
#define ELLIPSIS_TEST_ICE(...)   (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)
 
#define ELLIPSIS_TO_VOIDS(...)   ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))
 
#define STRINGIFY(...)   STRINGIFY_(__VA_ARGS__)
 
#define STRINGIFY_(...)   #__VA_ARGS__
 

Typedefs

typedef struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice
 

Functions

static ellipsis‿token‿listcallback_call (ellipsis‿token *repl, ellipsis‿token *al)
 
static void ellipsis‿filter‿local (ellipsis‿token *repl, ellipsis‿token‿list *in, ellipsis‿token‿list *out, ellipsis‿category cat)
 
static int ellipsis‿filter‿thrd (void *p)
 
thrd_t ellipsis‿filter‿thread (ellipsis‿token‿list tl[static 2])
 
void ellipsis‿filter (ellipsis‿token‿list in[restrict static 1], ellipsis‿token‿list *restrict out, ellipsis‿if_case ic, bool close)
 
static bool evaluate_expression (ellipsis‿token‿list *tl)
 
static ellipsis‿token‿listexpand_functional (ellipsis‿token repl[static 1], ellipsis‿token‿list in[static 1], bool with_paren, ellipsis‿str32 const *spacep[static 1])
 
static bool expand_macro (ellipsis‿token h[static 1], ellipsis‿token repl[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list out[static 1])
 

Variables

thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic
 
thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic
 
thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic
 

Detailed Description

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

Macro Definition Documentation

◆ ELLIPSIS_CONTRACT

#define ELLIPSIS_CONTRACT (   COUNT,
  COND,
  ACTION,
  VERB,
  CSTR,
  CTYPE,
  ... 
)
Value:
\
do { \
_Generic( \
default: ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE __VA_OPT__(,) __VA_ARGS__));\
} while(false)
struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice
Definition ellipsis-expression.c:24
#define ELLIPSIS_TEST_ICE(...)
Definition ellipsis-filter.c:54
#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR,...)
Definition ellipsis-filter.c:62
#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-filter.c:44
#define __VA_OPT__
A pseudo macro that cannot be redefined.
Definition ellipsis-predefined.dirs:89

◆ ELLIPSIS_CONTRACT_CHECK_STATIC

#define ELLIPSIS_CONTRACT_CHECK_STATIC (   CTYPE,
  COND,
  CSTR,
  ... 
)
Value:
({\
static_assert(ELLIPSIS_CONTRACT_ICE_OR_TRUE(COND), \
"compile time violation of " CTYPE " " CSTR \
__VA_OPT__(", ") __VA_ARGS__ );\
})
#define ELLIPSIS_CONTRACT_ICE_OR_TRUE(...)
Definition ellipsis-filter.c:56

◆ ELLIPSIS_CONTRACT_ICE_OR_TRUE

#define ELLIPSIS_CONTRACT_ICE_OR_TRUE (   ...)
Value:
_Generic( \
ELLIPSIS_TEST_ICE(__VA_ARGS__), \
ellipsis‿contracts‿is_ice*: (__VA_ARGS__), \
default: true)
#define true
The constant true made accessible to the preprocessor.
Definition ellipsis-builtins.dirs:32

◆ ELLIPSIS_CONTRACT_IMPL

#define ELLIPSIS_CONTRACT_IMPL (   COUNT,
  COND,
  ACTION,
  VERB,
  CSTR,
  CTYPE,
  ... 
)
Value:
(((false) || (COND)) \
? (void)0 \
: (ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR __VA_OPT__(,) __VA_ARGS__) \
, ((false) \
? (void)0 \
: ACTION())))
#define ELLIPSIS_CONTRACT_VIOLATION(COUNT, VERB, CTYPE, CSTR,...)
Definition ellipsis-filter.c:35

◆ ELLIPSIS_CONTRACT_VIOLATION

#define ELLIPSIS_CONTRACT_VIOLATION (   COUNT,
  VERB,
  CTYPE,
  CSTR,
  ... 
)
Value:
({\
static char const contract_format_ ## COUNT[] = \
__FILE__ ":" STRINGIFY(__LINE__) ": violation of " CTYPE " `" CSTR "`" __VA_OPT__(", ") __VA_ARGS__ "\n";\
(VERB \
? fputs(contract_format_ ## COUNT, stderr) \
: 0);\
})
#define __FILE__
The current source file as required by the C standard.
Definition ellipsis-builtins.dirs:21
#define __LINE__
The current physical source line as required by the C standard.
Definition ellipsis-builtins.dirs:24
#define STRINGIFY(...)
Definition ellipsis-filter.c:32

◆ ELLIPSIS_TEST_ICE

#define ELLIPSIS_TEST_ICE (   ...)    (false ? ELLIPSIS_TO_VOIDS(__VA_ARGS__) : (ellipsis‿contracts‿is_ice*)nullptr)

◆ ELLIPSIS_TO_VOIDS

#define ELLIPSIS_TO_VOIDS (   ...)    ((void*)((uintptr_t)((__VA_ARGS__)-(__VA_ARGS__))))

◆ STRINGIFY

#define STRINGIFY (   ...)    STRINGIFY_(__VA_ARGS__)

◆ STRINGIFY_

#define STRINGIFY_ (   ...)    #__VA_ARGS__

Typedef Documentation

◆ ellipsis‿contracts‿is_ice

Function Documentation

◆ callback_call()

static ellipsis‿token‿list * callback_call ( ellipsis‿token repl,
ellipsis‿token al 
)
static

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‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿open(), and ELLIPSIS_CONTRACT.

Referenced by expand_macro().

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

◆ ellipsis‿filter‿local()

static void ellipsis‿filter‿local ( ellipsis‿token repl,
ellipsis‿token‿list in,
ellipsis‿token‿list out,
ellipsis‿category  cat 
)
static

start inner defer anchor at level 1

defer needs braces and a semicolon

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿token::cat, comment, ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), and ellipsis‿token‿list‿top().

Referenced by expand_functional().

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

◆ ellipsis‿filter‿thrd()

static int ellipsis‿filter‿thrd ( void *  p)
static

References ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿infra‿fileno(), ellipsis‿infra‿filter_file, ellipsis‿token‿list‿open(), and ELLIPSIS_BUG.

Referenced by ellipsis‿filter‿thread().

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

◆ ellipsis‿filter‿thread()

thrd_t ellipsis‿filter‿thread ( ellipsis‿token‿list  tl[static 2])

References ellipsis‿filter‿thrd().

Referenced by main().

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

◆ ellipsis‿filter()

void ellipsis‿filter ( ellipsis‿token‿list  in[restrict static 1],
ellipsis‿token‿list *restrict  out,
ellipsis‿if_case  ic,
bool  close 
)

start inner defer anchor at level 1

defer needs braces and a semicolon

start inner defer anchor at level 2

defer needs braces and a semicolon

end inner defer anchor, level 2

start inner defer anchor at level 2

defer needs braces and a semicolon

start inner defer anchor at level 3

defer needs braces and a semicolon

start inner defer anchor at level 4

defer needs braces and a semicolon

end inner defer anchor, level 4

start inner defer anchor at level 4

defer needs braces and a semicolon

defer needs braces and a semicolon

start inner defer anchor at level 5

defer needs braces and a semicolon

end inner defer anchor, level 5

end inner defer anchor, level 4

end inner defer anchor, level 3

end inner defer anchor, level 2

end inner defer anchor, level 1

References ellipsis‿str32::array, ellipsis‿token::contents, directive, ellipsis‿category‿is_multiline(), ellipsis‿directive‿define(), ellipsis‿directive‿define_process(), ellipsis‿directive‿embed(), ellipsis‿directive‿embed_resource(), ellipsis‿directive‿environment(), ellipsis‿directive‿error(), ellipsis‿directive‿expand(), ellipsis‿directive‿gather(), ellipsis‿directive‿include(), ellipsis‿directive‿include_directives(), ellipsis‿directive‿include_next(), ellipsis‿directive‿include_source(), ellipsis‿directive‿line(), ellipsis‿directive‿linenumber(), ellipsis‿directive‿marker, ellipsis‿directive‿move(), ellipsis‿directive‿pragma(), ellipsis‿directive‿scatter(), ellipsis‿directive‿undef(), ellipsis‿directive‿warning(), ellipsis‿filter(), ellipsis‿if_case‿else, ellipsis‿if_case‿endif, ellipsis‿if_case‿maybe, ellipsis‿if_case‿open, ellipsis‿infra‿file(), ellipsis‿infra‿filter_file, ellipsis‿infra‿filter_line, ellipsis‿infra‿filter_lineno, ellipsis‿lex‿Continue(), ellipsis‿macros‿find(), ellipsis‿macros‿insert(), ellipsis‿macros‿paren‿dec(), ellipsis‿macros‿paren‿inc(), ellipsis‿macros‿unbind_set(), ellipsis‿str32‿construct(), ellipsis‿str32‿delete(), ellipsis‿str32‿dup, ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿open(), ellipsis‿token‿list‿pop(), ellipsis‿token‿list‿push(), ellipsis‿token‿list‿top(), ELLIPSIS_CONTRACT, ellipsis_expand_prefix_max, ELLIPSIS_WARNING, evaluate_expression(), expand_macro(), frozen, keep, last, ellipsis‿str32::length, nominal, ellipsis‿token::payload, and peek.

Referenced by ellipsis‿directive‿embed(), ellipsis‿directive‿expand(), ellipsis‿directive‿include(), ellipsis‿directive‿include_common(), ellipsis‿directive‿include_next(), ellipsis‿directive‿line(), ellipsis‿filter‿local(), ellipsis‿filter‿thrd(), ellipsis‿filter(), ellipsis‿include‿repair(), ellipsis‿language‿c‿_Once‿init‿user(), ellipsis‿language‿html‿_Once‿init‿user(), ellipsis‿language‿lex‿_Once‿init‿user(), ellipsis‿language‿markdown‿_Once‿init‿user(), evaluate_expression(), expand_macro(), has_c_attribute_callback(), and main().

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

◆ evaluate_expression()

static bool evaluate_expression ( ellipsis‿token‿list tl)
static

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿expression‿evaluate(), ellipsis‿expression‿resolve_defined(), ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿destroy(), ELLIPSIS_CONTRACT, and ellipsis‿token::value.

Referenced by ellipsis‿filter().

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

◆ expand_functional()

static ellipsis‿token‿list * expand_functional ( ellipsis‿token  repl[static 1],
ellipsis‿token‿list  in[static 1],
bool  with_paren,
ellipsis‿str32 const *  spacep[static 1] 
)
static

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

defer needs braces and a semicolon

start inner defer anchor at level 2

defer needs braces and a semicolon

start inner defer anchor at level 3

defer needs braces and a semicolon

end inner defer anchor, level 3

start inner defer anchor at level 3

defer needs braces and a semicolon

end inner defer anchor, level 3

end inner defer anchor, level 2

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿token::cat, ellipsis‿token::contents, ellipsis‿filter‿local(), ellipsis‿lex‿category(), ellipsis‿macros‿find(), ellipsis‿special‿directive_define‿find, ellipsis‿str32‿delete(), ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿collect_call(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿first(), ellipsis‿token‿list‿flush(), ellipsis‿token‿list‿pop(), ellipsis‿token‿list‿push(), ellipsis‿token‿list‿scatter(), ellipsis‿token‿list‿top(), ELLIPSIS_CONTRACT, exp_signed, exp_unsigned, first, frozen, ellipsis‿token::is_functional, is_variable(), ellipsis‿token::next, nominal, parameter, ellipsis‿token::payload, string, stringifier, and ellipsis‿token::value.

Referenced by expand_macro().

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

◆ expand_macro()

static bool expand_macro ( ellipsis‿token  h[static 1],
ellipsis‿token  repl[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list  out[static 1] 
)
static

start inner defer anchor at level 1

DEFER_TYPE needs a semicolon

start inner defer anchor at level 2

defer needs braces and a semicolon

defer needs braces and a semicolon

start inner defer anchor at level 3

defer needs braces and a semicolon

defer needs braces and a semicolon

end inner defer anchor, level 3

end inner defer anchor, level 2

end inner defer anchor, level 1

References callback_call(), ellipsis‿token::cat, ellipsis‿token::contents, ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿str32‿delete(), ellipsis‿token‿list‿all(), ellipsis‿token‿list‿collect_call(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿last(), ellipsis‿token‿list‿push(), ellipsis‿token‿list‿top(), ellipsis‿token‿what‿binary, ellipsis‿token‿what‿callback, ellipsis‿token‿what‿else, expand_functional(), frozen, ellipsis‿token::is_functional, ellipsis‿token::is_what, last, macro, ellipsis‿token::payload, and ellipsis‿token::space.

Referenced by ellipsis‿filter().

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

Variable Documentation

◆ ellipsis‿contracts‿ignore‿dynamic

thread_local bool volatile ellipsis‿contracts‿ignore‿dynamic
extern

◆ ellipsis‿contracts‿proceed‿dynamic

thread_local bool volatile ellipsis‿contracts‿proceed‿dynamic
extern

◆ ellipsis‿contracts‿verbose‿dynamic

thread_local bool volatile ellipsis‿contracts‿verbose‿dynamic
extern