Mercurial > pub > dyncall > bindings
comparison lua/luadyncall/src/dyntype.c @ 0:0cfcc391201f
initial from svn dyncall-1745
author | Daniel Adler |
---|---|
date | Thu, 19 Mar 2015 22:26:28 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:0cfcc391201f |
---|---|
1 #include "dyncall.h" | |
2 #include "dyncall_signature.h" | |
3 | |
4 size_t dtSize(const char* signature) | |
5 { | |
6 char ch = *signature; | |
7 switch(ch) | |
8 { | |
9 case DC_SIGCHAR_BOOL: return sizeof(DCbool); | |
10 case DC_SIGCHAR_CHAR: return sizeof(DCchar); | |
11 case DC_SIGCHAR_UCHAR: return sizeof(DCuchar); | |
12 case DC_SIGCHAR_SHORT: return sizeof(DCshort); | |
13 case DC_SIGCHAR_USHORT: return sizeof(DCushort); | |
14 case DC_SIGCHAR_INT: return sizeof(DCint); | |
15 case DC_SIGCHAR_UINT: return sizeof(DCuint); | |
16 case DC_SIGCHAR_LONG: return sizeof(DClong); | |
17 case DC_SIGCHAR_ULONG: return sizeof(DCulong); | |
18 case DC_SIGCHAR_LONGLONG: return sizeof(DClonglong); | |
19 case DC_SIGCHAR_ULONGLONG: return sizeof(DCulonglong); | |
20 case DC_SIGCHAR_FLOAT: return sizeof(DCfloat); | |
21 case DC_SIGCHAR_DOUBLE: return sizeof(DCdouble); | |
22 case DC_SIGCHAR_POINTER: return sizeof(DCpointer); | |
23 case DC_SIGCHAR_STRING: return sizeof(DCstring); | |
24 case DC_SIGCHAR_VOID: return sizeof(DCvoid); | |
25 default: return 0; | |
26 } | |
27 } | |
28 | |
29 size_t dtAlign(const char* signature) | |
30 { | |
31 return dtSize(signature); | |
32 } | |
33 | |
34 |