about summary refs log tree commit diff stats
path: root/src/include/library.h
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-03 16:43:42 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-03 16:43:42 +0100
commitf4829a8ce42b1abbcc8621802d6c6fad3a56cd5d (patch)
tree211276c3587721126ded00be46487bf23b605591 /src/include/library.h
parentf73fbd3cee38b4c0086c934d73972375c9c8c7d6 (diff)
downloadbox64-f4829a8ce42b1abbcc8621802d6c6fad3a56cd5d.tar.gz
box64-f4829a8ce42b1abbcc8621802d6c6fad3a56cd5d.zip
More infrastructure added to elf and x64 emu
Diffstat (limited to 'src/include/library.h')
-rwxr-xr-xsrc/include/library.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/include/library.h b/src/include/library.h
new file mode 100755
index 00000000..d33b1126
--- /dev/null
+++ b/src/include/library.h
@@ -0,0 +1,36 @@
+#ifndef __LIBRARY_H_
+#define __LIBRARY_H_
+#include <stdint.h>
+
+typedef struct library_s       library_t;
+typedef struct lib_s           lib_t;
+typedef struct kh_symbolmap_s  kh_symbolmap_t;
+typedef struct box64context_s  box64context_t;
+typedef struct x64emu_s        x64emu_t;
+typedef struct needed_libs_s   needed_libs_t;
+
+library_t *NewLibrary(const char* path, box64context_t* box86);
+int AddSymbolsLibrary(lib_t* maplib, library_t* lib, x64emu_t* emu);
+int FinalizeLibrary(library_t* lib, lib_t* local_maplib, x64emu_t* emu);
+int ReloadLibrary(library_t* lib, x64emu_t* emu);
+void InactiveLibrary(library_t* lib);
+void Free1Library(library_t **lib);
+
+char* GetNameLib(library_t *lib);
+int IsSameLib(library_t* lib, const char* path);    // check if lib is same (path -> name)
+int GetLibSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end);
+int GetLibNoWeakSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end);
+int GetLibLocalSymbolStartEnd(library_t* lib, const char* name, uintptr_t* start, uintptr_t* end);
+void fillGLProcWrapper(box64context_t* context);
+void freeGLProcWrapper(box64context_t* context);
+void fillALProcWrapper(box64context_t* context);
+void freeALProcWrapper(box64context_t* context);
+needed_libs_t* GetNeededLibs(library_t* lib);
+int GetNeededLibN(library_t* lib);
+library_t* GetNeededLib(library_t* lib, int idx);
+lib_t* GetMaplib(library_t* lib);
+
+int GetElfIndex(library_t* lib);    // -1 if no elf (i.e. native)
+void* GetHandle(library_t* lib);    // NULL if not native
+
+#endif //__LIBRARY_H_
\ No newline at end of file