unify file locations
This commit is contained in:
46
src/moduler.h
Normal file
46
src/moduler.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#ifndef MODULER_H_
|
||||
#define MODULER_H_
|
||||
|
||||
#include "vector.h"
|
||||
#include "memory.h"
|
||||
#include "symbols.h"
|
||||
#include "types.h"
|
||||
|
||||
struct HiloadContext;
|
||||
|
||||
|
||||
typedef enum {
|
||||
HI_MODULE_STATE_DIRTY = (1 << 0),
|
||||
HI_MODULE_STATE_PATCHABLE = (1 << 6), // non system module we will modify
|
||||
HI_MODULE_STATE_EXEC = (1 << 7), // denote the current executable
|
||||
} ModuleFlags;
|
||||
|
||||
typedef u8 ModuleInfo;
|
||||
typedef struct {
|
||||
const char *name; // Filename
|
||||
void *dlhandle;
|
||||
uptr address;
|
||||
ModuleInfo info;
|
||||
} ModuleData;
|
||||
|
||||
sc_array_def(ModuleData, module);
|
||||
typedef struct sc_array_module VectorModuleData;
|
||||
|
||||
static inline ModuleInfo hi_modinfo_add(ModuleInfo flags, ModuleFlags flag) {
|
||||
return flags | flag;
|
||||
}
|
||||
static inline ModuleInfo hi_modinfo_clear(ModuleInfo flags,
|
||||
ModuleFlags flag) {
|
||||
return flags & ~flag;
|
||||
}
|
||||
static inline bool hi_modinfo_has(ModuleInfo flags, ModuleFlags flag) {
|
||||
return (flags & flag) != 0;
|
||||
}
|
||||
|
||||
#define HI_MODINFO_SET(info, flag) ((info) |= flag)
|
||||
#define HI_MODINFO_CLEAR(info, flag) ((info) &= ~flag)
|
||||
|
||||
HiResult moduler_reload(VectorModuleData *modules, ModuleData *module,
|
||||
VectorMemoryRegion *memregs);
|
||||
|
||||
#endif // MODULER_H_
|
||||
Reference in New Issue
Block a user