0
|
1 Callback Test Suite 2
|
|
2 ---------------------
|
|
3
|
|
4 REQUIREMENTS
|
|
5 - dyncall
|
|
6 - ANSI C compiler
|
|
7 - lua (tested with 5.1)
|
|
8
|
|
9 CONFIGURE SUITE
|
|
10
|
|
11 edit config.lua and run "make config".
|
|
12
|
|
13 DESCRIPTION
|
|
14
|
|
15 Generates a set of callback invokers in C using lua as a preprocessor.
|
|
16 The invokers put up an argument vector using a global Value-Matrix which
|
|
17 holds a specific type-specific value pattern as a function of position.
|
|
18
|
|
19 The Value-Matrix
|
|
20
|
|
21 The value-matrix is a data structure consisting of n x m elements of
|
|
22 type DCValueSet which can store distinct numbers for each type.
|
|
23
|
|
24 It is used in the body of the auto-generated callback invokers (C code).
|
|
25
|
|
26 The Callback Invocation Body
|
|
27
|
|
28 Example:
|
|
29 The body for a signature of type "dpdf)p" at case id 19 is:
|
|
30
|
|
31 void f19(void* addr)
|
|
32 {
|
|
33 Result.p = ((CONFIG_API p(*)(d,p,d,f))addr)(ValueMatrix[0].d,ValueMatrix[1].p,ValueMatrix[2].d,ValueMatrix[3].f);
|
|
34 } ^^^^^^^^^^- calling convention
|
|
35 ^^^^^^^^^^^^^- signature
|
|
36 ^- return type signature
|
|
37 ^- arg signature char 0 (later expected) value
|
|
38
|
|
39
|
|
40 Result (type DCValue) and ValueMatrix (type DCValueSet[MAXARGS]) are globals.
|
|
41 The ValueMatrix is initialized once from main.c for all cominations of types
|
|
42 and argument position.
|
|
43 See env.* files for details.
|
|
44
|
|
45
|
|
46 Reference argument and result value
|
|
47
|
|
48 The value is generated by a pure function GetReferenceValue and
|
|
49 GetReferenceResult (file env.c). They have formals position and type
|
|
50 and are pure without any side-effects (means the function value does only
|
|
51 relay on the input arguments - if called with same arguments it will reveal
|
|
52 the same value.
|
|
53
|
|
54 It defined in env.c.
|
|
55
|
|
56 Tssting for exotic calling conventions on Windows:
|
|
57
|
|
58 Specify 'api' and 'ccprefix' accordingly:
|
|
59
|
|
60
|
|
61 "__stdcall" "_s"
|
|
62 "__fastcall" "_f" for gcc compiler
|
|
63 "_F" for microsoft compiler
|
|
64
|
|
65
|
|
66
|