Path: blob/main/system/include/SDL/SDL_loadso.h
6169 views
/*1Simple DirectMedia Layer2Copyright (C) 1997-2011 Sam Lantinga <[email protected]>34This software is provided 'as-is', without any express or implied5warranty. In no event will the authors be held liable for any damages6arising from the use of this software.78Permission is granted to anyone to use this software for any purpose,9including commercial applications, and to alter it and redistribute it10freely, subject to the following restrictions:11121. The origin of this software must not be misrepresented; you must not13claim that you wrote the original software. If you use this software14in a product, an acknowledgment in the product documentation would be15appreciated but is not required.162. Altered source versions must be plainly marked as such, and must not be17misrepresented as being the original software.183. This notice may not be removed or altered from any source distribution.19*/2021/**22* \file SDL_loadso.h23*24* System dependent library loading routines25*26* Some things to keep in mind:27* \li These functions only work on C function names. Other languages may28* have name mangling and intrinsic language support that varies from29* compiler to compiler.30* \li Make sure you declare your function pointers with the same calling31* convention as the actual library function. Your code will crash32* mysteriously if you do not do this.33* \li Avoid namespace collisions. If you load a symbol from the library,34* it is not defined whether or not it goes into the global symbol35* namespace for the application. If it does and it conflicts with36* symbols in your code or other shared libraries, you will not get37* the results you expect. :)38*/3940#ifndef _SDL_loadso_h41#define _SDL_loadso_h4243#include "SDL_stdinc.h"44#include "SDL_error.h"4546#include "begin_code.h"47/* Set up for C function definitions, even when using C++ */48#ifdef __cplusplus49/* *INDENT-OFF* */50extern "C" {51/* *INDENT-ON* */52#endif5354/**55* This function dynamically loads a shared object and returns a pointer56* to the object handle (or NULL if there was an error).57* The 'sofile' parameter is a system dependent name of the object file.58*/59extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);6061/**62* Given an object handle, this function looks up the address of the63* named function in the shared object and returns it. This address64* is no longer valid after calling SDL_UnloadObject().65*/66extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,67const char *name);6869/**70* Unload a shared object from memory.71*/72extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);7374/* Ends C function definitions when using C++ */75#ifdef __cplusplus76/* *INDENT-OFF* */77}78/* *INDENT-ON* */79#endif80#include "close_code.h"8182#endif /* _SDL_loadso_h */8384/* vi: set ts=4 sw=4 expandtab: */858687