diff options
author | Linnnus <[email protected]> | 2025-04-11 23:42:02 +0000 |
---|---|---|
committer | Linnnus <[email protected]> | 2025-04-15 01:08:23 +0000 |
commit | d15dd976b98b4c39a899b3d68047dc752699dca7 (patch) | |
tree | 2291c13817e0359d2f116e76e7b66c9ae8f0c590 /src/core/config.h | |
parent | 31eacdeefe6099e68dd8596faab8108671e4c6a5 (diff) |
feat(core,cli): Add diagnostic handler to SandConfig
Diffstat (limited to 'src/core/config.h')
-rw-r--r-- | src/core/config.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/config.h b/src/core/config.h index 389a146..63b131b 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -5,11 +5,26 @@ // not opaque) type which the consumer of the core library is supposed to // assemble themselves. It contains hooks which the State will use for all effects. +#include "location.h" + +#include <stddef.h> + // This handler is used for output from the user-supplied actual program. typedef void (* SandPrintHandler)(const char *message, size_t length); +typedef enum { + SAND_DIAGNOSTIC_INFO, + SAND_DIAGNOSTIC_WARNING, + SAND_DIAGNOSTIC_ERROR, +} SandDiagnosticLevel; + +// This handler is used when the implementation has a report to make. +// These could for example be displayed in tan editor's interface. +typedef void (* SandDiagnosticHandler)(const SandLocation *, SandDiagnosticLevel, const char *message, size_t message_length); + typedef struct { SandPrintHandler print_handler; + SandDiagnosticHandler diagnostic_handler; } SandConfig; #endif |