annotate lua/luadc/README.txt @ 60:8e905c0798c7

- p2Z() helper func - import fix for test code avoiding potential circular import
author Tassilo Philipp
date Wed, 03 Aug 2022 15:38:07 +0200
parents 739c40f35a6a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 lua bindings for dyncall
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 ========================
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 1. loading the lua C extension
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 require "package"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 f = package.loadlib("luadc","luadc_open")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 f()
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 2. using the C extension
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 libhandle = dc.load("libname")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 f = dc.find(libhandle,"symbol")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15 3. change calling convention mode
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 dc.mode(mode)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 mode is dc.C_DEFAULT, dc.C_X86_WIN32_STD, dc.C_X86_WIN32_FAST, ...
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 4. make a call
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23 dc.call(f, signature, args... )
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24