Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
e95b6b5e
Commit
e95b6b5e
authored
Jul 01, 2014
by
Paul Sokolovsky
Browse files
modffi: Add special 'C' code for passing a callback function pointer.
parent
4039a266
Changes
1
Hide whitespace changes
Inline
Side-by-side
unix/modffi.c
View file @
e95b6b5e
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment