annotate dyncallback/dyncall_args.h @ 663:127b569978cc default tip

- another tweak handling clang trying to be too smart (see last commit)
author Tassilo Philipp
date Sun, 24 Mar 2024 13:52:44 +0100
parents 111236b31c75
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
1 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
2
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
3 Package: dyncall
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
4 Library: dyncallback
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
5 File: dyncallback/dyncall_args.h
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
6 Description: Callback's Arguments VM - Interface
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
7 License:
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
10 Tassilo Philipp <tphilipp@potion-studios.com>
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
11
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
12 Permission to use, copy, modify, and distribute this software for any
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
13 purpose with or without fee is hereby granted, provided that the above
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
14 copyright notice and this permission notice appear in all copies.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
15
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
16 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
17 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
18 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
19 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
20 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
21 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
22 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
23
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
24 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
25
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
26
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
27 #ifndef DYNCALL_ARGS_H
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
28 #define DYNCALL_ARGS_H
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
29
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
30 /*
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
31 * dyncall args C API
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
32 *
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
33 * dyncall args provides serialized access to arguments of a function call.
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
34 * related concepts: callback
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
35 *
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
36 */
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
37
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
38 #include "dyncall.h"
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
42
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
43 #ifdef __cplusplus
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
44 extern "C" {
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
45 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
46
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
47 typedef struct DCArgs DCArgs;
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
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
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
72
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
73 #ifdef __cplusplus
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
74 }
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
75 #endif
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
76
3e629dc19168 initial from svn dyncall-1745
Daniel Adler
parents:
diff changeset
77 #endif /* DYNCALL_ARGS_H */
533
71c884e610f0 - integration of patches from Raphael Luba, Thekla, Inc.:
Tassilo Philipp
parents: 281
diff changeset
78