1b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* 2b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet SDL - Simple DirectMedia Layer 34458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall Copyright (C) 1997-2012 Sam Lantinga 4b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 5b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet This library is free software; you can redistribute it and/or 6b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet modify it under the terms of the GNU Lesser General Public 7b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet License as published by the Free Software Foundation; either 8b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet version 2.1 of the License, or (at your option) any later version. 9b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 10b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet This library is distributed in the hope that it will be useful, 11b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet but WITHOUT ANY WARRANTY; without even the implied warranty of 12b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Lesser General Public License for more details. 14b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 15b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet You should have received a copy of the GNU Lesser General Public 16b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet License along with this library; if not, write to the Free Software 17b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 19b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet Sam Lantinga 20b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet slouken@libsdl.org 21b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet*/ 22b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 234458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @file SDL_loadso.h 244458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * System dependent library loading routines 254458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 26b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 274458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** @file SDL_loadso.h 284458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Some things to keep in mind: 294458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * - These functions only work on C function names. Other languages may 304458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * have name mangling and intrinsic language support that varies from 314458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * compiler to compiler. 324458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * - Make sure you declare your function pointers with the same calling 334458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * convention as the actual library function. Your code will crash 344458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * mysteriously if you do not do this. 354458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * - Avoid namespace collisions. If you load a symbol from the library, 364458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * it is not defined whether or not it goes into the global symbol 374458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * namespace for the application. If it does and it conflicts with 384458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * symbols in your code or other shared libraries, you will not get 394458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * the results you expect. :) 404458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall */ 41b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 42b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 43b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifndef _SDL_loadso_h 44b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#define _SDL_loadso_h 45b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 46b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "SDL_stdinc.h" 47b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "SDL_error.h" 48b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 49b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "begin_code.h" 50b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* Set up for C function definitions, even when using C++ */ 51b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifdef __cplusplus 52b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern "C" { 53b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif 54b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 554458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 564458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * This function dynamically loads a shared object and returns a pointer 57b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * to the object handle (or NULL if there was an error). 58b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * The 'sofile' parameter is a system dependent name of the object file. 59b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 60b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); 61b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 624458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** 634458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall * Given an object handle, this function looks up the address of the 64b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * named function in the shared object and returns it. This address 65b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet * is no longer valid after calling SDL_UnloadObject(). 66b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet */ 67b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name); 68b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 694458c4364a99c5d8d124b19eec146b0998c4895aJesse Hall/** Unload a shared object from memory */ 70b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohetextern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 71b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 72b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet/* Ends C function definitions when using C++ */ 73b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#ifdef __cplusplus 74b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet} 75b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif 76b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#include "close_code.h" 77b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet 78b565d46b836401fa5dac23f9f8f0841c7a41e58eXavier Ducrohet#endif /* _SDL_loadso_h */ 79