Giter Site home page Giter Site logo

ctypesgen-1's Introduction

                              ctypesgen
                              ---------

                  (c) Ctypesgen developers 2007-2019
                 https://github.com/davidjamesca/ctypesgen

ctypesgen 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.py

Sometimes, 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.py


If 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.php

libffi 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

ctypesgen-1's People

Contributors

olsonse avatar kanzure avatar alan-r avatar davidjamesca avatar pombredanne avatar greenbender avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.