Modular C
C the Modular C interface for the standard C library

This should give a complete interface to the C library as it is described by the C standard. More...

+ Collaboration diagram for C the Modular C interface for the standard C library:

Modules

 C◼F257
 
 C◼align
 
 C◼assert
 
 C◼atomic
 
 C◼bool
 
 C◼cenv
 
 C◼char
 
 C◼complex
 
 C◼def
 
 C◼env
 
 C◼equal
 
 C◼errno
 
 C◼fenv
 
 C◼fs
 
 C◼generic
 
 C◼int
 
 C◼integer
 
 C◼interface
 
 C◼intmax
 
 C◼intptr
 
 C◼io
 
 C◼is
 
 C◼iso646
 
 C◼lib
 
 C◼llong
 
 C◼locale
 
 C◼long
 
 C◼macro
 
 C◼math
 
 C◼mem
 
 C◼mod
 
 C◼noreturn
 
 C◼ptrdiff
 
 C◼real
 
 C◼schar
 
 C◼short
 
 C◼sig
 
 C◼size
 
 C◼sizeptr
 
 C◼snippet
 
 C◼std Backwards compatibility for C standard headers
 A module hierarchy that imports C library features one to one directly into the name space of the importer.
 
 C◼str
 
 C◼string
 
 C◼symbols
 
 C◼thrd
 
 C◼time
 
 C◼tmpl
 
 C◼uchar
 
 C◼uintmax
 
 C◼uintptr
 
 C◼ullong
 
 C◼ulong
 
 C◼unsigned
 
 C◼ushort
 
 C◼va
 
 C◼wchar
 
 C◼wcs
 
 C◼wint
 
 Platform features used by module C
 Some features are recovered or pre-computed specifically for the target platform by looking into the C include files:
 
 Specific macros to deal with the structure of module C.
 

Macros

#define C◼nullptr   ((void*)+0)
 
#define C◼DATE   __DATE__
 
#define C◼FILE   __FILE__
 
#define C◼LINE   __LINE__
 
#define C◼TIME   __TIME__
 
#define C◼MB_MIGHT_NEQ_WC   0
 
#define C◼ANALYZABLE   0
 
#define C◼IEC_559   0
 
#define C◼IEC_559_COMPLEX   0
 
#define C◼LIB_EXT1   000000L
 
#define C◼NO_ATOMICS   0
 
#define C◼NO_COMPLEX   0
 
#define C◼NO_VLA   0
 
#define C◼complex   _Complex
 
#define C◼noreturn   _Noreturn
 
#define C◼alignas   _Alignas
 
#define C◼alignof   _Alignof
 
#define C◼bool   _Bool
 
#define C◼false   0
 
#define C◼true   1
 
#define C◼and   ∧
 
#define C◼bitand   &
 
#define C◼bitor   ∪
 
#define C◼compl   ~
 
#define C◼not   ¬
 
#define C◼or   ∨
 
#define C◼xor   ^
 
#define C◼not_eq   ≠
 
#define C◼or_eq   ∪=
 
#define C◼and_eq   &=
 
#define C◼xor_eq   ^=
 
#define C◼rankof(X)   _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ _Bool: 0, _Bool const: 0, _Bool volatile: 0, _Bool volatile const: 0, char: 1, char const: 1, char volatile: 1, char volatile const: 1, unsigned char: 1, unsigned char const: 1, unsigned char volatile: 1, unsigned char volatile const: 1, signed char: 1, signed char const: 1, signed char volatile: 1, signed char volatile const: 1, unsigned short: 2, unsigned short const: 2, unsigned short volatile: 2, unsigned short volatile const: 2, signed short: 2, signed short const: 2, signed short volatile: 2, signed short volatile const: 2, default: _Generic((X)+0, unsigned: 3, signed: 3, unsigned long: 4, signed long: 4, unsigned long long: 5, signed long long: 5, default: 6))
 
