include/SDL_loadso.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 06 Mar 2002 05:20:11 +0000
changeset 294 d2d48e10f370
permissions -rw-r--r--
Added a new header file: SDL_loadso.h
It contains the following functions:
SDL_LoadObject(), SDL_LoadFunction(), SDL_UnloadObject()
The UNIX esd and arts audio code use these to dynamically load
their respective audio libraries.
slouken@294
     1
/*
slouken@294
     2
    SDL - Simple DirectMedia Layer
slouken@294
     3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
slouken@294
     4
slouken@294
     5
    This library is free software; you can redistribute it and/or
slouken@294
     6
    modify it under the terms of the GNU Library General Public
slouken@294
     7
    License as published by the Free Software Foundation; either
slouken@294
     8
    version 2 of the License, or (at your option) any later version.
slouken@294
     9
slouken@294
    10
    This library is distributed in the hope that it will be useful,
slouken@294
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@294
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@294
    13
    Library General Public License for more details.
slouken@294
    14
slouken@294
    15
    You should have received a copy of the GNU Library General Public
slouken@294
    16
    License along with this library; if not, write to the Free
slouken@294
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@294
    18
slouken@294
    19
    Sam Lantinga
slouken@294
    20
    slouken@libsdl.org
slouken@294
    21
*/
slouken@294
    22
slouken@294
    23
#ifdef SAVE_RCSID
slouken@294
    24
static char rcsid =
slouken@294
    25
 "@(#) $Id$";
slouken@294
    26
#endif
slouken@294
    27
slouken@294
    28
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
slouken@294
    29
/* System dependent library loading routines                           */
slouken@294
    30
slouken@294
    31
#ifndef _SDL_loadso_h
slouken@294
    32
#define _SDL_loadso_h
slouken@294
    33
slouken@294
    34
#include "begin_code.h"
slouken@294
    35
/* Set up for C function definitions, even when using C++ */
slouken@294
    36
#ifdef __cplusplus
slouken@294
    37
extern "C" {
slouken@294
    38
#endif
slouken@294
    39
slouken@294
    40
/* This function dynamically loads a shared object and returns a pointer
slouken@294
    41
 * to the object handle (or NULL if there was an error).
slouken@294
    42
 * The 'sofile' parameter is a system dependent name of the object file.
slouken@294
    43
 */
slouken@294
    44
extern DECLSPEC void *SDL_LoadObject(const char *sofile);
slouken@294
    45
slouken@294
    46
/* Given an object handle, this function looks up the address of the
slouken@294
    47
 * named function in the shared object and returns it.  This address
slouken@294
    48
 * is no longer valid after calling SDL_UnloadObject().
slouken@294
    49
 */
slouken@294
    50
extern DECLSPEC void *SDL_LoadFunction(void *handle, const char *name);
slouken@294
    51
slouken@294
    52
/* Unload a shared object from memory */
slouken@294
    53
extern DECLSPEC void SDL_UnloadObject(void *handle);
slouken@294
    54
slouken@294
    55
/* Ends C function definitions when using C++ */
slouken@294
    56
#ifdef __cplusplus
slouken@294
    57
}
slouken@294
    58
#endif
slouken@294
    59
#include "close_code.h"
slouken@294
    60
slouken@294
    61
#endif /* _SDL_loadso_h */