eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-directive.c File Reference
#include "ellipsis-directive.h"
#include "ellipsis-include.h"
#include "ellipsis-filter.h"
#include "token/ellipsis-tlist.h"
#include "ellipsis-macros.h"
#include "ellipsis-infra.h"
#include "ellipsis-expression.h"
#include "ellipsis-tokenize.h"
#include "ellipsis-pragma.h"
#include "ellipsis-special-directive_define.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
Include dependency graph for ellipsis-directive.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_STR32_LITERAL   ELLIPSIS_STR32_LITERAL_LOCAL
 
#define ELLIPSIS_STR8_LITERAL   ELLIPSIS_STR8_LITERAL_LOCAL
 
#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 void collect_names (ellipsis‿token‿list tl[static restrict 1], ellipsis‿token‿list names[static restrict 1], vtype count[static 1])
 
void ellipsis‿directive‿define (ellipsis‿token h[static 1], ellipsis‿token‿list *unbind)
 
ellipsis‿tokenellipsis‿directive‿define_process (ellipsis‿token‿list hpl[static 1], ellipsis‿token‿list *unbind)
 
void ellipsis‿directive‿embed (ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list out[static 1])
 
static void ellipsis‿directive‿embed_common (ellipsis‿token‿list fn[static 1], ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list out[static 1])
 
void ellipsis‿directive‿embed_resource (ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list out[static 1])
 
