hydroforth/src/hydroforth/result.c
2022-12-23 15:02:29 +01:00

14 lines
447 B
C

#include "hydroforth/hydroforth.h"
void hydroforth__result__add_backtrace(HYDROFORTH__RESULT *const result, const char *const s)
{
realloc(result->backtrace, sizeof(char *) * (result->backtrace_len + 1));
result->backtrace[result->backtrace_len++] = s;
}
void hydroforth__result__set(HYDROFORTH__RESULT *const result, HYDROFORTH__ERROR error, const char *const s)
{
result->error = error;
hydroforth__result__add_backtrace(result, s);
}