Mercurial > pub > dyncall > dyncall
annotate dyncallback/dyncall_args.h @ 553:a93bb23fca8c
win build fix
author | Tassilo Philipp |
---|---|
date | Mon, 20 Jun 2022 15:25:01 +0200 |
parents | 111236b31c75 |
children |
rev | line source |
---|---|
0 | 1 /* |
2 | |
3 Package: dyncall | |
4 Library: dyncallback | |
5 File: dyncallback/dyncall_args.h | |
6 Description: Callback's Arguments VM - Interface | |
7 License: | |
8 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>, |
0 | 10 Tassilo Philipp <tphilipp@potion-studios.com> |
11 | |
12 Permission to use, copy, modify, and distribute this software for any | |
13 purpose with or without fee is hereby granted, provided that the above | |
14 copyright notice and this permission notice appear in all copies. | |
15 | |
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
23 | |
24 */ | |
25 | |
26 | |
27 #ifndef DYNCALL_ARGS_H | |
28 #define DYNCALL_ARGS_H | |
29 | |
30 /* | |
31 * dyncall args C API | |
32 * | |
33 * dyncall args provides serialized access to arguments of a function call. | |
34 * related concepts: callback | |
35 * | |
36 */ | |
37 | |
38 #include "dyncall.h" | |
39 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
40 #include "dyncall_value.h" |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
41 |
0 | 42 |
43 #ifdef __cplusplus | |
44 extern "C" { | |
45 #endif | |
46 | |
47 typedef struct DCArgs DCArgs; | |
48 | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
49 /* functions to retrieve callback's params in callback handler */ |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
50 DC_API DCbool dcbArgBool (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
51 DC_API DCchar dcbArgChar (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
52 DC_API DCshort dcbArgShort (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
53 DC_API DCint dcbArgInt (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
54 DC_API DClong dcbArgLong (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
55 DC_API DClonglong dcbArgLongLong (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
56 DC_API DCuchar dcbArgUChar (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
57 DC_API DCushort dcbArgUShort (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
58 DC_API DCuint dcbArgUInt (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
59 DC_API DCulong dcbArgULong (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
60 DC_API DCulonglong dcbArgULongLong(DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
61 DC_API DCfloat dcbArgFloat (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
62 DC_API DCdouble dcbArgDouble (DCArgs* p); |
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
63 DC_API DCpointer dcbArgPointer (DCArgs* p); |
544
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
64 /* for trivial aggrs: 'target' points to space to copy aggr to, returns 'target' |
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
65 for C++ non-trivial aggrs: target is ignored, returns ptr to aggr arg */ |
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
66 DC_API DCpointer dcbArgAggr (DCArgs* p, DCpointer target); |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
67 |
544
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
68 /* helper func to put a to be returned struct-by-value into the 'result' |
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
69 param of the callback handler; for C++ non-trivial aggrs, pass NULL in |
111236b31c75
- C++ non-trivial aggregate-by-value handling:
Tassilo Philipp
parents:
533
diff
changeset
|
70 'ret', then copy aggr into result->p */ |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
71 DC_API void dcbReturnAggr(DCArgs *args, DCValue *result, DCpointer ret); |
0 | 72 |
73 #ifdef __cplusplus | |
74 } | |
75 #endif | |
76 | |
77 #endif /* DYNCALL_ARGS_H */ | |
533
71c884e610f0
- integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents:
281
diff
changeset
|
78 |