SDL Library

Dependents:   H261_decoder

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SDL_loadso.h Source File

SDL_loadso.h

Go to the documentation of this file.
00001 /*
00002   Simple DirectMedia Layer
00003   Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
00004 
00005   This software is provided 'as-is', without any express or implied
00006   warranty.  In no event will the authors be held liable for any damages
00007   arising from the use of this software.
00008 
00009   Permission is granted to anyone to use this software for any purpose,
00010   including commercial applications, and to alter it and redistribute it
00011   freely, subject to the following restrictions:
00012 
00013   1. The origin of this software must not be misrepresented; you must not
00014      claim that you wrote the original software. If you use this software
00015      in a product, an acknowledgment in the product documentation would be
00016      appreciated but is not required.
00017   2. Altered source versions must be plainly marked as such, and must not be
00018      misrepresented as being the original software.
00019   3. This notice may not be removed or altered from any source distribution.
00020 */
00021 
00022 /**
00023  *  \file SDL_loadso.h
00024  *
00025  *  System dependent library loading routines
00026  *
00027  *  Some things to keep in mind:
00028  *  \li These functions only work on C function names.  Other languages may
00029  *      have name mangling and intrinsic language support that varies from
00030  *      compiler to compiler.
00031  *  \li Make sure you declare your function pointers with the same calling
00032  *      convention as the actual library function.  Your code will crash
00033  *      mysteriously if you do not do this.
00034  *  \li Avoid namespace collisions.  If you load a symbol from the library,
00035  *      it is not defined whether or not it goes into the global symbol
00036  *      namespace for the application.  If it does and it conflicts with
00037  *      symbols in your code or other shared libraries, you will not get
00038  *      the results you expect. :)
00039  */
00040 
00041 #ifndef _SDL_loadso_h
00042 #define _SDL_loadso_h
00043 
00044 #include "SDL_stdinc.h"
00045 #include "SDL_error.h"
00046 
00047 #include "begin_code.h"
00048 /* Set up for C function definitions, even when using C++ */
00049 #ifdef __cplusplus
00050 extern "C" {
00051 #endif
00052 
00053 /**
00054  *  This function dynamically loads a shared object and returns a pointer
00055  *  to the object handle (or NULL if there was an error).
00056  *  The 'sofile' parameter is a system dependent name of the object file.
00057  */
00058 extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
00059 
00060 /**
00061  *  Given an object handle, this function looks up the address of the
00062  *  named function in the shared object and returns it.  This address
00063  *  is no longer valid after calling SDL_UnloadObject().
00064  */
00065 extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
00066                                                const char *name);
00067 
00068 /**
00069  *  Unload a shared object from memory.
00070  */
00071 extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
00072 
00073 /* Ends C function definitions when using C++ */
00074 #ifdef __cplusplus
00075 }
00076 #endif
00077 #include "close_code.h"
00078 
00079 #endif /* _SDL_loadso_h */
00080 
00081 /* vi: set ts=4 sw=4 expandtab: */