Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
71 lines (59 loc) · 1.98 KB

SDL_sysloadso.c

File metadata and controls

71 lines (59 loc) · 1.98 KB
 
Apr 8, 2011
Apr 8, 2011
2
3
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
Apr 8, 2011
Apr 8, 2011
5
6
7
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Apr 8, 2011
Apr 8, 2011
9
10
11
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
Apr 8, 2011
Apr 8, 2011
13
14
15
16
17
18
19
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Feb 21, 2006
Feb 21, 2006
21
#include "SDL_config.h"
Apr 14, 2006
Apr 14, 2006
23
24
#ifdef SDL_LOADSO_BEOS
25
26
27
28
29
30
31
32
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
#include <stdio.h>
#include <be/kernel/image.h>
#include "SDL_loadso.h"
Jul 10, 2006
Jul 10, 2006
33
34
void *
SDL_LoadObject(const char *sofile)
Jul 10, 2006
Jul 10, 2006
36
37
void *handle = NULL;
image_id library_id = load_add_on(sofile);
Nov 7, 2006
Nov 7, 2006
38
39
if (library_id < 0) {
SDL_SetError(strerror((int) library_id));
Jul 10, 2006
Jul 10, 2006
40
41
42
43
} else {
handle = (void *) (library_id);
}
return (handle);
Jul 10, 2006
Jul 10, 2006
46
47
void *
SDL_LoadFunction(void *handle, const char *name)
Nov 7, 2006
Nov 7, 2006
49
void *sym = NULL;
Jul 10, 2006
Jul 10, 2006
50
image_id library_id = (image_id) handle;
Jun 14, 2007
Jun 14, 2007
51
52
status_t rc =
get_image_symbol(library_id, name, B_SYMBOL_TYPE_TEXT, &sym);
Nov 7, 2006
Nov 7, 2006
53
54
if (rc != B_NO_ERROR) {
SDL_SetError(strerror(rc));
Jul 10, 2006
Jul 10, 2006
55
}
Nov 7, 2006
Nov 7, 2006
56
return (sym);
Jul 10, 2006
Jul 10, 2006
59
60
void
SDL_UnloadObject(void *handle)
Jul 10, 2006
Jul 10, 2006
62
63
64
65
66
image_id library_id;
if (handle != NULL) {
library_id = (image_id) handle;
unload_add_on(library_id);
}
Apr 14, 2006
Apr 14, 2006
69
#endif /* SDL_LOADSO_BEOS */
Nov 7, 2006
Nov 7, 2006
70
Jul 10, 2006
Jul 10, 2006
71
/* vi: set ts=4 sw=4 expandtab: */