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