Init. Copied over heload, made a minimal tester.

This commit is contained in:
2025-03-16 18:46:12 +02:00
commit 21bf4d8715
12 changed files with 646 additions and 0 deletions

25
include/hiload/hiload.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef HILOAD_H_
#define HILOAD_H_
#ifdef __cplusplus
extern "C" {
#endif
// Return codes for reload_module
typedef enum {
RELOAD_SUCCESS = 0,
RELOAD_NOT_FOUND,
RELOAD_CLOSE_ERROR,
RELOAD_OPEN_ERROR
} ReloadResult;
int he_init();
void he_deinit();
void he_print_module_infos();
ReloadResult he_reload_module(const char *module_name);
#ifdef __cplusplus
}
#endif
#endif // HILOAD_H_

22
include/hiload/symbols.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef SYMBOLS_H_
#define SYMBOLS_H_
#include <link.h>
#include <stddef.h>
#include <stdint.h>
typedef struct {
char **names;
void **addresses;
size_t count;
size_t capacity;
} SymbolInfos;
typedef enum { CREATE_SUCCESS = 0, CREATE_FAILED } CreateResult;
struct dl_phdr_info;
CreateResult he_create_symbol_info(SymbolInfos *, struct dl_phdr_info *);
void he_free_symbol_info(SymbolInfos *);
#endif // SYMBOLS_H_