SDL_loadso.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. SDL - Simple DirectMedia Layer
  3. Copyright (C) 1997-2009 Sam Lantinga
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with this library; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  15. Sam Lantinga
  16. slouken@libsdl.org
  17. */
  18. /** @file SDL_loadso.h
  19. * System dependent library loading routines
  20. */
  21. /** @file SDL_loadso.h
  22. * Some things to keep in mind:
  23. * - These functions only work on C function names. Other languages may
  24. * have name mangling and intrinsic language support that varies from
  25. * compiler to compiler.
  26. * - Make sure you declare your function pointers with the same calling
  27. * convention as the actual library function. Your code will crash
  28. * mysteriously if you do not do this.
  29. * - Avoid namespace collisions. If you load a symbol from the library,
  30. * it is not defined whether or not it goes into the global symbol
  31. * namespace for the application. If it does and it conflicts with
  32. * symbols in your code or other shared libraries, you will not get
  33. * the results you expect. :)
  34. */
  35. #ifndef _SDL_loadso_h
  36. #define _SDL_loadso_h
  37. #include "SDL_stdinc.h"
  38. #include "SDL_error.h"
  39. #include "begin_code.h"
  40. /* Set up for C function definitions, even when using C++ */
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif
  44. /**
  45. * This function dynamically loads a shared object and returns a pointer
  46. * to the object handle (or NULL if there was an error).
  47. * The 'sofile' parameter is a system dependent name of the object file.
  48. */
  49. extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
  50. /**
  51. * Given an object handle, this function looks up the address of the
  52. * named function in the shared object and returns it. This address
  53. * is no longer valid after calling SDL_UnloadObject().
  54. */
  55. extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
  56. /** Unload a shared object from memory */
  57. extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
  58. /* Ends C function definitions when using C++ */
  59. #ifdef __cplusplus
  60. }
  61. #endif
  62. #include "close_code.h"
  63. #endif /* _SDL_loadso_h */