Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 412

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>def-function</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="rn05.html" title="Functions &amp; Libraries"><link rel="prev" href="rn05.html" title="Functions &amp; Libraries"><link rel="next" href="rn05re77.html" title="load-foreign-library"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><code class="function">def-function</code></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rn05.html">Prev</a>&#160;</td><th width="60%" align="center">Functions &amp; Libraries</th><td width="20%" align="right">&#160;<a accesskey="n" href="rn05re77.html">Next</a></td></tr></table><hr></div><div class="refentry" title="def-function"><a name="uffi.def-function"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p><code class="function">def-function</code> &#8212; Declares a function. 
    </p></div><div class="refsynopsisdiv" title="Macro"><h2>Macro</h2><pre class="synopsis">
     <code class="function">def-function</code> <em class="replaceable"><code>name args &amp;key module returning</code></em>
    </pre><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><p><span class="term"><em class="parameter"><code>name</code></em></span></p></td><td><p>A string or list specificying the function name. If it is a string, that names the foreign function. A Lisp name is created by translating #\_ to #\- and by converting to upper-case in case-insensitive Lisp implementations. If it is a list, the first item is a string specifying the foreign function name and the second it is a symbol stating the Lisp name.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>args</code></em></span></p></td><td><p>A list of argument declarations. If <code class="constant">NIL</code>, indicates that the function does not take any arguments.</p></td></tr><tr><td><p><span class="term"><em class="parameter"><code>module</code></em></span></p></td><td><p>A string specifying which module (or library) that the foreign function resides. (Required by Lispworks)</p></td></tr><tr><td><p><span class="term"><span class="returnvalue">returning</span></span></p></td><td><p>A declaration specifying the result type of the
       foreign function. If <code class="constant">:void</code> indicates module does not return any value.</p></td></tr></tbody></table></div></div><div class="refsect1" title="Description"><a name="id695815"></a><h2>Description</h2><p>Declares a foreign function.</p></div><div class="refsect1" title="Examples"><a name="id695826"></a><h2>Examples</h2><pre class="programlisting">
(def-function "gethostname" 
    ((name (* :unsigned-char))
     (len :int))
   :returning :int)
    </pre></div><div class="refsect1" title="Side Effects"><a name="id695839"></a><h2>Side Effects</h2><p>None.</p></div><div class="refsect1" title="Affected by"><a name="id695849"></a><h2>Affected by</h2><p>None.</p></div><div class="refsect1" title="Exceptional Situations"><a name="id695859"></a><h2>Exceptional Situations</h2><p>None.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="rn05.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="rn05.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="rn05re77.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Functions &amp; Libraries&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<code class="function">load-foreign-library</code></td></tr></table></div></body></html>