summaryrefslogtreecommitdiff
path: root/src/core/state.h
blob: 6f4d17472454635c2517892872d9a16022436a41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef SAND_STATE_H
#define SAND_STATE_H

// This module defines the evaluator state. This is the "world" in Sand.
// Multiple evaluator states can coexist as they are totally separate.

#include "utils.h"
#include "allocator.h"
#include "config.h"

// This data structure should be treated as entirely opaque by consuming code.
typedef struct {
	SandConfig config;

	SandAllocator gpa;
} SandState;

SandState sand_create_state(SandConfig config);

_SAND_FORMAT_ATTR(printf, 4, 5)
void sand_print_diagnostic(SandState *, const SandLocation *, SandDiagnosticLevel, const char *fmt, ...);

void sand_destroy_state(SandState *);

#endif