include/SDL_loadso.h
author Sam Lantinga <slouken@libsdl.org>
Fri, 15 Feb 2013 08:47:44 -0800
changeset 6885 700f1b25f77f
parent 6138 4c64952a58fb
child 7191 75360622e65f
permissions -rw-r--r--
Happy New Year!
slouken@648
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
slouken@648
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@648
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@648
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@648
    20
*/
slouken@648
    21
slouken@1895
    22
/**
slouken@3407
    23
 *  \file SDL_loadso.h
slouken@1895
    24
 *
slouken@3407
    25
 *  System dependent library loading routines
slouken@1895
    26
 *
slouken@3407
    27
 *  Some things to keep in mind:                                        
slouken@3407
    28
 *  \li These functions only work on C function names.  Other languages may
slouken@3407
    29
 *      have name mangling and intrinsic language support that varies from
slouken@3407
    30
 *      compiler to compiler.
slouken@3407
    31
 *  \li Make sure you declare your function pointers with the same calling
slouken@3407
    32
 *      convention as the actual library function.  Your code will crash
slouken@3407
    33
 *      mysteriously if you do not do this.
slouken@3407
    34
 *  \li Avoid namespace collisions.  If you load a symbol from the library,
slouken@3407
    35
 *      it is not defined whether or not it goes into the global symbol
slouken@3407
    36
 *      namespace for the application.  If it does and it conflicts with
slouken@3407
    37
 *      symbols in your code or other shared libraries, you will not get
slouken@3407
    38
 *      the results you expect. :)
slouken@1895
    39
 */
slouken@649
    40
slouken@648
    41
#ifndef _SDL_loadso_h
slouken@648
    42
#define _SDL_loadso_h
slouken@648
    43
slouken@1356
    44
#include "SDL_stdinc.h"
slouken@1358
    45
#include "SDL_error.h"
slouken@1356
    46
slouken@648
    47
#include "begin_code.h"
slouken@648
    48
/* Set up for C function definitions, even when using C++ */
slouken@648
    49
#ifdef __cplusplus
slouken@1895
    50
/* *INDENT-OFF* */
slouken@648
    51
extern "C" {
slouken@1895
    52
/* *INDENT-ON* */
slouken@648
    53
#endif
slouken@648
    54
slouken@3407
    55
/**
slouken@3407
    56
 *  This function dynamically loads a shared object and returns a pointer
slouken@3407
    57
 *  to the object handle (or NULL if there was an error).
slouken@3407
    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@3407
    62
/**
slouken@3407
    63
 *  Given an object handle, this function looks up the address of the
slouken@3407
    64
 *  named function in the shared object and returns it.  This address
slouken@3407
    65
 *  is no longer valid after calling SDL_UnloadObject().
slouken@648
    66
 */
slouken@1895
    67
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
slouken@1895
    68
                                               const char *name);
slouken@648
    69
slouken@3407
    70
/**
slouken@3407
    71
 *  Unload a shared object from memory.
slouken@3407
    72
 */
slouken@648
    73
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
slouken@648
    74
slouken@648
    75
/* Ends C function definitions when using C++ */
slouken@648
    76
#ifdef __cplusplus
slouken@1895
    77
/* *INDENT-OFF* */
slouken@648
    78
}
slouken@1895
    79
/* *INDENT-ON* */
slouken@648
    80
#endif
slouken@648
    81
#include "close_code.h"
slouken@648
    82
slouken@648
    83
#endif /* _SDL_loadso_h */
slouken@1895
    84
slouken@1895
    85
/* vi: set ts=4 sw=4 expandtab: */