ctypesgen.py man page

ctypesgen.py — Automatically generate ctypes wrappers for C header files

Synopsis

Usage: ctypesgen.py [options] /path/to/header.h ...

Options

-h, --help
show this help message and exit
-o FILE, --output=FILE
write wrapper to FILE [default stdout]
-l LIBRARY, --library=LIBRARY
link to LIBRARY
--include=HEADER
include system header HEADER (e.g. stdio.h or stdlib.h)
-m MODULE, --module=MODULE, --link-module=MODULE
use symbols from Python module MODULE
-I INCLUDEDIR, --includedir=INCLUDEDIR
add INCLUDEDIR as a directory to search for headers
-W l,OPTION
where OPTION is -L, -R, or --rpath
-L LIBDIR, -R LIBDIR, --rpath=LIBDIR, --libdir=LIBDIR
Add LIBDIR to the search path (both compile-time and run-time)
--compile-libdir=LIBDIR
Add LIBDIR to the compile-time library search path.
--runtime-libdir=LIBDIR
Add LIBDIR to the run-time library search path.
--cpp=CPP
The command to invoke the c preprocessor, including any necessary options (default: gcc -E)
--save-preprocessed-headers=FILENAME
Save the preprocessed headers to the specified FILENAME
-a, --all-headers
include symbols from all headers, including system headers
--builtin-symbols
include symbols automatically generated by the preprocessor
--no-macros
Don't output macros.
-i INCLUDE_SYMBOLS, --include-symbols=INCLUDE_SYMBOLS
regular expression for symbols to always include
-x EXCLUDE_SYMBOLS, --exclude-symbols=EXCLUDE_SYMBOLS
regular expression for symbols to exclude
--no-stddef-types
Do not support extra C types from stddef.h
--no-gnu-types
Do not support extra GNU C types
--no-python-types
Do not support extra C types built in to Python
--header-template=TEMPLATE
Use TEMPLATE as the header template in the output file.
--strip-build-path=BUILD_PATH
Strip build path from header paths in the wrapper file.
--insert-file=FILENAME
Add the contents of FILENAME to the end of the wrapper file.
--output-language=LANGUAGE
Choose output language (`json' or `python' [default])
--all-errors
Display all warnings and errors even if they would not affect output.
--show-long-errors
Display long error messages instead of abbreviating error messages.
--no-macro-warnings
Do not print macro warnings.

Info

June 2013 ctypesgen.py r147 User Commands