wayland-cursor-so_wrap.c 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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:46:12
  4. // flags: ../dynload-wrapper/generate-wrapper.py --include ./thirdparty/linuxbsd_headers/wayland/wayland-cursor.h --sys-include "./thirdparty/linuxbsd_headers/wayland/wayland-cursor.h" --soname libwayland-cursor.so.0 --init-name wayland_cursor --output-header platform/linuxbsd/wayland/dynwrappers/wayland-cursor-so_wrap.h --output-implementation platform/linuxbsd/wayland/dynwrappers/wayland-cursor-so_wrap.c
  5. //
  6. #include <stdint.h>
  7. #define wl_cursor_theme_load wl_cursor_theme_load_dylibloader_orig_wayland_cursor
  8. #define wl_cursor_theme_destroy wl_cursor_theme_destroy_dylibloader_orig_wayland_cursor
  9. #define wl_cursor_theme_get_cursor wl_cursor_theme_get_cursor_dylibloader_orig_wayland_cursor
  10. #define wl_cursor_image_get_buffer wl_cursor_image_get_buffer_dylibloader_orig_wayland_cursor
  11. #define wl_cursor_frame wl_cursor_frame_dylibloader_orig_wayland_cursor
  12. #define wl_cursor_frame_and_duration wl_cursor_frame_and_duration_dylibloader_orig_wayland_cursor
  13. #include "./thirdparty/linuxbsd_headers/wayland/wayland-cursor.h"
  14. #undef wl_cursor_theme_load
  15. #undef wl_cursor_theme_destroy
  16. #undef wl_cursor_theme_get_cursor
  17. #undef wl_cursor_image_get_buffer
  18. #undef wl_cursor_frame
  19. #undef wl_cursor_frame_and_duration
  20. #include <dlfcn.h>
  21. #include <stdio.h>
  22. struct wl_cursor_theme* (*wl_cursor_theme_load_dylibloader_wrapper_wayland_cursor)(const char*, int,struct wl_shm*);
  23. void (*wl_cursor_theme_destroy_dylibloader_wrapper_wayland_cursor)(struct wl_cursor_theme*);
  24. struct wl_cursor* (*wl_cursor_theme_get_cursor_dylibloader_wrapper_wayland_cursor)(struct wl_cursor_theme*,const char*);
  25. struct wl_buffer* (*wl_cursor_image_get_buffer_dylibloader_wrapper_wayland_cursor)(struct wl_cursor_image*);
  26. int (*wl_cursor_frame_dylibloader_wrapper_wayland_cursor)(struct wl_cursor*, uint32_t);
  27. int (*wl_cursor_frame_and_duration_dylibloader_wrapper_wayland_cursor)(struct wl_cursor*, uint32_t, uint32_t*);
  28. int initialize_wayland_cursor(int verbose) {
  29. void *handle;
  30. char *error;
  31. handle = dlopen("libwayland-cursor.so.0", RTLD_LAZY);
  32. if (!handle) {
  33. if (verbose) {
  34. fprintf(stderr, "%s\n", dlerror());
  35. }
  36. return(1);
  37. }
  38. dlerror();
  39. // wl_cursor_theme_load
  40. *(void **) (&wl_cursor_theme_load_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_theme_load");
  41. if (verbose) {
  42. error = dlerror();
  43. if (error != NULL) {
  44. fprintf(stderr, "%s\n", error);
  45. }
  46. }
  47. // wl_cursor_theme_destroy
  48. *(void **) (&wl_cursor_theme_destroy_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_theme_destroy");
  49. if (verbose) {
  50. error = dlerror();
  51. if (error != NULL) {
  52. fprintf(stderr, "%s\n", error);
  53. }
  54. }
  55. // wl_cursor_theme_get_cursor
  56. *(void **) (&wl_cursor_theme_get_cursor_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_theme_get_cursor");
  57. if (verbose) {
  58. error = dlerror();
  59. if (error != NULL) {
  60. fprintf(stderr, "%s\n", error);
  61. }
  62. }
  63. // wl_cursor_image_get_buffer
  64. *(void **) (&wl_cursor_image_get_buffer_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_image_get_buffer");
  65. if (verbose) {
  66. error = dlerror();
  67. if (error != NULL) {
  68. fprintf(stderr, "%s\n", error);
  69. }
  70. }
  71. // wl_cursor_frame
  72. *(void **) (&wl_cursor_frame_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_frame");
  73. if (verbose) {
  74. error = dlerror();
  75. if (error != NULL) {
  76. fprintf(stderr, "%s\n", error);
  77. }
  78. }
  79. // wl_cursor_frame_and_duration
  80. *(void **) (&wl_cursor_frame_and_duration_dylibloader_wrapper_wayland_cursor) = dlsym(handle, "wl_cursor_frame_and_duration");
  81. if (verbose) {
  82. error = dlerror();
  83. if (error != NULL) {
  84. fprintf(stderr, "%s\n", error);
  85. }
  86. }
  87. return 0;
  88. }