void ellipsis‿directive‿environment (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿error (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿expand (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿gather (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿include (ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list *restrict out)
 
static void ellipsis‿directive‿include_common (ellipsis‿token‿list fn[static 1], ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list *out, bool next)
 
void ellipsis‿directive‿include_directives (ellipsis‿token h[restrict static 1], ellipsis‿token‿list in[restrict static 1])
 
void ellipsis‿directive‿include_next (ellipsis‿token h[static 1], ellipsis‿token‿list in[static 1], ellipsis‿token‿list *restrict out)
 
void ellipsis‿directive‿include_source (ellipsis‿token h[restrict static 1], ellipsis‿token‿list in[restrict static 1], ellipsis‿token‿list *restrict out)
 
void ellipsis‿directive‿line (ellipsis‿token h[static 1])
 
static void ellipsis‿directive‿line_common (ellipsis‿token‿list fn[static 1], ellipsis‿token h[static 1])
 
void ellipsis‿directive‿linenumber (ellipsis‿token h[static 1])
 
static void ellipsis‿directive‿macro_get (ellipsis‿token‿list *target, ellipsis‿token *mac)
 
static void ellipsis‿directive‿mark_line (ellipsis‿token‿list *tl)
 
void ellipsis‿directive‿move (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿pragma (ellipsis‿token h[static 1], ellipsis‿token‿list *restrict in, ellipsis‿token‿list *restrict out)
 
void ellipsis‿directive‿scatter (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿undef (ellipsis‿token h[static 1])
 
void ellipsis‿directive‿warning (ellipsis‿token h[static 1])
 
static void mark_parameters (ellipsis‿token‿list *tl, ellipsis‿token‿list *names, ellipsis‿token‿list *va_opt)
 

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
 
ellipsis‿str32 const *const ellipsis‿directive‿marker = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE")
 
ellipsis‿str32 const *const ellipsis‿directive‿marker_return = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE_RETURN")
 
ellipsis‿str32 const *const ellipsis‿directive‿marker_start = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE_START")
 

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)
#define ELLIPSIS_TEST_ICE(...)
Definition ellipsis-directive.c:50
#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR,...)
Definition ellipsis-directive.c:58
#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-directive.c:40
struct ellipsis‿contracts‿is_ice ellipsis‿contracts‿is_ice
Definition ellipsis-expression.c:24
#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-directive.c:52

◆ 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-directive.c:31

◆ 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-directive.c:28

◆ ELLIPSIS_STR32_LITERAL

#define ELLIPSIS_STR32_LITERAL   ELLIPSIS_STR32_LITERAL_LOCAL

◆ ELLIPSIS_STR8_LITERAL

#define ELLIPSIS_STR8_LITERAL   ELLIPSIS_STR8_LITERAL_LOCAL

◆ 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

◆ collect_names()

static void collect_names ( ellipsis‿token‿list  tl[static restrict 1],
ellipsis‿token‿list  names[static restrict 1],
vtype  count[static 1] 
)
static

◆ ellipsis‿directive‿define()

void ellipsis‿directive‿define ( ellipsis‿token  h[static 1],
ellipsis‿token‿list unbind 
)

References ellipsis‿directive‿define_process(), ellipsis‿macros‿insert(), and ellipsis‿token::payload.

Referenced by ellipsis‿directive‿environment(), ellipsis‿filter(), and ellipsis‿macros‿cb‿bind().

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

◆ ellipsis‿directive‿define_process()

◆ ellipsis‿directive‿embed()

void ellipsis‿directive‿embed ( ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list  out[static 1] 
)

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿embed_common(), ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿destroy(), ELLIPSIS_BUG, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿embed_common()

static void ellipsis‿directive‿embed_common ( ellipsis‿token‿list  fn[static 1],
ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list  out[static 1] 
)
static

start inner defer anchor at level 1

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

start inner defer anchor at level 4

defer needs braces and a semicolon

end inner defer anchor, level 4

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

end inner defer anchor, level 1

References ellipsis‿str32::array, ellipsis‿str8::array, base64, ellipsis‿special::cat, ellipsis‿token::cat, ellipsis‿special::closer8, code, codeblock, comment, ellipsis‿token::contents, ellipsis‿token::data, ellipsis‿directive‿mark_line(), ellipsis‿include‿dat_dir(), ellipsis‿include‿emb_dir(), ellipsis‿include‿embed(), ellipsis‿include‿fopen(), ellipsis‿include‿process(), ellipsis‿include‿repair(), ellipsis‿infra‿down(), ellipsis‿macros‿repair(), ellipsis‿str32‿construct(), ellipsis‿str32‿delete(), ellipsis‿str32‿dup, ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿push(), ellipsis‿token‿list‿top(), ellipsis‿token‿what‿binary, ellipsis‿token‿what‿else, ELLIPSIS_CONTRACT, ellipsis‿token::is_what, last, ellipsis‿str32::length, ellipsis‿str8::length, ellipsis‿token::next, ellipsis‿token::payload, punctuator, special, ellipsis‿special::starter8, string, tokenizer_find, and verbatim.

Referenced by ellipsis‿directive‿embed(), and ellipsis‿directive‿embed_resource().

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

◆ ellipsis‿directive‿embed_resource()

void ellipsis‿directive‿embed_resource ( ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list  out[static 1] 
)

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿embed_common(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿flush(), and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿environment()

void ellipsis‿directive‿environment ( ellipsis‿token  h[static 1])

◆ ellipsis‿directive‿error()

void ellipsis‿directive‿error ( ellipsis‿token  h[static 1])

References ellipsis‿str32‿fputs(), ellipsis‿token‿list‿pop(), ELLIPSIS_ERROR, and ellipsis‿token::payload.

Referenced by ellipsis‿filter(), and ellipsis‿macros‿cb‿error().

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

◆ ellipsis‿directive‿expand()

void ellipsis‿directive‿expand ( ellipsis‿token  h[static 1])

◆ ellipsis‿directive‿gather()

◆ ellipsis‿directive‿include()

void ellipsis‿directive‿include ( ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list *restrict  out 
)

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿include_common(), ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿close(), ELLIPSIS_BUG, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿include_common()

static void ellipsis‿directive‿include_common ( ellipsis‿token‿list  fn[static 1],
ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list out,
bool  next 
)
static

◆ ellipsis‿directive‿include_directives()

void ellipsis‿directive‿include_directives ( ellipsis‿token  h[restrict static 1],
ellipsis‿token‿list  in[restrict static 1] 
)

References ellipsis‿directive‿include_source().

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿include_next()

void ellipsis‿directive‿include_next ( ellipsis‿token  h[static 1],
ellipsis‿token‿list  in[static 1],
ellipsis‿token‿list *restrict  out 
)

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿include_common(), ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿close(), ELLIPSIS_BUG, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿include_source()

void ellipsis‿directive‿include_source ( ellipsis‿token  h[restrict static 1],
ellipsis‿token‿list  in[restrict static 1],
ellipsis‿token‿list *restrict  out 
)

References ellipsis‿directive‿include_common(), ellipsis‿token‿list‿close(), and ellipsis‿token‿list‿flush().

Referenced by ellipsis‿directive‿include_directives(), and ellipsis‿filter().

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

◆ ellipsis‿directive‿line()

void ellipsis‿directive‿line ( ellipsis‿token  h[static 1])

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿line_common(), ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), ELLIPSIS_BUG, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿line_common()

◆ ellipsis‿directive‿linenumber()

void ellipsis‿directive‿linenumber ( ellipsis‿token  h[static 1])

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿directive‿line_common(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿flush(), and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿macro_get()

◆ ellipsis‿directive‿mark_line()

static void ellipsis‿directive‿mark_line ( ellipsis‿token‿list tl)
static

References directive, ellipsis‿infra‿filter_file, ellipsis‿infra‿filter_line, ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), exp_unsigned, and nominal.

Referenced by ellipsis‿directive‿embed_common().

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

◆ ellipsis‿directive‿move()

void ellipsis‿directive‿move ( ellipsis‿token  h[static 1])

start inner defer anchor at level 1

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

end inner defer anchor, level 2

end inner defer anchor, level 1

References ellipsis‿token::cat, ellipsis‿token::contents, ellipsis‿directive‿macro_get(), ellipsis‿macros‿find(), ellipsis‿macros‿insert(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿flush(), ellipsis‿token‿list‿last(), ellipsis‿token‿list‿pop(), ellipsis‿token‿list‿top(), ELLIPSIS_CONTRACT, last, macro, nominal, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿pragma()

◆ ellipsis‿directive‿scatter()

void ellipsis‿directive‿scatter ( ellipsis‿token  h[static 1])

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

end inner defer anchor, level 1

References ellipsis‿directive‿macro_get(), ellipsis‿macros‿find(), ellipsis‿macros‿insert(), ellipsis‿str32‿dup, ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿flush(), ellipsis‿token‿list‿last(), ellipsis‿token‿list‿scatter(), ELLIPSIS_BUG, ELLIPSIS_CONTRACT, ELLIPSIS_WARNING, last, macro, nominal, and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿undef()

void ellipsis‿directive‿undef ( ellipsis‿token  h[static 1])

References ellipsis‿token::contents, ellipsis‿macros‿remove(), ellipsis‿token‿list‿pop(), and ellipsis‿token::payload.

Referenced by ellipsis‿filter().

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

◆ ellipsis‿directive‿warning()

void ellipsis‿directive‿warning ( ellipsis‿token  h[static 1])

References ellipsis‿str32‿fputs(), ellipsis‿token‿list‿pop(), ELLIPSIS_WARNING, and ellipsis‿token::payload.

Referenced by ellipsis‿filter(), and ellipsis‿macros‿cb‿warning().

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

◆ mark_parameters()

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

◆ ellipsis‿directive‿marker

ellipsis‿str32 const* const ellipsis‿directive‿marker = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE")

Referenced by ellipsis‿filter().

◆ ellipsis‿directive‿marker_return

ellipsis‿str32 const* const ellipsis‿directive‿marker_return = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE_RETURN")

◆ ellipsis‿directive‿marker_start

ellipsis‿str32 const* const ellipsis‿directive‿marker_start = &ELLIPSIS_STR32_STRING_LITERAL("ELLIPSIS_MARK_LINE_START")