-
Notifications
You must be signed in to change notification settings - Fork 13
/
loadso.c.v
32 lines (26 loc) · 1.03 KB
/
loadso.c.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright(C) 2021 Lars Pontoppidan. All rights reserved.
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
module sdl
//
// SDL_loadso.h
//
fn C.SDL_LoadObject(sofile &char) voidptr
// load_object dynamically loads a shared object and returns a pointer
// to the object handle (or NULL if there was an error).
// The 'sofile' parameter is a system dependent name of the object file.
pub fn load_object(sofile &char) voidptr {
return C.SDL_LoadObject(sofile)
}
fn C.SDL_LoadFunction(handle voidptr, const_name &char) voidptr
// load_function, given an object handle, looks up the address of the
// named function in the shared object and returns it. This address
// is no longer valid after calling SDL_UnloadObject().
pub fn load_function(handle voidptr, const_name &char) voidptr {
return C.SDL_LoadFunction(handle, const_name)
}
fn C.SDL_UnloadObject(handle voidptr)
// unload_object unloads a shared object from memory.
pub fn unload_object(handle voidptr) {
C.SDL_UnloadObject(handle)
}