summaryrefslogtreecommitdiff
path: root/cffi/api.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #437Armin Rigo2020-01-051-5/+9
| | | | Support ffi.dlopen(<void* cdata>). See updated documentation.
* Backport 4d18a461a973 from pypyArmin Rigo2019-01-311-1/+1
|
* Change the API and document it.Armin Rigo2019-01-311-6/+10
|
* Tweaks to the pkgconfig supportArmin Rigo2019-01-311-3/+5
|
* Exception based flowMichal Vyskocil2019-01-091-4/+1
| | | | | | | | | | | | | | | | | | | | | | Now the with non pkg-config backup would be ``` module_name = "_czmq" source = "#include <czmq.h>" try: print(f"### pkg-config path") ffibuilder.set_source( module_name, source, pkgconfig=["libczmq"] ) except Exception as e: print(f"Exception e: {e}") ffibuilder.set_source( module_name, source, libraries=["czmq"] ) ```
* Real test of a pkgconfig integrationMichal Vyskocil2019-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix encoding errors Given testing Python program ``` from cffi import FFI ffibuilder = FFI() ffibuilder.cdef( "char* zsys_hostname();" ) ffibuilder.set_source( "_czmq", "#include <czmq.h>", pkgconfig=["libczmq"] ) if __name__ == "__main__": ffibuilder.compile(verbose=True) ``` We can run ffibuilder from source dir of czmq ``` PKG_CONFIG_PATH=`pwd`/src python3 t.py generating ./_czmq.c ... gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/local/lib64 -L/usr/lib64 -lczmq -lzmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so ``` ``` python3 t.py generating ./_czmq.c ... gcc -pthread -shared -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none ./_czmq.o -L/usr/lib64 -lczmq -lpython3.6m -o ./_czmq.cpython-36m-x86_64-linux-gnu.so ``` Note that in the first case `/usr/local` has been added to the compiler path as provided by local pkg-config file.
* merge with latest tipMichal Vyskocil2019-01-081-0/+7
|\
| * Increase testing coverage and refactor method namesMichal Vyskocil2019-01-081-12/+7
| | | | | | | | | | | | Making `pkgconfig.call` function accessible, tests can monkey patch it and provide mock. This improves testing, however raised a need to give functions better names than `pkgconfig.pkgconfig_kwargs` or `pkgconfig.pc`.
| * drop debug printMichal Vyskocil2017-05-251-1/+0
| |
| * Passing of proper CFLAGS/CXXFLAGS/LDFLAGS is hard and error proneMichal Vyskocil2017-05-221-0/+13
| | | | | | | | Add pkg-config wrapper, which is the cross-platform tool telling exactly this.
* | Implement ffi.from_buffer("foo[]", x)Armin Rigo2019-01-071-3/+12
| | | | | | | | | | Also contains some improvements to the documentation about other recent additions
* | ffi.release()Armin Rigo2019-01-051-0/+3
| |
* | Issue #394Armin Rigo2018-12-161-2/+3
| | | | | | | | Implement ffi.from_buffer(x, require_writable=True)
* | Issue 364Armin Rigo2018-06-161-4/+7
| | | | | | | | Add support for MSVC's "#pragma pack(n)" in ABI mode
* | Implement ffi.dlclose() for the in-line caseArmin Rigo2018-02-161-0/+10
| |
* | Add an optional 'size' argument to ffi.gc(). So far, it has no effectArmin Rigo2017-08-021-2/+7
| | | | | | | | on CPython.
* | Some test fixes for Python 3 on WindowsArmin Rigo2017-06-191-1/+4
| |
* | Issue #319Armin Rigo2017-06-151-1/+2
|/ | | | | | | | | Fix a race condition: we can't stick an attribute to ffi._backend, because another thread might be in the middle of ``for name in ffi._backend.__dict__``. To minimize damage if I reintroduce an attribute-adding function in the future, also tweak the ``for``.
* pypy-c => pypy3-cArmin Rigo2017-03-111-1/+4
|
* Improve the error messageArmin Rigo2017-03-101-10/+16
|
* ffi.addressof(lib, "name") now also works in in-line modeArmin Rigo2017-02-071-5/+35
|
* Make 'ffi.buffer' be the type of minibuffers returned by cffi, andArmin Rigo2017-02-041-12/+13
| | | | 'ffi.buffer()' now calls the constructor.
* complain clearly if set_source() is given a /-separated nameArmin Rigo2017-01-261-0/+4
|
* Move back "import cparser" to FFI.__init__, because that module onlyArmin Rigo2017-01-201-1/+2
| | | | needs to be imported if we instantiate FFI (admittedly, very often)
* Avoid cyclic imports by moving exceptions to a separate moduleRonan Lamy2017-01-201-17/+4
|
* Improve the error in case of version mismatchArmin Rigo2016-12-251-2/+11
|
* Backed out changeset 0087e2aec9efArmin Rigo2016-09-031-12/+18
| | | | Un-kill the ctypes backend. Issue #282 for a justification.
* - add ffi.compile(debug=flag)Armin Rigo2016-09-031-2/+2
| | | | | - this small addition, and a few others not in pypy 5.4, will make the next cffi release v1.8.1
* Kill the ctypes backend.Armin Rigo2016-09-031-18/+12
|
* Fix docstringsArmin Rigo2016-06-031-2/+2
|
* Implement backend.gcp() for the ctypes backend, and remove gc_weakref.Amaury Forgeot d'Arc2016-04-231-14/+1
|
* There is no reason to restrict ffi.unpack() to primitives.Armin Rigo2016-04-171-4/+6
|
* Remove again ffi.rawstring(), and implement instead ffi.unpack().Armin Rigo2016-04-161-10/+13
| | | | | | | | | | | | | Pre-documentation notes: (hi Amaury :-) * ffi.unpack(<cdata 'char'>, n) == ffi.buffer(<cdata 'char'>, n)[:] but I hope it is a little bit more natural * ffi.unpack(<cdata 'wchar_t'>, n): this is the original motivation, because it has no previous equivalent * ffi.unpack(<cdata 'int'>, n) == list(<cdata 'int'>[0:n]) but should be much faster on CPython
* ffi.rawstring(), with a minimal interfaceArmin Rigo2016-04-151-0/+12
|
* Change the API of ffi.list_types()Armin Rigo2016-03-301-7/+6
|
* ffi.list_types()Armin Rigo2016-03-271-0/+21
|
* more pypy tweaksArmin Rigo2016-02-191-2/+7
|
* pypy on windows now stores "python27.lib" in a directory "libs"Armin Rigo2016-02-151-6/+4
|
* Fix for Python 2.6Armin Rigo2016-02-131-1/+5
|
* Mention it's work in progressArmin Rigo2016-02-131-2/+4
|
* Windows need the file 'libpypy-c.lib', which (unless people disagree) IArmin Rigo2016-02-111-4/+13
| | | | will add to pypy distributions next
* I finally managed to run the tests on Windows, but only withoutArmin Rigo2016-02-111-14/+13
| | | | | changes in that file and by copying the file "libpypy-c.lib" from translation to a subdirectory "bin" of "sys.prefix"
* allow embedding tests to run on pypy win32mattip2016-01-301-13/+14
|
* issue #243: explicitly complain if ffi.def_extern() is called on theArmin Rigo2016-01-191-0/+4
| | | | Python-side FFI object
* Windows uses '_d' even though I'm pretty sure DEBUG_EXT is a Debian-onlyArmin Rigo2016-01-171-2/+4
| | | | extension
* Don't hardcode _d. If that is the extension, it'll be in sysconfigStefano Rivera2016-01-171-5/+3
|
* Support extensions for pydebug cpythonsStefano Rivera2016-01-171-0/+2
|
* OS/X: in-progress, one test now passesArmin Rigo2016-01-161-1/+1
|
* win32: needs /MANIFESTArmin Rigo2016-01-161-7/+9
|
* fixes for pypyArmin Rigo2016-01-151-2/+8
|