36 lines
784 B
C++
36 lines
784 B
C++
#include "minimal_lib.h"
|
|
|
|
#include "../../include/hiload/hiload.h"
|
|
|
|
#include <assert.h>
|
|
#include <chrono>
|
|
#include <cstdio>
|
|
#include <thread>
|
|
|
|
#define ARRLEN(A) (sizeof((A)) / (sizeof((A)[0])))
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
const char *reloadable_modules[] = {"", "libmini.so"};
|
|
hi_init(ARRLEN(reloadable_modules), reloadable_modules);
|
|
|
|
int modified = -1;
|
|
while (modified != 0) {
|
|
|
|
modified = minimal_lib::getNewValue(5);
|
|
printf("getNewValue: %d\n", modified);
|
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
|
printf("otherValue: %d\n", minimal_lib::otherValue++);
|
|
std::this_thread::sleep_for(std::chrono::seconds(1));
|
|
|
|
if (hi_reload() != HI_OK) {
|
|
fprintf(stderr, "Failed to load modules\n");
|
|
}
|
|
}
|
|
|
|
hi_deinit();
|
|
|
|
return 0;
|
|
}
|