eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-include.c File Reference
#include "ellipsis-include.h"
#include "ellipsis-infra.h"
#include "utils/ellipsis-error.h"
#include <stdlib.h>
#include <threads.h>
#include "language/ellipsis-special.h"
#include "utils/ellipsis-carray.h"
#include "ellipsis-macros.h"
#include "ellipsis-expression.h"
#include "utils/ellipsis-init.h"
#include "utils/ellipsis-malloc.h"
#include "language/directive/ellipsis-directive.h"
#include "language/directive/ellipsis-special-directive_include.h"
#include "ellipsis-filter.h"
#include "ellipsis-tokenize.h"
#include <stdio.h>
#include <stdint.h>
Include dependency graph for ellipsis-include.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

 _Atomic (size_t)
 
char * copy_filename (char const d[static 1])
 
static void ellipsis‿include‿_Once‿atexit‿callback (void)
 
static void ellipsis‿include‿_Once‿init‿callback (void)
 
static void ellipsis‿include‿_Once‿init‿user (void)
 
void ellipsis‿include‿_Once‿init (void)
 
void ellipsis‿include‿app_dir (char const d[static 1])
 
void ellipsis‿include‿dat_dir (char const d[static 1])
 
void ellipsis‿include‿emb_dir (char const d[static 1])
 
ellipsis‿tokenellipsis‿include‿embed (FILE *f, size_t offset, size_t limit)
 
int ellipsis‿include‿fclose (FILE *f)
 
FILE * ellipsis‿include‿fopen (char *name, bool bin, bool next)
 
FILE * ellipsis‿include‿fopen32 (ellipsis‿str32 const *name32, bool bin, bool next)
 
void ellipsis‿include‿imp_dir (char const d[static 1])
 
void ellipsis‿include‿process (ellipsis‿token‿list *tl, ellipsis‿token *name[restrict static 1], size_t *restrict offset, size_t *restrict limit, ellipsis‿token *prefix[restrict static 1], ellipsis‿token *suffix[restrict static 1], ellipsis‿token **restrict if_empty, ellipsis‿token **restrict other)
 
void ellipsis‿include‿repair (ellipsis‿token‿list *tl)
 

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
 
static void(*const ellipsis‿include‿_Once‿atexit‿pointer )(void) = ellipsis‿include‿_Once‿atexit‿callback
 
bool const ellipsis‿include‿_Once‿strong = true
 
ellipsis‿str8ellipsis‿include‿directory
 

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-include.c:58
#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR,...)
Definition ellipsis-include.c:66
#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-include.c:48
#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-include.c:60

◆ 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-include.c:39

◆ 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-include.c:36

◆ 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

◆ _Atomic()

