From b68aabbeed53828142f86967d20bd506bd59e258 Mon Sep 17 00:00:00 2001 From: japhie Date: Sat, 21 May 2005 10:29:30 +0000 Subject: [PATCH] - Documented multiple return values from ffi:c-inline. --- src/doc/devel.txi | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/src/doc/devel.txi b/src/doc/devel.txi index b7571bf3b..858c967a9 100644 --- a/src/doc/devel.txi +++ b/src/doc/devel.txi @@ -1439,22 +1439,26 @@ to the Lisp world, with an automatic convertion taking place in both directions. @defmac {c-inline} @{@var{args-list} @var{arg-C-types} @var{output-C-type} @var{C-expr} @keys{} (@var{side-effects} @code{T}) (@var{one-liner} @code{T})@} -@code{c-inline} is a special form that can only be used in compiled code. -For all purposes it behaves as a Lisp form, which takes the arguments -given in @var{args-list} and produces a single value. Behind the curtains, -the arguments of @var{args-list} (which can be any valid Lisp form) -are coerced to the the C types given in @var{arg-C-types}, passed to -the C expression @var{C-expr}, and coerced back to Lisp using the -C type @var{output-C-type} as a guide. +@code{c-inline} is a special form that can only be used in compiled +code. For all purposes it behaves as a Lisp form, which takes the +arguments given in @var{args-list} and produces a single value. Behind +the curtains, the arguments of @var{args-list} (which can be any valid +Lisp form) are coerced to the the C types given in @var{arg-C-types}, +passed to the C expression @var{C-expr}, and coerced back to Lisp +using the C type @var{output-C-type} as a guide. Multiple return +values can be returned by setting @var{output-C-type} to @code{(values +type-1 type-2 ...)}. -@var{C-expr} is a string containing C code and maybe some special escape codes. -First, the arguments of the form may be retrieved as @code{#0}, @code{#1}, etc. -Second, if the @code{c-inline} form is a one-line C expression (That is, -@var{one-liner} is true), then the whole expression is interpreted as the -output value. But if the code, on the other hand, is a multiline expression -(@var{one-liner} is false), the form has to be output using @code{@@(return) -=...}. Finally, Lisp constants may be used in the C code making use of the -prefix @code{@@}. +@var{C-expr} is a string containing C code and maybe some special +escape codes. First, the arguments of the form may be retrieved as +@code{#0}, @code{#1}, etc. Second, if the @code{c-inline} form is a +one-line C expression (That is, @var{one-liner} is true), then the +whole expression is interpreted as the output value. But if the code, +on the other hand, is a multiline expression (@var{one-liner} is +false), the form has to be output using @code{@@(return) +=...}. Multiple values are returned as @code{@@(return 0)=... ; +@@(return 1)=...;}. Finally, Lisp constants may be used in the C code +making use of the prefix @code{@@}. @example (use-package "FFI")