load-library returns f if library not defined
parent
0d10b84614
commit
254d8455a3
|
@ -65,8 +65,7 @@ HELP: dlclose ( dll -- )
|
||||||
|
|
||||||
HELP: load-library
|
HELP: load-library
|
||||||
{ $values { "name" "a string" } { "dll" "a DLL handle" } }
|
{ $values { "name" "a string" } { "dll" "a DLL handle" } }
|
||||||
{ $description "Loads a library by logical name and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } ". If the library is already loaded, returns the existing handle." }
|
{ $description "Loads a library by logical name and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } ". If the library is already loaded, returns the existing handle." } ;
|
||||||
{ $errors "Throws an error if the library could not be found, or if loading fails for some other reason." } ;
|
|
||||||
|
|
||||||
HELP: add-library
|
HELP: add-library
|
||||||
{ $values { "name" "a string" } { "path" "a string" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } }
|
{ $values { "name" "a string" } { "path" "a string" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } }
|
||||||
|
|
|
@ -57,7 +57,7 @@ TUPLE: library path abi dll ;
|
||||||
over dup [ dlopen ] when \ library construct-boa ;
|
over dup [ dlopen ] when \ library construct-boa ;
|
||||||
|
|
||||||
: load-library ( name -- dll )
|
: load-library ( name -- dll )
|
||||||
library library-dll ;
|
library dup [ library-dll ] when ;
|
||||||
|
|
||||||
: add-library ( name path abi -- )
|
: add-library ( name path abi -- )
|
||||||
<library> swap libraries get set-at ;
|
<library> swap libraries get set-at ;
|
||||||
|
|
Loading…
Reference in New Issue