#define C◼widthof(X)   _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ char: C◼CHAR_WIDTH, char const: C◼CHAR_WIDTH, char volatile: C◼CHAR_WIDTH, char volatile const: C◼CHAR_WIDTH, _Bool: C◼BOOL_WIDTH, _Bool const: C◼BOOL_WIDTH, _Bool volatile: C◼BOOL_WIDTH, _Bool volatile const: C◼BOOL_WIDTH, unsigned char: C◼UCHAR_WIDTH, unsigned char const: C◼UCHAR_WIDTH, unsigned char volatile: C◼UCHAR_WIDTH, unsigned char volatile const: C◼UCHAR_WIDTH, unsigned short: C◼USHRT_WIDTH, unsigned short const: C◼USHRT_WIDTH, unsigned short volatile: C◼USHRT_WIDTH, unsigned short volatile const: C◼USHRT_WIDTH, signed char: C◼SCHAR_WIDTH, signed char const: C◼SCHAR_WIDTH, signed char volatile: C◼SCHAR_WIDTH, signed char volatile const: C◼SCHAR_WIDTH, signed short: C◼SHRT_WIDTH, signed short const: C◼SHRT_WIDTH, signed short volatile: C◼SHRT_WIDTH, signed short volatile const: C◼SHRT_WIDTH, default: _Generic((X)+0, unsigned: C◼UINT_WIDTH, signed: C◼INT_WIDTH, unsigned long: C◼ULONG_WIDTH, signed long: C◼LONG_WIDTH, unsigned long long: C◼ULLONG_WIDTH, signed long long: C◼LLONG_WIDTH, default: sizeof(X)*C◼CHAR_WIDTH))
 
#define C◼signof(X)   _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ char: C◼CHAR_SIGN, char const: C◼CHAR_SIGN, char volatile: C◼CHAR_SIGN, char volatile const: C◼CHAR_SIGN, _Bool: 0, _Bool const: 0, _Bool volatile: 0, _Bool volatile const: 0, unsigned char: 0, unsigned char const: 0, unsigned char volatile: 0, unsigned char volatile const: 0, unsigned short: 0, unsigned short const: 0, unsigned short volatile: 0, unsigned short volatile const: 0, signed char: 1, signed char const: 1, signed char volatile: 1, signed char volatile const: 1, signed short: 1, signed short const: 1, signed short volatile: 1, signed short volatile const: 1, default: _Generic((X)+0, unsigned int: 0, signed int: 1, unsigned long: 0, signed long: 1, unsigned long long: 0, signed long long: 1, /* This should never error out, if used in */ /* a dead branch, e.g for pointers. */ default: 0))
 
#define C◼STRINGIFY(...)   _Intern◼_YDgXCYxS◼C◼STRINGIFY0(__VA_ARGS__)
 
#define C◼JOIN(A, B)   _Intern◼_YDgXCYxS◼C◼JOIN0(A, B)
 

Typedefs

typedef __size C◼size
 
typedef __size_signed C◼size_signed
 
typedef __ptrdiff C◼ptrdiff
 
typedef __ptrdiff_unsigned C◼ptrdiff_unsigned
 
typedef __wchar C◼wchar
 
typedef __uintptr C◼uintptr
 
typedef __intptr C◼intptr
 
typedef __uintmax C◼uintmax
 
typedef __intmax C◼intmax
 
typedef __wint C◼wint
 
typedef signed char C◼schar
 
typedef unsigned char C◼uchar
 
typedef unsigned short C◼ushort
 
typedef unsigned long C◼ulong
 
typedef signed long long C◼llong
 
typedef unsigned long long C◼ullong
 
typedef long double C◼ldouble
 
typedef char * C◼charp
 

Functions

void C◼module_assert (void)
 

Variables

unsigned long long volatile const C◼MODULE_ABI [] = { _Intern◼C◼SIGNATURE, }
 

Detailed Description

This should give a complete interface to the C library as it is described by the C standard.

The interface is divided in two parts.

Macro Definition Documentation

§ C◼alignas

#define C◼alignas   _Alignas

Definition at line 415 of file C.c.

§ C◼alignof

#define C◼alignof   _Alignof

Definition at line 416 of file C.c.

§ C◼ANALYZABLE

#define C◼ANALYZABLE   0

Definition at line 360 of file C.c.

§ C◼and

#define C◼and   ∧

Definition at line 422 of file C.c.

§ C◼and_eq

#define C◼and_eq   &=

Definition at line 431 of file C.c.

§ C◼bitand

#define C◼bitand   &

Definition at line 423 of file C.c.

§ C◼bitor

#define C◼bitor   ∪

Definition at line 424 of file C.c.

§ C◼bool

#define C◼bool   _Bool

Definition at line 418 of file C.c.

§ C◼compl

#define C◼compl   ~

Definition at line 425 of file C.c.

§ C◼complex

#define C◼complex   _Complex

Definition at line 411 of file C.c.

§ C◼DATE

#define C◼DATE   __DATE__

Definition at line 324 of file C.c.

§ C◼false

#define C◼false   0

Definition at line 419 of file C.c.

§ C◼FILE

#define C◼FILE   __FILE__

Definition at line 325 of file C.c.

§ C◼IEC_559

#define C◼IEC_559   0

Definition at line 366 of file C.c.

§ C◼IEC_559_COMPLEX

#define C◼IEC_559_COMPLEX   0

Definition at line 372 of file C.c.

§ C◼JOIN

#define C◼JOIN (   A,
 
)    _Intern◼_YDgXCYxS◼C◼JOIN0(A, B)

Definition at line 617 of file C.c.

§ C◼LIB_EXT1

#define C◼LIB_EXT1   000000L

Definition at line 378 of file C.c.

§ C◼LINE

#define C◼LINE   __LINE__

Definition at line 326 of file C.c.

§ C◼MB_MIGHT_NEQ_WC

#define C◼MB_MIGHT_NEQ_WC   0

Definition at line 342 of file C.c.

§ C◼NO_ATOMICS

#define C◼NO_ATOMICS   0

Definition at line 384 of file C.c.

§ C◼NO_COMPLEX

#define C◼NO_COMPLEX   0

Definition at line 390 of file C.c.

§ C◼NO_VLA

#define C◼NO_VLA   0

Definition at line 402 of file C.c.

§ C◼noreturn

#define C◼noreturn   _Noreturn

Definition at line 413 of file C.c.

§ C◼not

#define C◼not   ¬

Definition at line 426 of file C.c.

§ C◼not_eq

#define C◼not_eq   ≠

Definition at line 429 of file C.c.

§ C◼nullptr

#define C◼nullptr   ((void*)+0)

Definition at line 313 of file C.c.

§ C◼or

#define C◼or   ∨

Definition at line 427 of file C.c.

§ C◼or_eq

#define C◼or_eq   ∪=

Definition at line 430 of file C.c.

§ C◼rankof

#define C◼rankof (   X)    _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ _Bool: 0, _Bool const: 0, _Bool volatile: 0, _Bool volatile const: 0, char: 1, char const: 1, char volatile: 1, char volatile const: 1, unsigned char: 1, unsigned char const: 1, unsigned char volatile: 1, unsigned char volatile const: 1, signed char: 1, signed char const: 1, signed char volatile: 1, signed char volatile const: 1, unsigned short: 2, unsigned short const: 2, unsigned short volatile: 2, unsigned short volatile const: 2, signed short: 2, signed short const: 2, signed short volatile: 2, signed short volatile const: 2, default: _Generic((X)+0, unsigned: 3, signed: 3, unsigned long: 4, signed long: 4, unsigned long long: 5, signed long long: 5, default: 6))

Definition at line 435 of file C.c.

§ C◼signof

#define C◼signof (   X)    _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ char: C◼CHAR_SIGN, char const: C◼CHAR_SIGN, char volatile: C◼CHAR_SIGN, char volatile const: C◼CHAR_SIGN, _Bool: 0, _Bool const: 0, _Bool volatile: 0, _Bool volatile const: 0, unsigned char: 0, unsigned char const: 0, unsigned char volatile: 0, unsigned char volatile const: 0, unsigned short: 0, unsigned short const: 0, unsigned short volatile: 0, unsigned short volatile const: 0, signed char: 1, signed char const: 1, signed char volatile: 1, signed char volatile const: 1, signed short: 1, signed short const: 1, signed short volatile: 1, signed short volatile const: 1, default: _Generic((X)+0, unsigned int: 0, signed int: 1, unsigned long: 0, signed long: 1, unsigned long long: 0, signed long long: 1, /* This should never error out, if used in */ /* a dead branch, e.g for pointers. */ default: 0))

Definition at line 512 of file C.c.

§ C◼STRINGIFY

#define C◼STRINGIFY (   ...)    _Intern◼_YDgXCYxS◼C◼STRINGIFY0(__VA_ARGS__)

Definition at line 612 of file C.c.

§ C◼TIME

#define C◼TIME   __TIME__

Definition at line 327 of file C.c.

§ C◼true

#define C◼true   1

Definition at line 420 of file C.c.

§ C◼widthof