_Atomic ( size_t  )

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‿expression‿evaluate(), ellipsis‿str32‿construct(), ellipsis‿str32‿delete(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿close(), ellipsis‿token‿list‿destroy(), ELLIPSIS_ERROR, and exp_signed.

Referenced by ellipsis‿token‿list::ellipsis‿token‿list‿pop().

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

◆ copy_filename()

char * copy_filename ( char const  d[static 1])

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_alloc, and ELLIPSIS_CONTRACT.

Referenced by ellipsis‿include‿_Once‿init‿user(), ellipsis‿include‿app_dir(), ellipsis‿include‿dat_dir(), ellipsis‿include‿emb_dir(), and ellipsis‿include‿imp_dir().

Here is the caller graph for this function:

◆ ellipsis‿include‿_Once‿atexit‿callback()

static void ellipsis‿include‿_Once‿atexit‿callback ( void  )
static

References ellipsis‿carray‿delete(), and ellipsis‿include‿directory.

Here is the call graph for this function:

◆ ellipsis‿include‿_Once‿init‿callback()

static void ellipsis‿include‿_Once‿init‿callback ( void  )
static

References __FILE__, ellipsis‿include‿_Once‿atexit‿pointer, ellipsis‿include‿_Once‿init‿user(), and GNU_ATTR_USED.

Referenced by ellipsis‿include‿_Once‿init().

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

◆ ellipsis‿include‿_Once‿init‿user()

static void ellipsis‿include‿_Once‿init‿user ( void  )
static

References __FILE__, copy_filename(), ellipsis‿token‿_Once‿init(), and GNU_ATTR_USED.

Referenced by ellipsis‿include‿_Once‿init‿callback().

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

◆ ellipsis‿include‿_Once‿init()

void ellipsis‿include‿_Once‿init ( void  )

References ellipsis‿include‿_Once‿init‿callback().

Referenced by ellipsis‿include‿app_dir(), ellipsis‿include‿dat_dir(), ellipsis‿include‿emb_dir(), and ellipsis‿include‿imp_dir().

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

◆ ellipsis‿include‿app_dir()

void ellipsis‿include‿app_dir ( char const  d[static 1])

References __FILE__, copy_filename(), ellipsis‿include‿_Once‿init(), ellipsis‿include‿_Once‿strong, and GNU_ATTR_USED.

Referenced by ellipsis‿directive‿include_common(), and main().

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

◆ ellipsis‿include‿dat_dir()

void ellipsis‿include‿dat_dir ( char const  d[static 1])

References __FILE__, copy_filename(), ellipsis‿include‿_Once‿init(), ellipsis‿include‿_Once‿strong, and GNU_ATTR_USED.

Referenced by ellipsis‿directive‿embed_common().

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

◆ ellipsis‿include‿emb_dir()

void ellipsis‿include‿emb_dir ( char const  d[static 1])

References __FILE__, copy_filename(), ellipsis‿include‿_Once‿init(), ellipsis‿include‿_Once‿strong, and GNU_ATTR_USED.

Referenced by ellipsis‿directive‿embed_common().

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

◆ ellipsis‿include‿embed()

ellipsis‿token * ellipsis‿include‿embed ( FILE *  f,
size_t  offset,
size_t  limit 
)

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 binary, ellipsis‿infra‿filter_file, ellipsis‿infra‿filter_line, ellipsis‿token‿what‿binary, ELLIPSIS_CONTRACT, end, and line.

Referenced by ellipsis‿directive‿embed_common().

Here is the caller graph for this function:

◆ ellipsis‿include‿fclose()

int ellipsis‿include‿fclose ( FILE *  f)

Referenced by ellipsis‿macros‿cb‿has_file(), and ellipsis‿tokenize().

Here is the caller graph for this function:

◆ ellipsis‿include‿fopen()

FILE * ellipsis‿include‿fopen ( char *  name,
bool  bin,
bool  next 
)

◆ ellipsis‿include‿fopen32()

FILE * ellipsis‿include‿fopen32 ( ellipsis‿str32 const *  name32,
bool  bin,
bool  next 
)

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‿str32::array, ellipsis‿include‿fopen(), ellipsis‿str32‿delete(), ellipsis‿str32‿dup, and ellipsis‿str32::length.

Referenced by ellipsis‿macros‿cb‿has_file().

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

◆ ellipsis‿include‿imp_dir()

◆ ellipsis‿include‿process()

void ellipsis‿include‿process ( ellipsis‿token‿list tl,
ellipsis‿token name[restrict static 1],
size_t *restrict  offset,
size_t *restrict  limit,
ellipsis‿token prefix[restrict static 1],
ellipsis‿token suffix[restrict static 1],
ellipsis‿token **restrict  if_empty,
ellipsis‿token **restrict  other 
)

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

end inner defer anchor, level 2

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 comment, ellipsis‿category‿getname(), ellipsis‿str32‿delete(), ellipsis‿str32‿dup, ellipsis‿token‿list‿all(), ellipsis‿token‿list‿append(), ellipsis‿token‿list‿collect_call(), ellipsis‿token‿list‿destroy(), ellipsis‿token‿list‿flush(), ellipsis‿token‿list‿pop(), ellipsis‿token‿list‿top(), ELLIPSIS_CONTRACT, ELLIPSIS_DIAGNOSTIC, ELLIPSIS_WARNING, exp_signed, exp_unsigned, and parameter.

Referenced by ellipsis‿directive‿embed_common(), ellipsis‿directive‿include_common(), and ellipsis‿macros‿cb‿has_file().

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

◆ ellipsis‿include‿repair()

void ellipsis‿include‿repair ( ellipsis‿token‿list tl)

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

start inner defer anchor at level 1

defer needs braces and a semicolon

end inner defer anchor, level 1

References ellipsis‿filter(), ellipsis‿if_case‿open, ellipsis‿special‿directive_include‿find, 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‿top(), ellipsis‿tokenize‿string(), ELLIPSIS_CONTRACT, and first.

Referenced by ellipsis‿directive‿embed_common(), ellipsis‿directive‿include_common(), and ellipsis‿macros‿cb‿has_file().

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

◆ ellipsis‿include‿_Once‿atexit‿pointer

static void(*) const ellipsis‿include‿_Once‿atexit‿pointer(void) ( void  ) = ellipsis‿include‿_Once‿atexit‿callback
static

◆ ellipsis‿include‿_Once‿strong

◆ ellipsis‿include‿directory