52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/**
|
|
* Hiload is an Elf hotreloader that patches C and C++ code live while
|
|
* developing, significantly tightening the traditional feedback loop.
|
|
*
|
|
* Currently not supported:
|
|
* - modifying modules loaded at runtime
|
|
*/
|
|
|
|
#ifndef HILOAD_H_
|
|
#define HILOAD_H_
|
|
|
|
#include "hitypes.h"
|
|
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Allows using -fvisibility=hidden by default, decreasing visible symbols
|
|
#pragma GCC visibility push(default)
|
|
|
|
/**
|
|
* Must be called before other functions. Sets up filewatchers for the relevant
|
|
* files
|
|
* @n n Number of modules in @a enabled_modules
|
|
* @param enabled_modules The name of a module that should have its changes
|
|
* applied to the running process. A short form is expected, e.g.
|
|
* `libhiload.so`. An empty string denotes the executable of the running
|
|
* process.
|
|
*/
|
|
int hi_init(size_t n, const char **enabled_modules);
|
|
|
|
/**
|
|
* Call when hiload is no longer needed.
|
|
*/
|
|
void hi_deinit(void);
|
|
|
|
/**
|
|
* Reload all enabled modules that have been changed since init or last
|
|
* invocation and apply changes to the running process.
|
|
*/
|
|
HiResult hi_reload(void);
|
|
|
|
#pragma GCC visibility pop
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // HILOAD_H_
|