next up previous contents
Next: 8.7.4 Calling Lisp from Up: 8.7 Alien Function Calls Previous: The def-alien-routine Macro

def-alien-routine Example

Consider the C function cfoo with the following calling convention:

cfoo (str, a, i)
    char *str;
    char *a; /* update */
    int *i; /* out */
{
/* Body of cfoo. */
}
which can be described by the following call to def-alien-routine:
(def-alien-routine "cfoo" void
  (str c-string)
  (a char :in-out)
  (i int :out))
The Lisp function cfoo will have two arguments (str and a) and two return values (a and i).



Raymond Toy
Mon Jul 14 09:11:27 EDT 1997