cffi:defcstruct, cffi:foreign-string-to-lisp question
2008-12-17 14:45:12 GMT
Hi,
I don`t know if this is the right group to ask, but I would appreciate some help with the following.
The aim is to read a binary file from lisp.
The file contains a set of records, every record consists of the following data:
(cffi:defcstruct ppp
(nr :unsigned-int)
(name :char :count 32) ;; this is the problematic line 1
(alias :char :count 12) ;; this is the problematic line 2
(m :double)
(t :double)
(p :double)
(v :double))
Now the problematic line 1 should read 32 characters from an ascii-encoded file.
For that, I use the (defun test .....) (see below). The test converts the cstruct with-foreign-slots through (cffi:foreign-string-to-lisp name).
The output of (test) is:
(1 "ABC ABC
_______________________________________________ cffi-devel mailing list cffi-devel <at> common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/cffi-devel
RSS Feed