Call a function in a shared library: Difference between revisions
Content added Content deleted
(Added Maple implementation) |
(→{{header|Perl 6}}: add entry) |
||
Line 376: | Line 376: | ||
=={{header|Pascal}}== |
=={{header|Pascal}}== |
||
See [[Call_a_function_in_a_shared_library#Delphi | Delphi]] |
See [[Call_a_function_in_a_shared_library#Delphi | Delphi]] |
||
=={{header|Perl 6}}== |
|||
{{works with|Rakudo Star|2013-01}} |
|||
<lang perl6>use NativeCall; |
|||
constant libX11 = '/usr/lib/x86_64-linux-gnu/libX11.so.6'; |
|||
sub XOpenDisplay(Str $s --> Int) is native(libX11) {*} |
|||
sub XCloseDisplay(Int $i --> Int) is native(libX11) {*} |
|||
if try my $d = XOpenDisplay ":0.0" { |
|||
say "ID = $d"; |
|||
XCloseDisplay($d); |
|||
} |
|||
else { |
|||
say "No library {libX11}!"; |
|||
say "Use this window instead --> ⬜"; |
|||
}</lang> |
|||
{{out}} |
|||
<pre>ID = 124842864</pre> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |