xext-so_wrap.c 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. // This file is generated. Do not edit!
  2. // see https://github.com/hpvb/dynload-wrapper for details
  3. // generated by generate-wrapper.py 0.3 on 2023-01-23 15:11:29
  4. // flags: generate-wrapper.py --sys-include "thirdparty/linuxbsd_headers/X11/extensions/Xext.h" --include ./thirdparty/linuxbsd_headers/X11/extensions/shape.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/shape.h" --soname libXext.so.6 --init-name xext --output-header ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xext-so_wrap.c
  5. //
  6. // NOTE: Generated from Xext 1.3.5.
  7. // This has been handpatched to workaround some issues with the generator that
  8. // will be eventually fixed. In this case, non-existent symbols inherited from
  9. // libX11, but absent in libXext.so.6, were removed and an include needed for
  10. // proper parsing was added (this had also to be temporarily added to the
  11. // original header, as dynload-wrapper would complain otherwise)
  12. #include <stdint.h>
  13. // HANDPATCH: Needed for a successful compilation.
  14. #include "thirdparty/linuxbsd_headers/X11/Xlib.h"
  15. #define XShapeQueryExtension XShapeQueryExtension_dylibloader_orig_xext
  16. #define XShapeQueryVersion XShapeQueryVersion_dylibloader_orig_xext
  17. #define XShapeCombineRegion XShapeCombineRegion_dylibloader_orig_xext
  18. #define XShapeCombineRectangles XShapeCombineRectangles_dylibloader_orig_xext
  19. #define XShapeCombineMask XShapeCombineMask_dylibloader_orig_xext
  20. #define XShapeCombineShape XShapeCombineShape_dylibloader_orig_xext
  21. #define XShapeOffsetShape XShapeOffsetShape_dylibloader_orig_xext
  22. #define XShapeQueryExtents XShapeQueryExtents_dylibloader_orig_xext
  23. #define XShapeSelectInput XShapeSelectInput_dylibloader_orig_xext
  24. #define XShapeInputSelected XShapeInputSelected_dylibloader_orig_xext
  25. #define XShapeGetRectangles XShapeGetRectangles_dylibloader_orig_xext
  26. #include "thirdparty/linuxbsd_headers/X11/extensions/Xext.h"
  27. #include "thirdparty/linuxbsd_headers/X11/extensions/shape.h"
  28. #undef XShapeQueryExtension
  29. #undef XShapeQueryVersion
  30. #undef XShapeCombineRegion
  31. #undef XShapeCombineRectangles
  32. #undef XShapeCombineMask
  33. #undef XShapeCombineShape
  34. #undef XShapeOffsetShape
  35. #undef XShapeQueryExtents
  36. #undef XShapeSelectInput
  37. #undef XShapeInputSelected
  38. #undef XShapeGetRectangles
  39. #include <dlfcn.h>
  40. #include <stdio.h>
  41. int (*XShapeQueryExtension_dylibloader_wrapper_xext)( Display*, int*, int*);
  42. int (*XShapeQueryVersion_dylibloader_wrapper_xext)( Display*, int*, int*);
  43. void (*XShapeCombineRegion_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Region, int);
  44. void (*XShapeCombineRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int, int, XRectangle*, int, int, int);
  45. void (*XShapeCombineMask_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Pixmap, int);
  46. void (*XShapeCombineShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int, Window, int, int);
  47. void (*XShapeOffsetShape_dylibloader_wrapper_xext)( Display*, Window, int, int, int);
  48. int (*XShapeQueryExtents_dylibloader_wrapper_xext)( Display*, Window, int*, int*, int*, unsigned int*, unsigned int*, int*, int*, int*, unsigned int*, unsigned int*);
  49. void (*XShapeSelectInput_dylibloader_wrapper_xext)( Display*, Window, unsigned long);
  50. unsigned long (*XShapeInputSelected_dylibloader_wrapper_xext)( Display*, Window);
  51. XRectangle* (*XShapeGetRectangles_dylibloader_wrapper_xext)( Display*, Window, int, int*, int*);
  52. int initialize_xext(int verbose) {
  53. void *handle;
  54. char *error;
  55. handle = dlopen("libXext.so.6", RTLD_LAZY);
  56. if (!handle) {
  57. if (verbose) {
  58. fprintf(stderr, "%s\n", dlerror());
  59. }
  60. return(1);
  61. }
  62. dlerror();
  63. // XShapeQueryExtension
  64. *(void **) (&XShapeQueryExtension_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryExtension");
  65. if (verbose) {
  66. error = dlerror();
  67. if (error != NULL) {
  68. fprintf(stderr, "%s\n", error);
  69. }
  70. }
  71. // XShapeQueryVersion
  72. *(void **) (&XShapeQueryVersion_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryVersion");
  73. if (verbose) {
  74. error = dlerror();
  75. if (error != NULL) {
  76. fprintf(stderr, "%s\n", error);
  77. }
  78. }
  79. // XShapeCombineRegion
  80. *(void **) (&XShapeCombineRegion_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineRegion");
  81. if (verbose) {
  82. error = dlerror();
  83. if (error != NULL) {
  84. fprintf(stderr, "%s\n", error);
  85. }
  86. }
  87. // XShapeCombineRectangles
  88. *(void **) (&XShapeCombineRectangles_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineRectangles");
  89. if (verbose) {
  90. error = dlerror();
  91. if (error != NULL) {
  92. fprintf(stderr, "%s\n", error);
  93. }
  94. }
  95. // XShapeCombineMask
  96. *(void **) (&XShapeCombineMask_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineMask");
  97. if (verbose) {
  98. error = dlerror();
  99. if (error != NULL) {
  100. fprintf(stderr, "%s\n", error);
  101. }
  102. }
  103. // XShapeCombineShape
  104. *(void **) (&XShapeCombineShape_dylibloader_wrapper_xext) = dlsym(handle, "XShapeCombineShape");
  105. if (verbose) {
  106. error = dlerror();
  107. if (error != NULL) {
  108. fprintf(stderr, "%s\n", error);
  109. }
  110. }
  111. // XShapeOffsetShape
  112. *(void **) (&XShapeOffsetShape_dylibloader_wrapper_xext) = dlsym(handle, "XShapeOffsetShape");
  113. if (verbose) {
  114. error = dlerror();
  115. if (error != NULL) {
  116. fprintf(stderr, "%s\n", error);
  117. }
  118. }
  119. // XShapeQueryExtents
  120. *(void **) (&XShapeQueryExtents_dylibloader_wrapper_xext) = dlsym(handle, "XShapeQueryExtents");
  121. if (verbose) {
  122. error = dlerror();
  123. if (error != NULL) {
  124. fprintf(stderr, "%s\n", error);
  125. }
  126. }
  127. // XShapeSelectInput
  128. *(void **) (&XShapeSelectInput_dylibloader_wrapper_xext) = dlsym(handle, "XShapeSelectInput");
  129. if (verbose) {
  130. error = dlerror();
  131. if (error != NULL) {
  132. fprintf(stderr, "%s\n", error);
  133. }
  134. }
  135. // XShapeInputSelected
  136. *(void **) (&XShapeInputSelected_dylibloader_wrapper_xext) = dlsym(handle, "XShapeInputSelected");
  137. if (verbose) {
  138. error = dlerror();
  139. if (error != NULL) {
  140. fprintf(stderr, "%s\n", error);
  141. }
  142. }
  143. // XShapeGetRectangles
  144. *(void **) (&XShapeGetRectangles_dylibloader_wrapper_xext) = dlsym(handle, "XShapeGetRectangles");
  145. if (verbose) {
  146. error = dlerror();
  147. if (error != NULL) {
  148. fprintf(stderr, "%s\n", error);
  149. }
  150. }
  151. return 0;
  152. }