blob: d7314cc9a0c3c8200b7e9ee133d281439a4e8798 (
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
26
27
28
29
30
31
32
33
|
#ifndef AMALGAM_COMPILER_H
#define AMALGAM_COMPILER_H
#include "std/misc.h"
#include "std/buffer.h"
#include "std/buffer_view.h"
#include "std/scoped_allocator.h"
#include "std/thread.h"
#include "defs.h"
#define AMAL_COMPILER_OK 0
/* General error */
#define AMAL_COMPILER_ERR -1
struct amal_compiler {
ScopedAllocator allocator;
ScopedAllocator main_thread_allocator;
Buffer parsers;
Buffer queued_files;
ParserThreadData *threads;
int usable_thread_count;
bool started;
amal_mutex mutex;
int resolve_ast_index;
};
CHECK_RESULT int amal_compiler_init(amal_compiler *self);
CHECK_RESULT int amal_compiler_deinit(amal_compiler *self);
/* Not thread-safe */
CHECK_RESULT int amal_compiler_load_file(amal_compiler *self, BufferView filepath);
/* TODO: amal_compiler_unload_file */
#endif
|