include/SDL_loadso.h
author Bob Pendleton <bob@pendleton.com>
Thu, 09 Jul 2009 21:31:27 +0000
changeset 3216 48a80f2a7ff2
parent 2859 99210400e8b9
child 3407 d3baf5ac4e37
permissions -rw-r--r--
volitile... duh, yeah the variable need to be labeled volitile
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@1895
    24
 * \file SDL_loadso.h
slouken@1895
    25
 *
slouken@1895
    26
 * System dependent library loading routines
slouken@1895
    27
 *
slouken@1895
    28
 * Some things to keep in mind:                                        
slouken@1895
    29
 * - These functions only work on C function names.  Other languages may
slouken@1895
    30
 *   have name mangling and intrinsic language support that varies from
slouken@1895
    31
 *   compiler to compiler.
slouken@1895
    32
 * - Make sure you declare your function pointers with the same calling
slouken@1895
    33
 *   convention as the actual library function.  Your code will crash
slouken@1895
    34
 *   mysteriously if you do not do this.
slouken@1895
    35
 * - Avoid namespace collisions.  If you load a symbol from the library,
slouken@1895
    36
 *   it is not defined whether or not it goes into the global symbol
slouken@1895
    37
 *   namespace for the application.  If it does and it conflicts with
slouken@1895
    38
 *   symbols in your code or other shared libraries, you will not get
slouken@1895
    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@648
    56
/* This function dynamically loads a shared object and returns a pointer
slouken@648
    57
 * to the object handle (or NULL if there was an error).
slouken@648
    58
 * The 'sofile' parameter is a system dependent name of the object file.
slouken@648
    59
 */
slouken@1895
    60
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
slouken@648
    61
slouken@648
    62
/* Given an object handle, this function looks up the address of the
slouken@648
    63
 * named function in the shared object and returns it.  This address
slouken@648
    64
 * is no longer valid after calling SDL_UnloadObject().
slouken@648
    65
 */
slouken@1895
    66
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
slouken@1895
    67
                                               const char *name);
slouken@648
    68
slouken@648
    69
/* Unload a shared object from memory */
slouken@648
    70
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
slouken@648
    71
slouken@648
    72
/* Ends C function definitions when using C++ */
slouken@648
    73
#ifdef __cplusplus
slouken@1895
    74
/* *INDENT-OFF* */
slouken@648
    75
}
slouken@1895
    76
/* *INDENT-ON* */
slouken@648
    77
#endif
slouken@648
    78
#include "close_code.h"
slouken@648
    79
slouken@648
    80
#endif /* _SDL_loadso_h */
slouken@1895
    81
slouken@1895
    82
/* vi: set ts=4 sw=4 expandtab: */