comparison include/SDL_loadso.h @ 1895:c121d94672cb

SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 10 Jul 2006 21:04:37 +0000
parents c71e05b4dc2e
children 99210400e8b9
comparison
equal deleted inserted replaced
1894:c69cee13dd76 1895:c121d94672cb
18 18
19 Sam Lantinga 19 Sam Lantinga
20 slouken@libsdl.org 20 slouken@libsdl.org
21 */ 21 */
22 22
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 23 /**
24 /* System dependent library loading routines */ 24 * \file SDL_loadso.h
25 25 *
26 /* Some things to keep in mind: 26 * System dependent library loading routines
27 - These functions only work on C function names. Other languages may 27 *
28 have name mangling and intrinsic language support that varies from 28 * Some things to keep in mind:
29 compiler to compiler. 29 * - These functions only work on C function names. Other languages may
30 - Make sure you declare your function pointers with the same calling 30 * have name mangling and intrinsic language support that varies from
31 convention as the actual library function. Your code will crash 31 * compiler to compiler.
32 mysteriously if you do not do this. 32 * - Make sure you declare your function pointers with the same calling
33 - Avoid namespace collisions. If you load a symbol from the library, 33 * convention as the actual library function. Your code will crash
34 it is not defined whether or not it goes into the global symbol 34 * mysteriously if you do not do this.
35 namespace for the application. If it does and it conflicts with 35 * - Avoid namespace collisions. If you load a symbol from the library,
36 symbols in your code or other shared libraries, you will not get 36 * it is not defined whether or not it goes into the global symbol
37 the results you expect. :) 37 * namespace for the application. If it does and it conflicts with
38 */ 38 * symbols in your code or other shared libraries, you will not get
39 39 * the results you expect. :)
40 */
40 41
41 #ifndef _SDL_loadso_h 42 #ifndef _SDL_loadso_h
42 #define _SDL_loadso_h 43 #define _SDL_loadso_h
43 44
44 #include "SDL_stdinc.h" 45 #include "SDL_stdinc.h"
45 #include "SDL_error.h" 46 #include "SDL_error.h"
46 47
47 #include "begin_code.h" 48 #include "begin_code.h"
48 /* Set up for C function definitions, even when using C++ */ 49 /* Set up for C function definitions, even when using C++ */
49 #ifdef __cplusplus 50 #ifdef __cplusplus
51 /* *INDENT-OFF* */
50 extern "C" { 52 extern "C" {
53 /* *INDENT-ON* */
51 #endif 54 #endif
52 55
53 /* This function dynamically loads a shared object and returns a pointer 56 /* This function dynamically loads a shared object and returns a pointer
54 * to the object handle (or NULL if there was an error). 57 * to the object handle (or NULL if there was an error).
55 * The 'sofile' parameter is a system dependent name of the object file. 58 * The 'sofile' parameter is a system dependent name of the object file.
56 */ 59 */
57 extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); 60 extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
58 61
59 /* Given an object handle, this function looks up the address of the 62 /* Given an object handle, this function looks up the address of the
60 * named function in the shared object and returns it. This address 63 * named function in the shared object and returns it. This address
61 * is no longer valid after calling SDL_UnloadObject(). 64 * is no longer valid after calling SDL_UnloadObject().
62 */ 65 */
63 extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); 66 extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
67 const char *name);
64 68
65 /* Unload a shared object from memory */ 69 /* Unload a shared object from memory */
66 extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 70 extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
67 71
68 /* Ends C function definitions when using C++ */ 72 /* Ends C function definitions when using C++ */
69 #ifdef __cplusplus 73 #ifdef __cplusplus
74 /* *INDENT-OFF* */
70 } 75 }
76 /* *INDENT-ON* */
71 #endif 77 #endif
72 #include "close_code.h" 78 #include "close_code.h"
73 79
74 #endif /* _SDL_loadso_h */ 80 #endif /* _SDL_loadso_h */
81
82 /* vi: set ts=4 sw=4 expandtab: */