eĿlipsis
a language independent preprocessor
 
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
ellipsis-carray.h File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include "utils/ellipsis-error.h"
#include <stdint.h>
Include dependency graph for ellipsis-carray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ellipsis‿carray
 A structure with a flexible array member of base type ellipsis‿carray‿base. More...
 

Macros

#define ELLIPSIS_CARRAY_LITERAL   ELLIPSIS_CARRAY_LITERAL_LOCAL
 
#define ELLIPSIS_CARRAY_LITERAL_GLOBAL(N, ...)
 
#define ELLIPSIS_CARRAY_OVERLAY(N)
 
#define ELLIPSIS_CARRAY_STATIC(N, ...)
 
#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
 

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_CARRAY_LITERAL

#define ELLIPSIS_CARRAY_LITERAL   ELLIPSIS_CARRAY_LITERAL_LOCAL

◆ ELLIPSIS_CARRAY_LITERAL_GLOBAL

#define ELLIPSIS_CARRAY_LITERAL_GLOBAL (   N,
  ... 
)
Value:
sizeof((ellipsis‿carray‿base[]){__VA_ARGS__ }) \
/sizeof(ellipsis‿carray‿base))) \
{\
.length = (N), \
.array = {__VA_ARGS__ }, \
}.fa)
#define ELLIPSIS_CARRAY_OVERLAY(N)
Definition ellipsis-carray.h:219

◆ ELLIPSIS_CARRAY_OVERLAY

#define ELLIPSIS_CARRAY_OVERLAY (   N)
Value:
union {\
struct {\
size_t const length;\
size_t const padding;\
unsigned const :(offsetof(ellipsis‿carray, array)-2*sizeof(size_t));\
ellipsis‿carray‿base array[N];\
};\
}
A structure with a flexible array member of base type ellipsis‿carray‿base.
Definition ellipsis-carray.h:182

◆ ELLIPSIS_CARRAY_STATIC

#define ELLIPSIS_CARRAY_STATIC (   N,
  ... 
)
Value:
(({\
static const ELLIPSIS_CARRAY_OVERLAY( \
sizeof((ellipsis‿carray‿base[]){__VA_ARGS__ }) \
/sizeof(ellipsis‿carray‿base)) \
__LOC_ID_1_3 = {\
.length = (N), \
.array = {__VA_ARGS__ }, \
};&__LOC_ID_1_3;})->fa)

◆ 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-carray.h:97
#define ELLIPSIS_CONTRACT_CHECK_STATIC(CTYPE, COND, CSTR,...)
Definition ellipsis-carray.h:105
#define ELLIPSIS_CONTRACT_IMPL(COUNT, COND, ACTION, VERB, CSTR, CTYPE,...)
Definition ellipsis-carray.h:87
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-carray.h:99

◆ 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-carray.h:78

◆ 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-carray.h:75

◆ 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

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