alien.libraries: Add a way to see if a dll has a function.

db4
Doug Coleman 2016-03-04 09:14:49 -08:00
parent d0616c5fa8
commit 27b954f95b
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ C: <library> library
: lookup-library ( name -- library ) libraries get at ;
ERROR: no-library-named name ;
GENERIC: dlsym? ( name string/dll -- ? )
M: string dlsym? dup lookup-library [ nip dll>> dlsym? ] [ no-library-named ] if* ;
M: dll dlsym? dlsym >boolean ;
: open-dll ( path -- dll dll-error/f )
[ dlopen dup dll-valid? [ f ] [ dlerror ] if ]
[ f f ] if* ;