From 308c8893d9706318e8e756069f40c1435a70df91 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 4 May 2026 16:31:51 +0200 Subject: feat(lib): return multiple errors --- include/typdown.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/typdown.h b/include/typdown.h index 8de37d8..abf395d 100644 --- a/include/typdown.h +++ b/include/typdown.h @@ -1,8 +1,20 @@ #pragma once #include +#include + +struct typdown_Error { + uint8_t code; + struct {size_t beg; size_t end;} location; +}; + +struct typdown_Document { + void *root; + struct typdown_Error *errors; + size_t errors_len; +}; char * typdown_getErrorString(uint8_t); -void * typdown_parse(char *, uint8_t *); -void typdown_free(void *); -char * typdown_renderHTML(void *, uint8_t *); +struct typdown_Document typdown_parse(char *); +void typdown_free(struct typdown_Document); +char * typdown_renderHTML(struct typdown_Document, uint8_t *); -- cgit v1.2.3