summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-01 01:57:08 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-07-01 02:05:34 +0300
commite95b6b5e0761d8fa40cc31d62888e503812db72a (patch)
treef4b9aeb75b51c700e7a2f82678f6deb46cc263d9
parent4039a266793f8bb3af24482b3d08b2dcef51e268 (diff)
downloadmicropython-e95b6b5e0761d8fa40cc31d62888e503812db72a.tar.gz
micropython-e95b6b5e0761d8fa40cc31d62888e503812db72a.zip
modffi: Add special 'C' code for passing a callback function pointer.
-rw-r--r--unix/modffi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/unix/modffi.c b/unix/modffi.c
index 48666aef0b..eca3f9131b 100644
--- a/unix/modffi.c
+++ b/unix/modffi.c
@@ -51,6 +51,10 @@
* s - as argument, the same as "p", as return value, causes string
* to be allocated and returned, instead of pointer value.
*
+ * TODO:
+ * O - mp_obj_t, passed as is (mostly useful as callback param)
+ * C - callback function
+ *
* Note: all constraint specified by typecode can be not enforced at this time,
* but may be later.
*/
@@ -108,6 +112,7 @@ STATIC ffi_type *char2ffi_type(char c)
case 'L': return &ffi_type_ulong;
case 'f': return &ffi_type_float;
case 'd': return &ffi_type_double;
+ case 'C': // (*)()
case 'P': // const void*
case 'p': // void*
case 's': return &ffi_type_pointer;