From e95b6b5e0761d8fa40cc31d62888e503812db72a Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Tue, 1 Jul 2014 01:57:08 +0300
Subject: [PATCH] modffi: Add special 'C' code for passing a callback function
 pointer.

---
 unix/modffi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/unix/modffi.c b/unix/modffi.c
index 48666aef0..eca3f9131 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;
-- 
GitLab