annotate lua/luadc/test.lua @ 28:edbbd467f50a

python binding: - update to dyncall 1.1 - Python 3 support (supports both, Python 2 and 3) - using the Capsule API over PyCObject, when available - support for python unicode strings (for both, Python 2 and 3) - doc cleanup ruby binding: - doc cleanup
author Tassilo Philipp
date Tue, 07 Apr 2020 21:16:37 +0200
parents 0cfcc391201f
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 require "package"
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2 pf = package.loadlib("luadc","luadc_open")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 pf()
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 print(dc.C_DEFAULT)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 print(dc.C_X86_WIN32_STD)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
8 dc.mode(dc.C_DEFAULT)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
9
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 clib = dc.load("msvcrt")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11 f = dc.find(clib,"sqrt")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 x = dc.call(f,"d)d",144)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 print(x)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 dc.mode(dc.C_X86_WIN32_STD)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 user32 = dc.load("user32")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 f = dc.find(user32,"MessageBoxA")
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 x = dc.call(f,"iSSi)v", 0, "Hello", "World", 0)
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21
0cfcc391201f initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22