|
⇤ ← Revision 1 as of 2010-05-18 00:58:12
Size: 897
Comment: create page, add content (Wed Mar 10 ver; changeset 4428)
|
Size: 1588
Comment: update content (old wiki)
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 19: | Line 19: |
| <<Color2(green,This has a "void" RV but this text in the description. Should this info be reported in Remarks instead?)>> | <<Color2(green,This has a "void" RV but this text in the description. Should this info be reported in Remarks instead because it's not really a RV?)>> |
| Line 21: | Line 21: |
| Returns a pointer to the object handle (or NULL if there was an error). | Returns a pointer to the object handle or NULL if there was an error. |
| Line 25: | Line 25: |
| You can add your code example here | #include "SDL_loadso.h" // Dynamically load mylib.so SDL_LoadObject("mylib.so"); |
| Line 29: | Line 32: |
| ''You can add useful comments here'' | *<<BR>>These functions only work on C function names. Other languages may have name mangling and intrinsic language support that varies from compiler to compiler. Make sure you declare your function pointers with the same calling convention as the actual library function. Your code will crash mysteriously if you do not do this. Avoid namespace collisions. If you load a symbol from the library, it is not defined whether or not it goes into the global symbol namespace for the application. If it does and it conflicts with symbols in your code or other shared libraries, you will not get the results you expect.<<BR>>* |
| Line 32: | Line 39: |
| .[[SDL_UnloadObject]] ??? | .[[SDL_LoadFunction]] * .[[SDL_UnloadObject]] * |
DRAFT |
SDL_LoadObject
Use this function to dynamically load a shared object and return a pointer to the object handle.
Contents
Syntax
void* SDL_LoadObject(const char* sofile)
Function Parameters
sofile |
a system dependent name of the object file |
Return Value
green
Returns a pointer to the object handle or NULL if there was an error.
Code Examples
#include "SDL_loadso.h"
// Dynamically load mylib.so
SDL_LoadObject("mylib.so");
Remarks
*
These functions only work on C function names. Other languages may have name mangling and intrinsic language support that varies from compiler to compiler.
Make sure you declare your function pointers with the same calling convention as the actual library function. Your code will crash mysteriously if you do not do this.
Avoid namespace collisions. If you load a symbol from the library, it is not defined whether or not it goes into the global symbol namespace for the application. If it does and it conflicts with symbols in your code or other shared libraries, you will not get the results you expect.
*
