1 ! Copyright (C) 2013 Björn Lindqvist, John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
4 USING: alien.libraries.finder arrays combinators.short-circuit
5 environment io.files io.files.info io.pathnames kernel sequences
6 splitting system system-info.windows ;
8 IN: alien.libraries.finder.windows
12 : search-paths ( -- seq )
13 "resource:" system-directory windows-directory 3array
14 "PATH" os-env [ ";" split ] [ f ] if* append ;
16 : candidate-paths ( name -- seq )
17 search-paths over ".dll" tail? [
18 [ prepend-path ] with map
22 [ [ ".dll" append ] [ prepend-path ] bi* ] 2bi
29 M: windows find-library*
31 { [ exists? ] [ file-info regular-file? ] } 1&&