Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kanzure/ctypesgen
A pure-python wrapper generator for ctypes
https://github.com/kanzure/ctypesgen
Last synced: 9 days ago
JSON representation
A pure-python wrapper generator for ctypes
- Host: GitHub
- URL: https://github.com/kanzure/ctypesgen
- Owner: kanzure
- License: bsd-3-clause
- Created: 2013-09-18T02:54:17.000Z (over 11 years ago)
- Default Branch: develop
- Last Pushed: 2016-06-03T11:38:49.000Z (over 8 years ago)
- Last Synced: 2025-01-11T15:56:06.628Z (13 days ago)
- Language: Python
- Size: 407 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
ctypesgen
---------(c) Ctypesgen developers 2007-2015
https://github.com/davidjamesca/ctypesgenctypesgen is a pure-python ctypes wrapper generator. It can also
output JSON, which can be used with Mork, which generates bindings for
Lua, using the alien module (which binds libffi to Lua).Documentation
-------------See https://github.com/davidjamesca/ctypesgen/wiki for full documentation.
Basic Usage
-----------This project automatically generates ctypes wrappers for header files written
in C.For example, if you'd like to generate Neon bindings, you can do so using this
recipe:$ python ctypesgen.py -lneon /usr/local/include/neon/ne_*.h -o neon.py
Some libraries, such as APR, need special flags to compile. You can pass these
flags in on the command line.For example:
$ FLAGS = `apr-1-config --cppflags --includes`
$ python ctypesgen.py $FLAGS -llibapr-1.so $HOME/include/apr-1/apr*.h -o apr.pySometimes, libraries will depend on each other. You can specify these
dependencies using -mmodule, where module is the name of the dependency module.Here's an example for apr_util:
$ python ctypesgen.py $FLAGS -llibaprutil-1.so $HOME/include/apr-1/ap[ru]*.h \
-mapr -o apr_util.pyIf you want JSON output (e.g. for generating Lua bindings), use
--output-language=json. When outputting JSON, you will probably want to use
--all-headers --builtin-symbols --no-stddef-types --no-gnu-types
--no-python-types too.License
-------ctypesgen is distributed under the New (2-clause) BSD License:
http://www.opensource.org/licenses/bsd-license.phplibffi is a portable Foreign Function Interface library:
http://sources.redhat.com/libffi/Mork, the friendly alien, can be found at:
https://github.com/rrthomas/mork