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