Call a function in a shared library: Difference between revisions
Call a function in a shared library (view source)
Revision as of 11:55, 17 November 2023
, 6 months ago→{{header|Wren}}: Capitalize Wren & C file names.
(add RPL) |
m (→{{header|Wren}}: Capitalize Wren & C file names.) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 133:
dllclient.ahk
<syntaxhighlight lang="autohotkey">Msgbox, hello from client</syntaxhighlight>
=={{header|BaCon}}==▼
▲==={{header|BaCon}}===
<syntaxhighlight lang="qbasic">' Call a dynamic library function
PROTO j0
Line 149 ⟶ 150:
prompt$ ./calllib
0.765198</pre>
▲=={{header|BBC BASIC}}==
==={{header|BBC BASIC}}===
{{works with|BBC BASIC for Windows}}
The following shared libraries are automatically available: ADVAPI32.DLL, COMCTL32.DLL, COMDLG32.DLL, GDI32.DLL, KERNEL32.DLL, SHELL32.DLL, USER32.DLL and WINMM.DLL.
<syntaxhighlight lang="bbcbasic"> SYS "MessageBox", @hwnd%, "This is a test message", 0, 0
</syntaxhighlight>
=={{header|C}}==
{{works with|POSIX|.1-2001}}
Line 2,076 ⟶ 2,079:
{{trans|C}}
An embedded program so we can ask the C host to call the shared library function for us.
<syntaxhighlight lang="
var RTLD_LAZY = 1
Line 2,117 ⟶ 2,120:
<br>
Finally, we embed the Wren script in the following C program, compile and run it:
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 2,216 ⟶ 2,219:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
Line 2,238 ⟶ 2,241:
Same as C example depending on whether fakeimglib.so is present in the current directory or not.
</pre>
=={{header|X86-64 Assembly}}==
===UASM 2.52===
|