#define C◼widthof (   X)    _Generic((X), /* Narrow types can't be rvalued with +0, so we */ /* have to distinguish all qualifications. */ char: C◼CHAR_WIDTH, char const: C◼CHAR_WIDTH, char volatile: C◼CHAR_WIDTH, char volatile const: C◼CHAR_WIDTH, _Bool: C◼BOOL_WIDTH, _Bool const: C◼BOOL_WIDTH, _Bool volatile: C◼BOOL_WIDTH, _Bool volatile const: C◼BOOL_WIDTH, unsigned char: C◼UCHAR_WIDTH, unsigned char const: C◼UCHAR_WIDTH, unsigned char volatile: C◼UCHAR_WIDTH, unsigned char volatile const: C◼UCHAR_WIDTH, unsigned short: C◼USHRT_WIDTH, unsigned short const: C◼USHRT_WIDTH, unsigned short volatile: C◼USHRT_WIDTH, unsigned short volatile const: C◼USHRT_WIDTH, signed char: C◼SCHAR_WIDTH, signed char const: C◼SCHAR_WIDTH, signed char volatile: C◼SCHAR_WIDTH, signed char volatile const: C◼SCHAR_WIDTH, signed short: C◼SHRT_WIDTH, signed short const: C◼SHRT_WIDTH, signed short volatile: C◼SHRT_WIDTH, signed short volatile const: C◼SHRT_WIDTH, default: _Generic((X)+0, unsigned: C◼UINT_WIDTH, signed: C◼INT_WIDTH, unsigned long: C◼ULONG_WIDTH, signed long: C◼LONG_WIDTH, unsigned long long: C◼ULLONG_WIDTH, signed long long: C◼LLONG_WIDTH, default: sizeof(X)*C◼CHAR_WIDTH))

Definition at line 507 of file C.c.

§ C◼xor

#define C◼xor   ^

Definition at line 428 of file C.c.

§ C◼xor_eq

#define C◼xor_eq   ^=

Definition at line 432 of file C.c.

Typedef Documentation

§ C◼charp

typedef char* C◼charp

Definition at line 610 of file C.c.

§ C◼intmax

typedef __intmax C◼intmax

Definition at line 307 of file C.c.

§ C◼intptr

typedef __intptr C◼intptr

Definition at line 305 of file C.c.

§ C◼ldouble

typedef long double C◼ldouble

Definition at line 609 of file C.c.

§ C◼llong

typedef signed long long C◼llong

Definition at line 607 of file C.c.

§ C◼ptrdiff

typedef __ptrdiff C◼ptrdiff

Definition at line 300 of file C.c.

§ C◼ptrdiff_unsigned

typedef __ptrdiff_unsigned C◼ptrdiff_unsigned

Definition at line 301 of file C.c.

§ C◼schar

typedef signed char C◼schar

Definition at line 603 of file C.c.

§ C◼size

typedef __size C◼size

Definition at line 298 of file C.c.

§ C◼size_signed

typedef __size_signed C◼size_signed

Definition at line 299 of file C.c.

§ C◼uchar

typedef unsigned char C◼uchar

Definition at line 604 of file C.c.

§ C◼uintmax

typedef __uintmax C◼uintmax

Definition at line 306 of file C.c.

§ C◼uintptr

typedef __uintptr C◼uintptr

Definition at line 304 of file C.c.

§ C◼ullong

typedef unsigned long long C◼ullong

Definition at line 608 of file C.c.

§ C◼ulong

typedef unsigned long C◼ulong

Definition at line 606 of file C.c.

§ C◼ushort

typedef unsigned short C◼ushort

Definition at line 605 of file C.c.

§ C◼wchar

typedef __wchar C◼wchar

Definition at line 302 of file C.c.

§ C◼wint

typedef __wint C◼wint

Definition at line 308 of file C.c.

Function Documentation

§ C◼module_assert()

void C◼module_assert ( void  )

Definition at line 644 of file C.c.

644  {
645 #line 468 "/home/gustedt/build/cmod/C/C.X"
646  _Static_assert(C◼widthof((char)0) ≡ C◼CHAR_BIT, "the widths of character types must agree");
647  _Static_assert(C◼CHAR_WIDTHC◼widthof((unsigned char)0), "the widths of character types must agree");
648  _Static_assert(C◼CHAR_WIDTHC◼widthof((signed char)0), "the widths of character types must agree");
649  _Static_assert(C◼rankof((unsigned char)0) < C◼rankof(0U), "rankof not working properly");
650 }
#define C◼widthof(X)
Definition: C.c:507
#define C◼rankof(X)
Definition: C.c:435
#define C◼CHAR_WIDTH
The platform specific value (int)(msb(CHAR_MAX)+!!CHAR_MIN).
#define C◼CHAR_BIT
The platform specific value CHAR_BIT.

Variable Documentation

§ C◼MODULE_ABI