wayland-egl-core-so_wrap.c 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. // This file is generated. Do not edit!
  2. // see https://github.com/hpvb/dynload-wrapper for details
  3. // generated by ../dynload-wrapper/generate-wrapper.py 0.3 on 2023-01-25 17:49:37
  4. // flags: ../dynload-wrapper/generate-wrapper.py --include ./thirdparty/linuxbsd_headers/wayland/wayland-egl-core.h --sys-include "./thirdparty/linuxbsd_headers/wayland/wayland-egl-core.h" --soname libwayland-egl.so.1 --init-name wayland_egl --output-header platform/linuxbsd/wayland/dynwrappers/wayland-egl-core-so_wrap.h --output-implementation platform/linuxbsd/wayland/dynwrappers/wayland-egl-core-so_wrap.c
  5. //
  6. #include <stdint.h>
  7. #define wl_egl_window_create wl_egl_window_create_dylibloader_orig_wayland_egl
  8. #define wl_egl_window_destroy wl_egl_window_destroy_dylibloader_orig_wayland_egl
  9. #define wl_egl_window_resize wl_egl_window_resize_dylibloader_orig_wayland_egl
  10. #define wl_egl_window_get_attached_size wl_egl_window_get_attached_size_dylibloader_orig_wayland_egl
  11. #include "./thirdparty/linuxbsd_headers/wayland/wayland-egl-core.h"
  12. #undef wl_egl_window_create
  13. #undef wl_egl_window_destroy
  14. #undef wl_egl_window_resize
  15. #undef wl_egl_window_get_attached_size
  16. #include <dlfcn.h>
  17. #include <stdio.h>
  18. struct wl_egl_window* (*wl_egl_window_create_dylibloader_wrapper_wayland_egl)(struct wl_surface*, int, int);
  19. void (*wl_egl_window_destroy_dylibloader_wrapper_wayland_egl)(struct wl_egl_window*);
  20. void (*wl_egl_window_resize_dylibloader_wrapper_wayland_egl)(struct wl_egl_window*, int, int, int, int);
  21. void (*wl_egl_window_get_attached_size_dylibloader_wrapper_wayland_egl)(struct wl_egl_window*, int*, int*);
  22. int initialize_wayland_egl(int verbose) {
  23. void *handle;
  24. char *error;
  25. handle = dlopen("libwayland-egl.so.1", RTLD_LAZY);
  26. if (!handle) {
  27. if (verbose) {
  28. fprintf(stderr, "%s\n", dlerror());
  29. }
  30. return(1);
  31. }
  32. dlerror();
  33. // wl_egl_window_create
  34. *(void **) (&wl_egl_window_create_dylibloader_wrapper_wayland_egl) = dlsym(handle, "wl_egl_window_create");
  35. if (verbose) {
  36. error = dlerror();
  37. if (error != NULL) {
  38. fprintf(stderr, "%s\n", error);
  39. }
  40. }
  41. // wl_egl_window_destroy
  42. *(void **) (&wl_egl_window_destroy_dylibloader_wrapper_wayland_egl) = dlsym(handle, "wl_egl_window_destroy");
  43. if (verbose) {
  44. error = dlerror();
  45. if (error != NULL) {
  46. fprintf(stderr, "%s\n", error);
  47. }
  48. }
  49. // wl_egl_window_resize
  50. *(void **) (&wl_egl_window_resize_dylibloader_wrapper_wayland_egl) = dlsym(handle, "wl_egl_window_resize");
  51. if (verbose) {
  52. error = dlerror();
  53. if (error != NULL) {
  54. fprintf(stderr, "%s\n", error);
  55. }
  56. }
  57. // wl_egl_window_get_attached_size
  58. *(void **) (&wl_egl_window_get_attached_size_dylibloader_wrapper_wayland_egl) = dlsym(handle, "wl_egl_window_get_attached_size");
  59. if (verbose) {
  60. error = dlerror();
  61. if (error != NULL) {
  62. fprintf(stderr, "%s\n", error);
  63. }
  64. }
  65. return 0;
  66. }