summaryrefslogtreecommitdiff
path: root/examples/unix/ffi_example.py
AgeCommit message (Collapse)Author
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2018-10-23examples/unix/ffi_example: Clean up and update the ffi example.Paul Sokolovsky
1. Use uctypes.bytearray_at(). Implementation of the "ffi" module predates that of "uctypes", so initially some convenience functions to access memory were added to ffi. Later, they landed in uctypes (which follows CPython's ctype module). So, replace undocumented experimental functions from ffi to documented ones from uctypes. 2. Use more suitable type codes for arguments (e.g. "P" (const void*) instead of "p" (void*). 3. Some better var naming. 4. Clarify some messages printed by the example.
2016-06-17examples/unix/ffi_example.py: Remove TODO, make output more clear.Paul Sokolovsky
2016-06-17examples/unix/ffi_example.py: Update for current "ffi" module API.Paul Sokolovsky
2014-02-14ffi: Implement ffivar.get()/set() methods.Paul Sokolovsky
Done by introducing another factored out helper API in binary.c. This API can be reused also by array and struct modules.
2014-01-29Add FFI module example.Paul Sokolovsky