diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-26 14:42:50 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-26 14:42:50 +0100 |
| commit | 9f01b2ec0d43ea0547f5ae81b76a84bf16f5583a (patch) | |
| tree | 9b6b2488a8f18d7885b84233f87f3efd88f889f7 /src/wrapped/wrappedlibcups.c | |
| parent | 86c5dfd664ad6f53c03b60b71d76886701b54f9c (diff) | |
| download | box64-9f01b2ec0d43ea0547f5ae81b76a84bf16f5583a.tar.gz box64-9f01b2ec0d43ea0547f5ae81b76a84bf16f5583a.zip | |
Added wrapped libcups, plus some changes in wrapped libSDL2 and pthread
Diffstat (limited to 'src/wrapped/wrappedlibcups.c')
| -rwxr-xr-x | src/wrapped/wrappedlibcups.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/wrapped/wrappedlibcups.c b/src/wrapped/wrappedlibcups.c new file mode 100755 index 00000000..be7ed99c --- /dev/null +++ b/src/wrapped/wrappedlibcups.c @@ -0,0 +1,59 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#define _GNU_SOURCE /* See feature_test_macros(7) */ +#include <dlfcn.h> + +#include "wrappedlibs.h" + +#include "debug.h" +#include "wrapper.h" +#include "bridge.h" +#include "librarian/library_private.h" +#include "x64emu.h" +#include "emu/x64emu_private.h" +#include "callback.h" +#include "librarian.h" +#include "box64context.h" +#include "emu/x64emu_private.h" +#include "myalign.h" + +const char* libcupsName = "libcups.so.2"; +#define LIBNAME libcups + +#if 0 +#define SUPER() + GO(BZ2_bzCompressInit, iFpiii_t) + +typedef struct libcups_my_s { + // functions + #define GO(A, B) B A; + SUPER() + #undef GO +} libcups_my_t; + +void* getCupsMy(library_t* lib) +{ + libcups_my_t* my = (libcups_my_t*)calloc(1, sizeof(libcups_my_t)); + #define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A); + SUPER() + #undef GO + return my; +} +#undef SUPER + +void freeCupsMy(void* lib) +{ + libcups_my_t *my = (libcups_my_t *)lib; +} + +#define CUSTOM_INIT \ + lib->priv.w.p2 = getCupsMy(lib); + +#define CUSTOM_FINI \ + freeCupsMy(lib->priv.w.p2); \ + free(lib->priv.w.p2); +#endif + +#include "wrappedlib_init.h" + |