aboutsummaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorMistivia <i@mistivia.com>2025-03-25 13:07:21 +0800
committerMistivia <i@mistivia.com>2025-03-25 13:07:21 +0800
commitfb7664e087cb1afb64aae2128365f703beb30b57 (patch)
tree6d4e2a4cc695052e489ec9e3fd28538a79a08f4c /src/utils.h
parentdc87ff4b0c9f311be7fad652594e3766a4ddb0c6 (diff)
add result style error handling
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 2381385..5f7c0ff 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -5,9 +5,16 @@
struct allocator;
+struct result {
+ void *value;
+ const char* errmsg;
+};
+
struct allocator * new_allocator();
void delete_allocator(struct allocator * allocator);
void* allocate(struct allocator * allocator, size_t size);
+char* safe_sprintf(struct allocator *alct, const char* format, ...);
+
#endif // FVM_UTILS_H_