[cffi-devel] How would I wite the return value for a defcfun in my documentation

Martin Simmons martin at lispworks.com
Mon Mar 10 20:05:47 UTC 2014


See http://www.lispworks.com/documentation/HyperSpec/Body/f_ash.htm

for an example of how CLHS uses the "Syntax" and "Arguments and Values"
sections to describe functions.

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/



>>>>> On Sun, 9 Mar 2014 00:46:33 -0800 (PST), Joeish W said:
> 
> Here is my defcfun as I normally write it,
> 
> ;; Size Mat::size() const 
> ;; Size* cv_Mat_size(Mat* self) 
> (defcfun ("cv_Mat_size" mat-size) (:pointer size) 
>   (self (:pointer mat)))
> 
> 
> the 
> 
> 
> ;; Size Mat::size() const 
> 
> 
> is the C++  function declaration with a Size return value
> 
> 
> The ;; Size* cv_Mat_size(Mat* self) is the  C wrapper function declaration with a Size* return value
> 
> 
> This is my defcfun with a (:pointer size) return value
> 
> (defcfun ("cv_Mat_size" mat-size) (:pointer size) 
>   (self (:pointer mat)))
> 
> In my Documentation for this function I list the Common Lisp function declaration as
> 
> (MAT-SIZE (SELF (:POINTER MAT))) 
> 
> 
> I couldn't figure out if I should add a return value
> 
> 
> but in C++ the return value always goes up front i/e ;; Size Mat::size() const 
> 
> Is it common to put return values on Lisp/CFFI function declarations and if so where 
> 
> 
> in this declaration  (MAT-SIZE (SELF (:POINTER MAT))) should I put mine
> 
> btw on the CLHS I didn't see or missed return values on any function declaration
> 
> Thanks in advance for any  takers=)
> 
> Good Day.



More information about the cffi-devel mailing list