Mercurial > pub > dyncall > bindings
annotate lua/luadc/README.txt @ 46:c21d1c2c84e1
- removed pydc.py wrapper overhead (which only called pydcext.so functions, directly, anyways)
* implies renaming pydcext.* to pydc.*
* while at it, iterate directly over args that are passed in (before we did extract fptr, sig and a tuple for the args and iterated over latter afterwards); we might have a tiny perf improvement now
- added type stub as package_data
author | Tassilo Philipp |
---|---|
date | Fri, 13 Nov 2020 14:10:31 +0100 |
parents | 739c40f35a6a |
children |
rev | line source |
---|---|
0 | 1 lua bindings for dyncall |
2 ======================== | |
3 | |
4 1. loading the lua C extension | |
5 | |
6 require "package" | |
7 f = package.loadlib("luadc","luadc_open") | |
8 f() | |
9 | |
10 2. using the C extension | |
11 | |
12 libhandle = dc.load("libname") | |
13 f = dc.find(libhandle,"symbol") | |
14 | |
15 3. change calling convention mode | |
16 | |
17 dc.mode(mode) | |
18 | |
19 mode is dc.C_DEFAULT, dc.C_X86_WIN32_STD, dc.C_X86_WIN32_FAST, ... | |
20 | |
21 4. make a call | |
22 | |
23 dc.call(f, signature, args... ) | |
24 |