Mercurial > pub > dyncall > dyncall
comparison dyncall/dyncall_api.c @ 362:78dfa2f9783a
- added helper function dcGetModeFromCCSigChar() mapping callconv sig chars to respective mode
- added a signature-based syscall to callf testcode
- manual clarification about dcReset usage in combination with dcMode
author | Tassilo Philipp |
---|---|
date | Tue, 14 Apr 2020 16:56:57 +0200 |
parents | f5577f6bf97a |
children | 2fb084f98439 |
comparison
equal
deleted
inserted
replaced
361:06c9adae114d | 362:78dfa2f9783a |
---|---|
4 Library: dyncall | 4 Library: dyncall |
5 File: dyncall/dyncall_api.c | 5 File: dyncall/dyncall_api.c |
6 Description: C interface to call vm | 6 Description: C interface to call vm |
7 License: | 7 License: |
8 | 8 |
9 Copyright (c) 2007-2018 Daniel Adler <dadler@uni-goettingen.de>, | 9 Copyright (c) 2007-2020 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. |
25 | 25 |
26 | 26 |
27 | 27 |
28 #include "dyncall.h" | 28 #include "dyncall.h" |
29 #include "dyncall_callvm.h" | 29 #include "dyncall_callvm.h" |
30 #include "dyncall_alloc.h" | |
31 | 30 |
32 void dcReset(DCCallVM* vm) | 31 void dcReset(DCCallVM* vm) |
33 { | 32 { |
34 vm->mVTpointer->reset(vm); | 33 vm->mVTpointer->reset(vm); |
35 } | 34 } |
155 DCint dcGetError(DCCallVM *vm) | 154 DCint dcGetError(DCCallVM *vm) |
156 { | 155 { |
157 return vm->mError; | 156 return vm->mError; |
158 } | 157 } |
159 | 158 |
160 /*@@@ not used, (re)introduce or cleanup | 159 DCint dcGetModeFromCCSigChar(DCsigchar sig_char) |
161 const char* dcGetErrorString(int mode) | |
162 { | 160 { |
163 switch(mode) { | 161 switch(sig_char) |
164 case DC_ERROR_NONE: return "none"; | 162 { |
165 case DC_ERROR_UNSUPPORTED_MODE: return "unsupported mode"; | 163 case DC_SIGCHAR_CC_DEFAULT: return DC_CALL_C_DEFAULT; |
166 default: return "(unknown mode id)"; | 164 case DC_SIGCHAR_CC_ELLIPSIS: return DC_CALL_C_ELLIPSIS; |
165 case DC_SIGCHAR_CC_ELLIPSIS_VARARGS: return DC_CALL_C_ELLIPSIS_VARARGS; | |
166 case DC_SIGCHAR_CC_CDECL: return DC_CALL_C_X86_CDECL; | |
167 case DC_SIGCHAR_CC_STDCALL: return DC_CALL_C_X86_WIN32_STD; | |
168 case DC_SIGCHAR_CC_FASTCALL_MS: return DC_CALL_C_X86_WIN32_FAST_MS; | |
169 case DC_SIGCHAR_CC_FASTCALL_GNU: return DC_CALL_C_X86_WIN32_FAST_GNU; | |
170 case DC_SIGCHAR_CC_THISCALL_MS: return DC_CALL_C_X86_WIN32_THIS_MS; | |
171 case DC_SIGCHAR_CC_THISCALL_GNU: return DC_CALL_C_X86_WIN32_THIS_GNU; | |
172 case DC_SIGCHAR_CC_ARM_ARM: return DC_CALL_C_ARM_ARM; | |
173 case DC_SIGCHAR_CC_ARM_THUMB: return DC_CALL_C_ARM_THUMB; | |
174 case DC_SIGCHAR_CC_SYSCALL: return DC_CALL_SYS_DEFAULT; | |
167 } | 175 } |
176 return DC_ERROR_UNSUPPORTED_MODE; | |
168 } | 177 } |
169 */ | |
170 | 178 |