annotate lua/luadc/README.txt @ 27:18e1f1bb1945

- 1.1 update
author Tassilo Philipp
date Sun, 12 Jan 2020 12:10:38 +0100
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