alien.libraries: split update-library and add-library again.
parent
1589c0b764
commit
98ed2a8ee5
|
@ -57,6 +57,16 @@ M: library dispose dll>> [ dispose ] when* ;
|
|||
: same-library? ( library path abi -- ? )
|
||||
[ swap path>> = ] [ swap abi>> = ] bi-curry* bi and ;
|
||||
|
||||
: add-library? ( name path abi -- ? )
|
||||
[ lookup-library ] 2dip '[ _ _ same-library? not ] [ t ] if* ;
|
||||
|
||||
: add-library ( name path abi -- )
|
||||
3dup add-library? [
|
||||
[ 2drop remove-library ]
|
||||
[ [ nip ] dip make-library ]
|
||||
[ 2drop libraries get set-at ] 3tri
|
||||
] [ 3drop ] if ;
|
||||
|
||||
: change-dll ( library path abi -- )
|
||||
swap >>abi
|
||||
swap >>path
|
||||
|
@ -64,7 +74,7 @@ M: library dispose dll>> [ dispose ] when* ;
|
|||
[ path>> open-dll ]
|
||||
[ swap >>dlerror swap >>dll drop ] tri ;
|
||||
|
||||
: add-library ( name path abi -- )
|
||||
: update-library ( name path abi -- )
|
||||
pick lookup-library [
|
||||
[ 2over same-library? not ] keep swap
|
||||
[ change-dll drop ] [ 4drop ] if
|
||||
|
|
Loading…
Reference in New Issue