swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
swissChili | f3e7f18 | 2021-04-20 13:57:22 -0700 | [diff] [blame] | 3 | #include <dasm_proto.h> |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 4 | #include <stddef.h> |
| 5 | #include <stdint.h> |
swissChili | f68671f | 2021-07-05 14:14:44 -0700 | [diff] [blame] | 6 | #include <stdbool.h> |
| 7 | #include <sys/types.h> |
swissChili | 8cfb7c4 | 2021-04-18 21:17:58 -0700 | [diff] [blame] | 8 | |
| 9 | /* Platform specific definitions */ |
| 10 | |
| 11 | // Must return an address aligned to 8 bytes |
swissChili | 53472e8 | 2021-05-08 16:06:32 -0700 | [diff] [blame] | 12 | void *malloc_aligned(size_t size); |
| 13 | void *realloc_aligned(void *addr, size_t size); |
| 14 | void free_aligned(void *addr); |
swissChili | f3e7f18 | 2021-04-20 13:57:22 -0700 | [diff] [blame] | 15 | |
swissChili | f68671f | 2021-07-05 14:14:44 -0700 | [diff] [blame] | 16 | void *link_program(dasm_State **Dst); |
| 17 | |
| 18 | extern ssize_t readlink(const char *pathname, char *buf, size_t buf_size); |
| 19 | bool file_exists(const char *path); |
swissChili | e9fec8b | 2021-06-22 13:59:33 -0700 | [diff] [blame] | 20 | |
swissChili | 7e1393c | 2021-07-07 12:59:12 -0700 | [diff] [blame] | 21 | char *read_input_line(char *prompt); |
| 22 | void add_line_to_history(char *line); |
| 23 | |
swissChili | e9fec8b | 2021-06-22 13:59:33 -0700 | [diff] [blame] | 24 | #define THREAD_LOCAL |