Mercurial > pub > dyncall > dyncall
annotate test/callback_suite/README.txt @ 508:1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
author | Tassilo Philipp |
---|---|
date | Sat, 09 Apr 2022 14:44:33 +0200 |
parents | 5a3c07a0f376 |
children | f3d44195dbdf |
rev | line source |
---|---|
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
1 Callback Test Suite |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
2 ------------------- |
0 | 3 |
4 | |
5 CONFIGURE SUITE | |
6 | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
7 needs lua: edit config.lua and run "make config". |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
8 |
0 | 9 |
10 DESCRIPTION | |
11 | |
12 Generates a set of callback invokers in C using lua as a preprocessor. | |
13 | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
14 The invokers pass arguments to the callback to test from a set of reference |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
15 values which are argument type- and position-specific. |
0 | 16 |
17 | |
18 The Callback Invocation Body | |
19 | |
20 Example: | |
21 The body for a signature of type "dpdf)p" at case id 19 is: | |
22 | |
23 void f19(void* addr) | |
24 { | |
25 Result.p = ((CONFIG_API p(*)(d,p,d,f))addr)(ValueMatrix[0].d,ValueMatrix[1].p,ValueMatrix[2].d,ValueMatrix[3].f); | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
26 } ^^^^^^^^^^- specific calling convention |
0 | 27 ^^^^^^^^^^^^^- signature |
28 ^- return type signature | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
29 ^- arg signature char 0 value (to be retrieved in handler) |
0 | 30 |
31 | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
32 Result (type DCValue) and ValueMatrix (type DCValueSet[MAXARGS], holding the |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
33 reference values) are globals, as well as an Args (type DCValue) array, which |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
34 is used by the callback handler to write the received argument values to. |
0 | 35 |
36 | |
37 Reference argument and result value | |
38 | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
39 The reference values are generated by get_reference_arg() and |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
40 get_reference_result(), which always return the exact same value for the a |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
41 given set of arguments. |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
42 ValueMatrix was filled by those functions and thus holds a temporary copy, |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
43 which is useful to test whether any input argument was modified (which should |
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
44 never be the case). |
0 | 45 |
46 | |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
47 Testing for exotic calling conventions on Windows |
0 | 48 |
49 Specify 'api' and 'ccprefix' accordingly: | |
50 | |
51 | |
495
45ac093ca822
- test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents:
0
diff
changeset
|
52 "__stdcall" "_s" |
45ac093ca822
- test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents:
0
diff
changeset
|
53 "__fastcall" "_f" for gcc compiler |
45ac093ca822
- test/callback_suite: make it use shared random sig generator from call_suite and call_suite_aggrs
Tassilo Philipp
parents:
0
diff
changeset
|
54 "_F" for microsoft compiler |
0 | 55 |
508
1aa2af848e8a
- callback_suite: updated readme to reflect changes and general cleanup
Tassilo Philipp
parents:
507
diff
changeset
|
56 See the dyncall documentation for other/more calling convention prefixes. |
0 | 57 |