include/SDL_loadso.h
author Ozkan Sezer <sezeroz@gmail.com>
Sat, 24 Mar 2018 22:27:31 +0300
branchSDL-1.2
changeset 11965 afbe1aac2dd1
parent 6137 4720145f848b
permissions -rw-r--r--
SDL_endian.h: add Watcom inline asm for SDL_Swap16 and SDL_Swap32
slouken@648
     1
/*
slouken@648
     2
    SDL - Simple DirectMedia Layer
slouken@6137
     3
    Copyright (C) 1997-2012 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@4217
    23
/** @file SDL_loadso.h
slouken@4217
    24
 *  System dependent library loading routines
slouken@4217
    25
 */
slouken@648
    26
slouken@4217
    27
/** @file SDL_loadso.h
slouken@4217
    28
 *  Some things to keep in mind:                                        
slouken@4217
    29
 *  - These functions only work on C function names.  Other languages may
slouken@4217
    30
 *    have name mangling and intrinsic language support that varies from
slouken@4217
    31
 *    compiler to compiler.
slouken@4217
    32
 *  - Make sure you declare your function pointers with the same calling
slouken@4217
    33
 *    convention as the actual library function.  Your code will crash
slouken@4217
    34
 *    mysteriously if you do not do this.
slouken@4217
    35
 *  - Avoid namespace collisions.  If you load a symbol from the library,
slouken@4217
    36
 *    it is not defined whether or not it goes into the global symbol
slouken@4217
    37
 *    namespace for the application.  If it does and it conflicts with
slouken@4217
    38
 *    symbols in your code or other shared libraries, you will not get
slouken@4217
    39
 *    the results you expect. :)
slouken@4217
    40
 */
slouken@649
    41
slouken@649
    42
slouken@648
    43
#ifndef _SDL_loadso_h
slouken@648
    44
#define _SDL_loadso_h
slouken@648
    45
slouken@1356
    46
#include "SDL_stdinc.h"
slouken@1358
    47
#include "SDL_error.h"
slouken@1356
    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@4217
    55
/**
slouken@4217
    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@648
    60
extern DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile);
slouken@648
    61
slouken@4217
    62
/**
slouken@4217
    63
 * Given an object handle, this function looks up the address of the
slouken@648
    64
 * named function in the shared object and returns it.  This address
slouken@648
    65
 * is no longer valid after calling SDL_UnloadObject().
slouken@648
    66
 */
slouken@648
    67
extern DECLSPEC void * SDLCALL SDL_LoadFunction(void *handle, const char *name);
slouken@648
    68
slouken@4217
    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@648
    74
}
slouken@648
    75
#endif
slouken@648
    76
#include "close_code.h"
slouken@648
    77
slouken@648
    78
#endif /* _SDL_loadso_h */