2022-09-05 23:48:56 -07:00
|
|
|
#ifndef _IO_H
|
|
|
|
#define _IO_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2022-09-06 19:47:46 -07:00
|
|
|
extern uint32_t here;
|
2022-09-05 23:48:56 -07:00
|
|
|
|
|
|
|
void open_files(const char* infile_name, const char* outfile_name);
|
|
|
|
void close_files(void);
|
|
|
|
|
2022-09-06 23:16:23 -07:00
|
|
|
void reserve(size_t len);
|
2022-09-05 23:48:56 -07:00
|
|
|
void emit(const void* ptr, size_t count);
|
|
|
|
void emit_u8(uint8_t x);
|
|
|
|
void emit_u32(uint32_t x);
|
|
|
|
void emit_u64(uint64_t x);
|
|
|
|
|
|
|
|
void patch(size_t off, const void* ptr, size_t count);
|
|
|
|
void patch_u32(size_t off, uint32_t x);
|
|
|
|
void patch_i32(size_t off, int32_t x);
|
|
|
|
|
2022-09-07 10:22:38 -07:00
|
|
|
char* peek(size_t* len);
|
|
|
|
void skip(size_t off);
|
|
|
|
|
2022-09-05 23:48:56 -07:00
|
|
|
#endif
|