Uwe Hermann [Sat, 8 Jan 2011 16:00:18 +0000 (17:00 +0100)]
Fix compile for Python >= 3.0.
Python docs tells us more about string functions:
"These functions have been renamed to PyBytes_* in Python 3.x. Unless
otherwise noted, the PyBytes functions available in 3.x are aliased to
their PyString_* equivalents to help porting."
(http://docs.python.org/c-api/string.html)
Use #defines to map the new names and fix the compile for Python >= 3.0.
Uwe Hermann [Fri, 23 Apr 2010 23:04:20 +0000 (01:04 +0200)]
Various Python decoder infrastructure improvements.
- Introduce 'struct sigrokdecode_decoder'.
- Decoders are now handled via two C functions:
- sigrokdecode_load_decoder(): Fills a 'struct sigrokdecode_decoder'.
- sigrokdecode_run_decoder(): Runs a decoder function.
- There are now two decoder API functions a script needs to implement:
- register(): Returns a Python dict with certain metadata.
- decode(): Runs the actual decoder code.
- libsigrokdecode: Add and use some more #defines for errors:
- SIGROKDECODE_ERR_ARGS
- SIGROKDECODE_ERR_PYTHON
- Various other smaller Python decode script infrastructure issues.