🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.8 KiB

  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. /**
  19. * \file SDL_loadso.h
  20. *
  21. * System dependent library loading routines
  22. *
  23. * Some things to keep in mind:
  24. * \li These functions only work on C function names. Other languages may
  25. * have name mangling and intrinsic language support that varies from
  26. * compiler to compiler.
  27. * \li Make sure you declare your function pointers with the same calling
  28. * convention as the actual library function. Your code will crash
  29. * mysteriously if you do not do this.
  30. * \li Avoid namespace collisions. If you load a symbol from the library,
  31. * it is not defined whether or not it goes into the global symbol
  32. * namespace for the application. If it does and it conflicts with
  33. * symbols in your code or other shared libraries, you will not get
  34. * the results you expect. :)
  35. */
  36. #ifndef SDL_loadso_h_
  37. #define SDL_loadso_h_
  38. #include "SDL_stdinc.h"
  39. #include "SDL_error.h"
  40. #include "begin_code.h"
  41. /* Set up for C function definitions, even when using C++ */
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45. /**
  46. * Dynamically load a shared object.
  47. *
  48. * \param sofile a system-dependent name of the object file
  49. * \returns an opaque pointer to the object handle or NULL if there was an
  50. * error; call SDL_GetError() for more information.
  51. *
  52. * \since This function is available since SDL 2.0.0.
  53. *
  54. * \sa SDL_LoadFunction
  55. * \sa SDL_UnloadObject
  56. */
  57. extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
  58. /**
  59. * Look up the address of the named function in a shared object.
  60. *
  61. * This function pointer is no longer valid after calling SDL_UnloadObject().
  62. *
  63. * This function can only look up C function names. Other languages may have
  64. * name mangling and intrinsic language support that varies from compiler to
  65. * compiler.
  66. *
  67. * Make sure you declare your function pointers with the same calling
  68. * convention as the actual library function. Your code will crash
  69. * mysteriously if you do not do this.
  70. *
  71. * If the requested function doesn't exist, NULL is returned.
  72. *
  73. * \param handle a valid shared object handle returned by SDL_LoadObject()
  74. * \param name the name of the function to look up
  75. * \returns a pointer to the function or NULL if there was an error; call
  76. * SDL_GetError() for more information.
  77. *
  78. * \since This function is available since SDL 2.0.0.
  79. *
  80. * \sa SDL_LoadObject
  81. * \sa SDL_UnloadObject
  82. */
  83. extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
  84. const char *name);
  85. /**
  86. * Unload a shared object from memory.
  87. *
  88. * \param handle a valid shared object handle returned by SDL_LoadObject()
  89. *
  90. * \since This function is available since SDL 2.0.0.
  91. *
  92. * \sa SDL_LoadFunction
  93. * \sa SDL_LoadObject
  94. */
  95. extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
  96. /* Ends C function definitions when using C++ */
  97. #ifdef __cplusplus
  98. }
  99. #endif
  100. #include "close_code.h"
  101. #endif /* SDL_loadso_h_ */
  102. /* vi: set ts=4 sw=4 expandtab: */