include/SDL_loadso.h
author Ryan C. Gordon <icculus@icculus.org>
Tue, 15 Dec 2009 18:00:16 +0000
changeset 3567 fb9ea4b549c3
parent 3407 d3baf5ac4e37
child 3697 f7b03b6838cb
permissions -rw-r--r--
Added a warning comment to SDL_putenv().

"Fixes" Bugzilla #779.
slouken@648
     1
/*
slouken@648
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@648
     4
slouken@648
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@648
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 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@1312
    13
    Lesser General Public License for more details.
slouken@648
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@648
    18
slouken@648
    19
    Sam Lantinga
slouken@648
    20
    slouken@libsdl.org
slouken@648
    21
*/
slouken@648
    22
slouken@1895
    23
/**
slouken@3407
    24
 *  \file SDL_loadso.h
slouken@1895
    25
 *
slouken@3407
    26
 *  System dependent library loading routines
slouken@1895
    27
 *
slouken@3407
    28
 *  Some things to keep in mind:                                        
slouken@3407
    29
 *  \li These functions only work on C function names.  Other languages may
slouken@3407
    30
 *      have name mangling and intrinsic language support that varies from
slouken@3407
    31
 *      compiler to compiler.
slouken@3407
    32
 *  \li Make sure you declare your function pointers with the same calling
slouken@3407
    33
 *      convention as the actual library function.  Your code will crash
slouken@3407
    34
 *      mysteriously if you do not do this.
slouken@3407
    35
 *  \li Avoid namespace collisions.  If you load a symbol from the library,
slouken@3407
    36
 *      it is not defined whether or not it goes into the global symbol
slouken@3407
    37
 *      namespace for the application.  If it does and it conflicts with
slouken@3407
    38
 *      symbols in your code or other shared libraries, you will not get
slouken@3407
    39
 *      the results you expect. :)
slouken@1895
    40
 */
slouken@649
    41
slouken@648
    42
#ifndef _SDL_loadso_h
slouken@648
    43
#define _SDL_loadso_h
slouken@648
    44
slouken@1356
    45
#include "SDL_stdinc.h"
slouken@1358
    46
#include "SDL_error.h"
slouken@1356
    47
slouken@648
    48
#include "begin_code.h"
slouken@648
    49
/* Set up for C function definitions, even when using C++ */
slouken@648
    50
#ifdef __cplusplus
slouken@1895
    51
/* *INDENT-OFF* */
slouken@648
    52
extern "C" {
slouken@1895
    53
/* *INDENT-ON* */
slouken@648
    54
#endif
slouken@648
    55
slouken@3407
    56
/**
slouken@3407
    57
 *  This function dynamically loads a shared object and returns a pointer
slouken@3407
    58
 *  to the object handle (or NULL if there was an error).
slouken@3407
    59
 *  The 'sofile' parameter is a system dependent name of the object file.
slouken@648
    60
 */
slouken@1895
    61
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
slouken@648
    62
slouken@3407
    63
/**
slouken@3407
    64
 *  Given an object handle, this function looks up the address of the
slouken@3407
    65
 *  named function in the shared object and returns it.  This address
slouken@3407
    66
 *  is no longer valid after calling SDL_UnloadObject().
slouken@648
    67
 */
slouken@1895
    68
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
slouken@1895
    69
                                               const char *name);
slouken@648
    70
slouken@3407
    71
/**
slouken@3407
    72
 *  Unload a shared object from memory.
slouken@3407
    73
 */
slouken@648
    74
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
slouken@648
    75
slouken@648
    76
/* Ends C function definitions when using C++ */
slouken@648
    77
#ifdef __cplusplus
slouken@1895
    78
/* *INDENT-OFF* */
slouken@648
    79
}
slouken@1895
    80
/* *INDENT-ON* */
slouken@648
    81
#endif
slouken@648
    82
#include "close_code.h"
slouken@648
    83
slouken@648
    84
#endif /* _SDL_loadso_h */
slouken@1895
    85
slouken@1895
    86
/* vi: set ts=4 sw=4 expandtab: */