comparison dyncallback/dyncall_args.h @ 533:71c884e610f0

- integration of patches from Raphael Luba, Thekla, Inc.: * integration of aggregate-by-value (struct, union) support patch for x64 (win and sysv) * windows/x64 asm additions to specify how stack unwinds (help for debuggers, exception handling, etc.) * see Changelog for details - new calling convention modes for thiscalls (platform agnostic, was specific before) * new signature character for platform agnostic thiscalls ('*' / DC_SIGCHAR_CC_THISCALL) - dcCallF(), dcVCallF(), dcArgF() and dcVArgF(): * added support for aggregates-by-value (wasn't part of patch) * change that those functions don't implicitly call dcReset() anymore, which was unflexible (breaking change) - added macros to feature test implementation for aggregate-by-value and syscall support - changed libdyncall_s.lib and libdyncallback_s.lib order in callback test makefiles, as some toolchains are picky about order - doc: * man page updates to describe aggregate interface * manual overview changes to highlight platforms with aggregate-by-value support - test/plain: replaced tests w/ old/stale sctruct interface with new aggregate one
author Tassilo Philipp
date Thu, 21 Apr 2022 13:35:47 +0200
parents f5577f6bf97a
children 111236b31c75
comparison
equal deleted inserted replaced
532:d4bf63ab9164 533:71c884e610f0
4 Library: dyncallback 4 Library: dyncallback
5 File: dyncallback/dyncall_args.h 5 File: dyncallback/dyncall_args.h
6 Description: Callback's Arguments VM - Interface 6 Description: Callback's Arguments VM - Interface
7 License: 7 License:
8 8
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, 9 Copyright (c) 2007-2022 Daniel Adler <dadler@uni-goettingen.de>,
10 Tassilo Philipp <tphilipp@potion-studios.com> 10 Tassilo Philipp <tphilipp@potion-studios.com>
11 11
12 Permission to use, copy, modify, and distribute this software for any 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 13 purpose with or without fee is hereby granted, provided that the above
14 copyright notice and this permission notice appear in all copies. 14 copyright notice and this permission notice appear in all copies.
35 * 35 *
36 */ 36 */
37 37
38 #include "dyncall.h" 38 #include "dyncall.h"
39 39
40 #include "dyncall_value.h"
41
40 42
41 #ifdef __cplusplus 43 #ifdef __cplusplus
42 extern "C" { 44 extern "C" {
43 #endif 45 #endif
44 46
45 typedef struct DCArgs DCArgs; 47 typedef struct DCArgs DCArgs;
46 48
47 DC_API DCbool dcbArgBool (DCArgs*); 49 /* functions to retrieve callback's params in callback handler */
48 DC_API DCchar dcbArgChar (DCArgs*); 50 DC_API DCbool dcbArgBool (DCArgs* p);
49 DC_API DCshort dcbArgShort (DCArgs*); 51 DC_API DCchar dcbArgChar (DCArgs* p);
50 DC_API DCint dcbArgInt (DCArgs*); 52 DC_API DCshort dcbArgShort (DCArgs* p);
51 DC_API DClong dcbArgLong (DCArgs*); 53 DC_API DCint dcbArgInt (DCArgs* p);
52 DC_API DClonglong dcbArgLongLong (DCArgs*); 54 DC_API DClong dcbArgLong (DCArgs* p);
53 DC_API DCuchar dcbArgUChar (DCArgs*); 55 DC_API DClonglong dcbArgLongLong (DCArgs* p);
54 DC_API DCushort dcbArgUShort (DCArgs*); 56 DC_API DCuchar dcbArgUChar (DCArgs* p);
55 DC_API DCuint dcbArgUInt (DCArgs*); 57 DC_API DCushort dcbArgUShort (DCArgs* p);
56 DC_API DCulong dcbArgULong (DCArgs*); 58 DC_API DCuint dcbArgUInt (DCArgs* p);
57 DC_API DCulonglong dcbArgULongLong(DCArgs*); 59 DC_API DCulong dcbArgULong (DCArgs* p);
58 DC_API DCfloat dcbArgFloat (DCArgs*); 60 DC_API DCulonglong dcbArgULongLong(DCArgs* p);
59 DC_API DCdouble dcbArgDouble (DCArgs*); 61 DC_API DCfloat dcbArgFloat (DCArgs* p);
60 DC_API DCpointer dcbArgPointer (DCArgs*); 62 DC_API DCdouble dcbArgDouble (DCArgs* p);
63 DC_API DCpointer dcbArgPointer (DCArgs* p);
64 DC_API void dcbArgAggr (DCArgs* p, DCpointer target);
65
66 /* function helper to put a to be returned struct-by-value into the 'result'
67 param of the callback handler, in order to return it */
68 DC_API void dcbReturnAggr(DCArgs *args, DCValue *result, DCpointer ret);
61 69
62 #ifdef __cplusplus 70 #ifdef __cplusplus
63 } 71 }
64 #endif 72 #endif
65 73
66 #endif /* DYNCALL_ARGS_H */ 74 #endif /* DYNCALL_ARGS_H */
75