|
Serene Runtime 1.0.0-dev
C runtime for the Serene programming language
|
Go to the source code of this file.
Functions | |
| srn_error_t * | srn_errors_make (const srn_context_t *ctx, srn_error_tag_t tag, const char *msg) |
| Build an error in ctx's memory, tagged tag and carrying msg. | |
| void * | srn_errors_fail (const srn_context_t *ctx, size_t size, size_t alignment, srn_error_tag_t tag, const char *msg) |
| Allocate a size/alignment value in ctx, set its ERROR_HEADER (the first member, srn_error_t *maybe_error) to a fresh error, and return it. | |
|
nodiscard |
Allocate a size/alignment value in ctx, set its ERROR_HEADER (the first member, srn_error_t *maybe_error) to a fresh error, and return it.
The result is a valid fallible value whose HAS_ERROR is true. Use the FAIL macro, which fills in size/alignment from the target type.
Definition at line 39 of file errors.c.
| srn_error_t * srn_errors_make | ( | const srn_context_t * | ctx, |
| srn_error_tag_t | tag, | ||
| const char * | msg ) |
Build an error in ctx's memory, tagged tag and carrying msg.
Returns the error to attach to a value's maybe_error (or to inspect directly). The ERR macro below is the shorthand for the common call.
Definition at line 31 of file errors.c.