1 USING: accessors alien.libraries kernel sequences system vocabs ;
2 IN: alien.libraries.finder
4 HOOK: find-library* os ( name -- path/f )
6 : find-library ( name -- path/library-not-found )
7 [ find-library* ] transmute ;
9 : ?update-library ( name path abi -- )
10 pick lookup-library [ dll>> dll-valid? ] [ f ] if* [
13 [ find-library ] [ update-library ] bi*
16 ! Try to find the library from a list, but if it's not found,
17 ! try to open a library that is the first name in that list anyway
18 ! or "library_not_found" as a last resort for better debugging.
19 : find-library-from-list ( seq -- path/f )
20 [ [ find-library* ] map-find drop ]
21 [ ?first "library_not_found" or ] ?unless ;
23 "alien.libraries.finder." os name>> append require