-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlibdyibicc.h
More file actions
35 lines (26 loc) · 948 Bytes
/
Copy pathlibdyibicc.h
File metadata and controls
35 lines (26 loc) · 948 Bytes
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
34
35
#pragma once
#include <stdarg.h>
#include <stdbool.h>
// level == 0 debug log
// level == 1 regular user message
// level == 2 error
typedef int (*DyibiccOutputFn)(int level, const char* fmt, va_list ap);
// Returns the address of a function by name.
typedef void* (*DyibiccFunctionLookupFn)(const char* name);
typedef int (*DyibiccEntryPointFn)(void);
typedef struct DyibiccEnviromentData {
const char** include_paths;
const char** files;
const char* entry_point_name;
const char* cache_dir;
const char* dyibicc_include_dir;
DyibiccFunctionLookupFn get_function_address;
DyibiccOutputFn output_function;
} DyibiccEnviromentData;
typedef struct DyibiccContext {
DyibiccEntryPointFn entry_point;
// Additional internal data allocated here.
} DyibiccContext;
DyibiccContext* dyibicc_set_environment(DyibiccEnviromentData* env_data);
bool dyibicc_update(DyibiccContext* context);
void dyibicc_free(DyibiccContext* context);