I'm trying to call C functions that return arguments via int*. But I'm not
sure how to make an integer that I can use as a pointer in C, and still
read it back in ECL.
This code below doesn't work. It segfaults. Any help?
;;;;;
(clines "void test(int* a) {
*a = 5;
};")
(defun set-to-five ()
(with-foreign-object (item :int)
(c-inline (item) ((* :int)) :void "test(#0)" :one-liner t)
(format t "~%I GOT: ~a" (deref-pointer item :int))))
;;;;
Cheers,
Warren Wilkinson
1 403 383-7152
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list