mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 15:00:17 +02:00
Thunks: Adds libxcb_dri2
This commit is contained in:
1 parent
798c6772b7
commit
7bf8d09391
3 files changed
+530
No files matched your search
@@ -0,0 +1,80 @@
|
||||
#!/usr/bin/python3
|
||||
from ThunkHelpers import *
|
||||
|
||||
lib_with_filename("libxcb_dri2", "libxcb-dri2")
|
||||
|
||||
# FEX
|
||||
fn("void FEX_xcb_dri2_init_extension(xcb_connection_t *, xcb_extension_t *)"); no_unpack()
|
||||
fn("size_t FEX_usable_size(void*)"); no_unpack()
|
||||
fn("void FEX_free_on_host(void*)"); no_unpack()
|
||||
|
||||
fn("void xcb_dri2_dri2_buffer_next(xcb_dri2_dri2_buffer_iterator_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_dri2_buffer_end(xcb_dri2_dri2_buffer_iterator_t)")
|
||||
fn("void xcb_dri2_attach_format_next(xcb_dri2_attach_format_iterator_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_attach_format_end(xcb_dri2_attach_format_iterator_t)")
|
||||
fn("xcb_dri2_query_version_cookie_t xcb_dri2_query_version(xcb_connection_t *, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_query_version_cookie_t xcb_dri2_query_version_unchecked(xcb_connection_t *, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply(xcb_connection_t *, xcb_dri2_query_version_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("int xcb_dri2_connect_sizeof(const void *)")
|
||||
fn("xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t *, xcb_window_t, uint32_t)"); no_pack()
|
||||
fn("xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked(xcb_connection_t *, xcb_window_t, uint32_t)"); no_pack()
|
||||
# ::Iterator::
|
||||
fn("char * xcb_dri2_connect_driver_name(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_driver_name_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_driver_name_end(const xcb_dri2_connect_reply_t *)")
|
||||
# ::Iterator::
|
||||
fn("void * xcb_dri2_connect_alignment_pad(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_alignment_pad_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_alignment_pad_end(const xcb_dri2_connect_reply_t *)")
|
||||
# ::Iterator::
|
||||
fn("char * xcb_dri2_connect_device_name(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_device_name_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_device_name_end(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_dri2_connect_reply_t * xcb_dri2_connect_reply(xcb_connection_t *, xcb_dri2_connect_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate(xcb_connection_t *, xcb_window_t, uint32_t)")
|
||||
fn("xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate_unchecked(xcb_connection_t *, xcb_window_t, uint32_t)")
|
||||
fn("xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply(xcb_connection_t *, xcb_dri2_authenticate_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_void_cookie_t xcb_dri2_create_drawable_checked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_create_drawable(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_destroy_drawable_checked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_destroy_drawable(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("int xcb_dri2_get_buffers_sizeof(const void *, uint32_t)")
|
||||
fn("xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const uint32_t *)")
|
||||
fn("xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const uint32_t *)")
|
||||
# ::Iterator::
|
||||
fn("xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_buffers(const xcb_dri2_get_buffers_reply_t *)")
|
||||
fn("int xcb_dri2_get_buffers_buffers_length(const xcb_dri2_get_buffers_reply_t *)")
|
||||
fn("xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_buffers_iterator(const xcb_dri2_get_buffers_reply_t *)")
|
||||
|
||||
fn("xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply(xcb_connection_t *, xcb_dri2_get_buffers_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply(xcb_connection_t *, xcb_dri2_copy_region_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("int xcb_dri2_get_buffers_with_format_sizeof(const void *, uint32_t)")
|
||||
fn("xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const xcb_dri2_attach_format_t *)")
|
||||
fn("xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const xcb_dri2_attach_format_t *)")
|
||||
# ::Iterator::
|
||||
fn("xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_with_format_buffers(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
fn("int xcb_dri2_get_buffers_with_format_buffers_length(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
fn("xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_with_format_buffers_iterator(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
|
||||
fn("xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply(xcb_connection_t *, xcb_dri2_get_buffers_with_format_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply(xcb_connection_t *, xcb_dri2_swap_buffers_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc_unchecked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply(xcb_connection_t *, xcb_dri2_get_msc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply(xcb_connection_t *, xcb_dri2_wait_msc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply(xcb_connection_t *, xcb_dri2_wait_sbc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_void_cookie_t xcb_dri2_swap_interval_checked(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_swap_interval(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_cookie_t xcb_dri2_get_param(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_cookie_t xcb_dri2_get_param_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply(xcb_connection_t *, xcb_dri2_get_param_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
|
||||
Generate()
|
||||
@@ -0,0 +1,385 @@
|
||||
/*
|
||||
$info$
|
||||
tags: thunklibs|xcb-dri2
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
#include <xcb/dri2.h>
|
||||
#include <xcb/xcbext.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "common/Guest.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "thunks.inl"
|
||||
#include "function_packs.inl"
|
||||
#include "function_packs_public.inl"
|
||||
|
||||
|
||||
extern "C" {
|
||||
xcb_extension_t xcb_dri2_id = {
|
||||
.name = "DRI2",
|
||||
.global_id = 0,
|
||||
};
|
||||
|
||||
void FEX_malloc_free_on_host(void *Ptr) {
|
||||
struct {void *p;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_free_on_host(&args);
|
||||
}
|
||||
|
||||
size_t FEX_malloc_usable_size(void *Ptr) {
|
||||
struct {void *p; size_t rv;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_usable_size(&args);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static void InitializeExtensions(xcb_connection_t *c) {
|
||||
FEX_xcb_dri2_init_extension(c, &xcb_dri2_id);
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_cookie_t fexfn_pack_xcb_dri2_connect(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_window_t a_1;uint32_t a_2;xcb_dri2_connect_cookie_t rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect(&args);
|
||||
InitializeExtensions(a_0);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_cookie_t fexfn_pack_xcb_dri2_connect_unchecked(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_window_t a_1;uint32_t a_2;xcb_dri2_connect_cookie_t rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect_unchecked(&args);
|
||||
InitializeExtensions(a_0);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_query_version_reply_t * fexfn_pack_xcb_dri2_query_version_reply(xcb_connection_t * a_0,xcb_dri2_query_version_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_query_version_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_query_version_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_query_version_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_reply_t * fexfn_pack_xcb_dri2_connect_reply(xcb_connection_t * a_0,xcb_dri2_connect_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_connect_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_connect_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_authenticate_reply_t * fexfn_pack_xcb_dri2_authenticate_reply(xcb_connection_t * a_0,xcb_dri2_authenticate_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_authenticate_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_authenticate_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_authenticate_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_buffers_reply_t * fexfn_pack_xcb_dri2_get_buffers_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_buffers_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_buffers_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_buffers_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_copy_region_reply_t * fexfn_pack_xcb_dri2_copy_region_reply(xcb_connection_t * a_0,xcb_dri2_copy_region_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_copy_region_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_copy_region_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_copy_region_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_buffers_with_format_reply_t * fexfn_pack_xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_with_format_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_buffers_with_format_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_buffers_with_format_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_buffers_with_format_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_swap_buffers_reply_t * fexfn_pack_xcb_dri2_swap_buffers_reply(xcb_connection_t * a_0,xcb_dri2_swap_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_swap_buffers_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_swap_buffers_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_swap_buffers_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_msc_reply_t * fexfn_pack_xcb_dri2_get_msc_reply(xcb_connection_t * a_0,xcb_dri2_get_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_msc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_msc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_msc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_wait_msc_reply_t * fexfn_pack_xcb_dri2_wait_msc_reply(xcb_connection_t * a_0,xcb_dri2_wait_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_wait_msc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_wait_msc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_wait_msc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_wait_sbc_reply_t * fexfn_pack_xcb_dri2_wait_sbc_reply(xcb_connection_t * a_0,xcb_dri2_wait_sbc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_wait_sbc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_wait_sbc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_wait_sbc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_param_reply_t * fexfn_pack_xcb_dri2_get_param_reply(xcb_connection_t * a_0,xcb_dri2_get_param_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_param_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_param_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_param_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect")));
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect_unchecked")));
|
||||
xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply(xcb_connection_t * a_0,xcb_dri2_query_version_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_query_version_reply")));
|
||||
xcb_dri2_connect_reply_t * xcb_dri2_connect_reply(xcb_connection_t * a_0,xcb_dri2_connect_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect_reply")));
|
||||
xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply(xcb_connection_t * a_0,xcb_dri2_authenticate_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_authenticate_reply")));
|
||||
xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_buffers_reply")));
|
||||
xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply(xcb_connection_t * a_0,xcb_dri2_copy_region_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_copy_region_reply")));
|
||||
xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_with_format_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_buffers_with_format_reply")));
|
||||
xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply(xcb_connection_t * a_0,xcb_dri2_swap_buffers_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_swap_buffers_reply")));
|
||||
xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply(xcb_connection_t * a_0,xcb_dri2_get_msc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_msc_reply")));
|
||||
xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply(xcb_connection_t * a_0,xcb_dri2_wait_msc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_wait_msc_reply")));
|
||||
xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply(xcb_connection_t * a_0,xcb_dri2_wait_sbc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_wait_sbc_reply")));
|
||||
xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply(xcb_connection_t * a_0,xcb_dri2_get_param_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_param_reply")));
|
||||
}
|
||||
|
||||
LOAD_LIB(libxcb_dri2)
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
$info$
|
||||
tags: thunklibs|xcb-dri2
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <xcb/dri2.h>
|
||||
#include <xcb/xcbext.h>
|
||||
|
||||
#include "common/Host.h"
|
||||
#include <dlfcn.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "ldr_ptrs.inl"
|
||||
#include "function_unpacks.inl"
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_xcb_dri2_init_extension(void *argsv);
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_usable_size(void *argsv){
|
||||
struct arg_t {void* a_0;size_t rv;};
|
||||
auto args = (arg_t*)argsv;
|
||||
args->rv = malloc_usable_size(args->a_0);
|
||||
}
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_free_on_host(void *argsv){
|
||||
struct arg_t {void* a_0;};
|
||||
auto args = (arg_t*)argsv;
|
||||
free(args->a_0);
|
||||
}
|
||||
|
||||
static ExportEntry exports[] = {
|
||||
#include "tab_function_unpacks.inl"
|
||||
{ nullptr, nullptr }
|
||||
};
|
||||
|
||||
#include "ldr.inl"
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_xcb_dri2_init_extension(void *argsv){
|
||||
struct arg_t {xcb_connection_t * a_0;xcb_extension_t * a_1;};
|
||||
auto args = (arg_t*)argsv;
|
||||
xcb_extension_t *ext{};
|
||||
if (strcmp(args->a_1->name, "DRI2") == 0) {
|
||||
ext = (xcb_extension_t *)dlsym(fexldr_ptr_libxcb_dri2_so, "xcb_dri2_id");
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Unknown xcb extension '%s'\n", args->a_1->name);
|
||||
__builtin_trap();
|
||||
return;
|
||||
}
|
||||
|
||||
typedef const struct xcb_query_extension_reply_t * fexldr_type_libxcb_xcb_get_extension_data(xcb_connection_t * a_0,xcb_extension_t * a_1);
|
||||
fexldr_type_libxcb_xcb_get_extension_data *fexldr_ptr_libxcb_xcb_get_extension_data;
|
||||
|
||||
fexldr_ptr_libxcb_xcb_get_extension_data = (fexldr_type_libxcb_xcb_get_extension_data*)dlsym(RTLD_DEFAULT, "xcb_get_extension_data");
|
||||
|
||||
auto res = fexldr_ptr_libxcb_xcb_get_extension_data(args->a_0, ext);
|
||||
|
||||
// Copy over the global id
|
||||
args->a_1->global_id = ext->global_id;
|
||||
}
|
||||
|
||||
EXPORTS(libxcb_dri2)
|
||||
Reference in new issue
Block a user