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

Can I wrap OpenCV's C++ interface with C and then wrap that with Lisp's CFFI?

I was also wondering about the possibility of wrapping OpenCV's C++ interface in C and then wrapping that in Lisp so I could add all the C++ functionality as well to my cl-opencv wrapper because I would like to make it complete.... Also wondered if…
user2735131
0
votes
1 answer

cffi's foreign-alloc with list containing a defconstant

I'm trying to do: (defconstant x 1) (cffi:foreign-alloc :int :initial-contents '(x 99)) but I get an error message: The value X is not of type (SIGNED-BYTE 32). [Condition of type TYPE-ERROR] It is very important that I can define this: (x 99)…
user2735131
0
votes
1 answer

How do I find out in the OpenCV C Inerface,...In what .so a OpenCV function is defined

Like for example if I was trying to call cvNamedWindow....what .so would the cvNamedWindow information be in.....Please give me the info so I can track this info down myself for any C OpenCV function...I usually grep my opencv 2.4.6 folder which…
user2735131
-1
votes
1 answer

Encoding 'utf-16' is not consistent when convert lisp string from/to C string

I find when use 'utf-16' as the encoding to convert a lisp string to C string with cffi, the actual encoding used is 'utf-16le'. But, when convert C string back to lisp string, the actual encoding used is 'utf-16be'. Since I'm not familiar with…
xiepan
  • 623
  • 4
  • 13
-1
votes
1 answer

How do I mem-aref the output of a meta-object in CFFI

I have this function scalar which is a wrapper of the 2 function definitions commented above it. My ? is how do I mem-aref the output of (scalar 1 2 3 4), which is # I think # is called a Meta-Object …
user3517736
  • 329
  • 1
  • 4
  • 14
-1
votes
1 answer

Common Lisp: This is not a number NIL and &rest parameters

On this line ((pointerp (first args)) (mem-aref (%vector-float-to-c-array (first args)) :float (second args))) in the below code the (second args) compiles with the warning This is not a number NIL. The function works but how do I get rid of this…
user3517736
  • 329
  • 1
  • 4
  • 14
-3
votes
2 answers

Clarification sought on validity and reason for "empty" C struct definition in Python CFFI definition file

I am reading some code, and came across this rather odd C struct definition: typedef struct dataObject { ...; } DATA_OBJECT; Can anyone explain (with references if possible): If this is a valid struct definition. What would be the…
Homunculus Reticulli
  • 65,167
  • 81
  • 216
  • 341
1 2 3
9
10