Questions tagged [cffi]

CFFI, the Common Foreign Function Interface, for Common Lisp. For Python CFFI, see the [python-cffi] tag.

CFFI, the Common Foreign Function Interface, purports to be a portable foreign function interface for Common Lisp.

Check out Homepage

142 questions
0
votes
1 answer

Path cannot contain slash

I'm trying to make unit testing in C using Python and CFFI module. It's pretty much working, but I can't use it into a sub directory. While testing, my project looks like : $ tree tests tests/ ├── sum.c ├── sum.h ├── tests_units.py ... $ python3…
Pyrrha
  • 159
  • 2
  • 12
0
votes
1 answer

setuptools and cffi: how to change the library path

i am creating a python program with cffi to test my C/ASM library against the real libc functions. i try to use setuptools to setup my different cffi modules. so here is my filetree: here is my libftasm_builder.py: from cffi import FFI ffiBuilder…
Stephane
  • 153
  • 1
  • 10
0
votes
1 answer

Calling a fortran dll from python using cffi

I am currently working on a simultion-tool that requires a PDE Solver from a Fortran dll. In order to figure how calling a dll from python I used a simpler function from the same dll but can't get it to work. Systemspecs: Windows 7 Professional…
ThlHckmnn
  • 5
  • 4
0
votes
0 answers

Python flush ouput is not working with cffi library

I have a weird behaviour using a Python application, (running under supervisor), that relies on a C library to initialize a component. My problem is that i cannot see the output printed by this C library when i call a function there. All the output…
Wenzel
  • 147
  • 1
  • 14
0
votes
1 answer

Comparing C pointers in Python

I am looking for an easier way to compare the data at two C-pointers in python. The method I have working now: import cffi ffi = cffi.FFI() def ref_char_p(char_p): arr = [] null_term = 0; while(char_p[null_term] != 0): …
Jlegend
  • 531
  • 1
  • 6
  • 19
0
votes
1 answer

Receiving CFFI missing while install Google Assistant SDK Samples

I am trying to add voice recognition to my Raspberry Pi 3B using this guide. I have made it to this part until the command below through ssh and getting some kind of CFFI missing error. I have repeated the above webpage replacing python with python3…
0
votes
0 answers

Variable not found in library when importing with CFFI

I am trying to load the following .h file: 3 typedef struct { 4 uint8_t clock_pin; 5 } pinout; 6 7 pinout foo = {.clock_pin = 5}; 8 pinout bar = {.clock_pin = 4}; Using the following python file: 1 from pathlib import Path 2 import cffi 3 4…
user2886057
  • 646
  • 1
  • 5
  • 15
0
votes
1 answer

Memory leaks in PyQt w/ QImage in a loop

I'm working on a Python application right now that uses PyQt5 and CFFI bindings to libgphoto2. I have this section of code that will poll the camera every 1/60 of a second to get a preview image and then schedule to draw it on the screen. def…
Benjamin
  • 1,223
  • 1
  • 13
  • 22
0
votes
1 answer

Passing byte array data from C++ to Haxe

We are trying to pass a raw data from C++ to Haxe, but we had a lot of trebles. We tried this solution http://community.openfl.org/t/passing-bytes-from-c-to-haxe/8046/2 but was not working for us. C++ void Clazz::func(unsigned char *data, int…
HocineHamdi
  • 191
  • 6
0
votes
2 answers

Creating cdata of type `REAL (* vertices)[DIM]` in CFFI

I'm trying to build a python interface around some existing C code with CFFI. As usual with C code trimmed for performance, it is fraught with extensive macros and typedefs. ATM I am working on replicating following struct #define DIM 3 typedef…
PeterE
  • 5,715
  • 5
  • 29
  • 51
0
votes
0 answers

how to get C type definition string from ctypes object?

I want a generic function that can cast a ctypes object to a cffi object. It might looks like below def ctypestocffi(ctypes_obj): return ffi.cast(get_type_definition(ctypes_obj),…
12412316
  • 725
  • 7
  • 17
0
votes
1 answer

How to install Cffi python module on Windows 7 64-bit?

Is there a way to start working with cffi in the Windows 7 64-bit environment without using the MinGW ? What all packages need to be installed for the same?
user39602
  • 339
  • 2
  • 5
  • 13
0
votes
0 answers

SWIG [C++ to LISP(CFFI)] how to get array in C++ wrap into CFFI list?

I have a simple C++ function that returns an array of int (as a pointer (int*)) and when the wrapping is done CFFI see it as a pointer. It's logical but what I want is CFFI see it as a list. Is there a way to do it in SWIG configuration? int*…
0
votes
0 answers

Using cl-glfw3 on windows

I'm trying to load the library cl-glfw3 with sbcl amd64 for windows. But all I've got is a message with a missing dll. The libffi-6.dll and glfw3.dll are on the same folder that the lisp program. * (ql:quickload "cl-glfw3") To load "cl-glfw3": …
Victor Marzo
  • 713
  • 5
  • 10
0
votes
1 answer

common-lisp cffi evaluation order when used with progn

I have created a simple shared library in C with just one function : void sayHello () { printf ("Hello World\n"); } Then, after compiling, I loaded that library into a lisp program using cffi : (cffi:define-foreign-library libtest1 (t…
RKS
  • 309
  • 1
  • 6
1 2 3
9
10