about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibvorbis.c
blob: ebe7ac684b3a063c184dc703e146af6aa4609026 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#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 "box64context.h"
#include "librarian.h"
#include "myalign.h"


const char* libvorbisName = "libvorbis.so.0";
#define LIBNAME libvorbis


typedef struct vorbis_my_s {
} vorbis_my_t;

void* getVorbisMy(library_t* lib)
{
    vorbis_my_t* my = (vorbis_my_t*)calloc(1, sizeof(vorbis_my_t));
    #define GO(A, W) my->A = (W)dlsym(lib->priv.w.lib, #A);
    #undef GO
    return my;
}

void freeVorbisMy(void* lib)
{
    //vorbis_my_t *my = (vorbis_my_t *)lib;
}

#define CUSTOM_INIT \
    box64->vorbis = lib; \
    lib->priv.w.p2 = getVorbisMy(lib);

#define CUSTOM_FINI \
    freeVorbisMy(lib->priv.w.p2); \
    free(lib->priv.w.p2); \
    lib->context->vorbis = NULL;

#include "wrappedlib_init.h"