include/SDL_loadso.h
author Ryan C. Gordon <icculus@icculus.org>
Sun, 12 Apr 2015 20:28:28 -0400
changeset 9553 75dca0c33be6
parent 8215 54555ad9342c
child 9619 b94b6d0bff0f
permissions -rw-r--r--
Merged.
slouken@648
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@8149
     3
  Copyright (C) 1997-2014 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@7191
    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@648
    50
extern "C" {
slouken@648
    51
#endif
slouken@648
    52
slouken@3407
    53
/**
slouken@3407
    54
 *  This function dynamically loads a shared object and returns a pointer
slouken@3407
    55
 *  to the object handle (or NULL if there was an error).
slouken@3407
    56
 *  The 'sofile' parameter is a system dependent name of the object file.
slouken@648
    57
 */
slouken@1895
    58
extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile);
slouken@648
    59
slouken@3407
    60
/**
slouken@3407
    61
 *  Given an object handle, this function looks up the address of the
slouken@3407
    62
 *  named function in the shared object and returns it.  This address
slouken@3407
    63
 *  is no longer valid after calling SDL_UnloadObject().
slouken@648
    64
 */
slouken@1895
    65
extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle,
slouken@1895
    66
                                               const char *name);
slouken@648
    67
slouken@3407
    68
/**
slouken@3407
    69
 *  Unload a shared object from memory.
slouken@3407
    70
 */
slouken@648
    71
extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle);
slouken@648
    72
slouken@648
    73
/* Ends C function definitions when using C++ */
slouken@648
    74
#ifdef __cplusplus
slouken@648
    75
}
slouken@648
    76
#endif
slouken@648
    77
#include "close_code.h"
slouken@648
    78
slouken@648
    79
#endif /* _SDL_loadso_h */
slouken@1895
    80
slouken@1895
    81
/* vi: set ts=4 sw=4 expandtab: */