Ylva And Malin
|
ym_core is responsible for core functionality within the ym project. More...
Macros | |
#define | YM_ASSERT(expr, ym_errc, fmt, ...) |
Simple custom assert message that support different functionality depending on build settings. More... | |
#define | YM_INLINE |
YM_INLINE is a platform independent macro that forces a function to be inlined. More... | |
#define | YM_NO_INLINE |
YM_NO_INLINE is a platform independent macro that forces a function to never be inlined. More... | |
#define | YM_PURE |
YM_PURE is a platform independent macro informing the compiler that a function is pure. More... | |
#define | YM_RESTRICT restrict |
YM_RESTRICT is a platform independent macro wrapper for C99 restrict functionality. More... | |
#define | YM_UNUSED |
YM_UNUSED is a platform independent macro informing the compiler that a function/variable is intentionally unused. More... | |
#define | YM_NO_DISCARD |
YM_NO_DISCARD is a platform independent macro informing the compiler to warn if a return value from a function is discarded. More... | |
#define | YM_LIKELY(x) (x) |
YM_LIKELY is a platform independent macro informing the compiler that in a branch this is the path that is most likely. More... | |
#define | YM_UNLIKELY(x) (x) |
YM_UNLIKELY is a platform independent macro informing the compiler that in a branch this is the path that is least likely. More... | |
#define | TERMINAL_PAUSE |
Prints the specified error to stderr and terminates the program. More... | |
#define | YM_WARN(fmt, ...) ym_log(stderr, "WARN", YM_COLOR_FG_YELLOW, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints the specified warning to stderr. More... | |
#define | YM_DEBUG(fmt, ...) ym_log(stdout, "DEBUG", YM_COLOR_FG_CYAN, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints debug information to stdout. More... | |
#define | YM_INFO(fmt, ...) ym_log(stdout, "INFO", YM_COLOR_FG_WHITE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints regular info to stdout. More... | |
Typedefs | |
typedef atomic_schar | atomic_int8_t |
Atomic signed 8-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_short | atomic_int16_t |
Atomic signed 16-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_int | atomic_int32_t |
Atomic signed 32-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_long | atomic_int64_t |
Atomic signed 64-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_uchar | atomic_uint8_t |
Atomic unsigned 8-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_ushort | atomic_uint16_t |
Atomic unsigned 16-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_uint | atomic_uint32_t |
Atomic unsigned 32-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
typedef atomic_ulong | atomic_uint64_t |
Atomic unsigned 64-bit integer. Supplied because C11 does not mandate fixed width atomic support. More... | |
Enumerations | |
enum | ym_errc { ym_errc_success = (0 << 0), ym_errc_invalid_input = (1 << 0), ym_errc_bad_alloc = (1 << 1), ym_errc_mem_leak = (1 << 2), ym_errc_uninitialized = (1 << 3), ym_errc_system_error = (1 << 4), ym_errc_gl_error = (1 << 5), ym_errc_out_of_memory = (1 << 6), ym_errc_container_full = (1 << 7) } |
Used to indicate erroneous behavior within a a function. More... | |
Functions | |
void | ym_raise_error (ym_errc errc) |
Sets the new global error within the ym project. Only used for handling errors when testing. More... | |
ym_errc | ym_clear_error () |
Clears the global error and gets back its previous values. Only used for handling errors when testing. More... | |
const char * | ym_errc_str (ym_errc errc) |
Translates an ym_errc to a human readable string. More... | |
ym_core is responsible for core functionality within the ym project.
Core functionality includes asserts, logging error's, and attributes.
#define TERMINAL_PAUSE |
Prints the specified error to stderr and terminates the program.
This error is supposed to be used for unrecoverable errors.
#define YM_ASSERT | ( | expr, | |
ym_errc, | |||
fmt, | |||
... | |||
) |
Simple custom assert message that support different functionality depending on build settings.
The YM_ASSERT has four different settings based on build defines.
#define YM_DEBUG | ( | fmt, | |
... | |||
) | ym_log(stdout, "DEBUG", YM_COLOR_FG_CYAN, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints debug information to stdout.
#define YM_INFO | ( | fmt, | |
... | |||
) | ym_log(stdout, "INFO", YM_COLOR_FG_WHITE, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints regular info to stdout.
#define YM_INLINE |
YM_INLINE is a platform independent macro that forces a function to be inlined.
YM_LIKELY is a platform independent macro informing the compiler that in a branch this is the path that is most likely.
#define YM_NO_DISCARD |
YM_NO_DISCARD is a platform independent macro informing the compiler to warn if a return value from a function is discarded.
#define YM_NO_INLINE |
YM_NO_INLINE is a platform independent macro that forces a function to never be inlined.
#define YM_PURE |
YM_PURE is a platform independent macro informing the compiler that a function is pure.
#define YM_RESTRICT restrict |
YM_RESTRICT is a platform independent macro wrapper for C99 restrict functionality.
YM_UNLIKELY is a platform independent macro informing the compiler that in a branch this is the path that is least likely.
#define YM_UNUSED |
YM_UNUSED is a platform independent macro informing the compiler that a function/variable is intentionally unused.
#define YM_WARN | ( | fmt, | |
... | |||
) | ym_log(stderr, "WARN", YM_COLOR_FG_YELLOW, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__); |
Prints the specified warning to stderr.
Atomic signed 16-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic signed 32-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic signed 64-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic signed 8-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic unsigned 16-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic unsigned 32-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic unsigned 64-bit integer. Supplied because C11 does not mandate fixed width atomic support.
Atomic unsigned 8-bit integer. Supplied because C11 does not mandate fixed width atomic support.
enum ym_errc |
Used to indicate erroneous behavior within a a function.
This type is either returned from a function, or in some cases it is sent in as an out parameter.
ym_errc ym_clear_error | ( | ) |
Clears the global error and gets back its previous values. Only used for handling errors when testing.
const char* ym_errc_str | ( | ym_errc | errc | ) |
Translates an ym_errc to a human readable string.