</para>
</sect2>
- <sect2 id="uffi-declare">
- <title>uffi-declare</title>
- <para>
- This is used wherever a <function>declare</function>
- expression can be placed. For example:
- </para>
- <para>
- <programlisting>
-(let ((my-structure (uffi:allocate-foreign-object 'a-struct)))
- (uffi:uffi-declare a-struct my-structure))
- </programlisting>
- </para>
- </sect2>
-
- <sect2 id="slot-type">
- <title>slot-type</title>
+ <sect2 id="def-type">
+ <title>def-type</title>
<para>
- This is used inside of <function>defclass</function> and
- <function>defstruct</function> expressions to set the type
- for a field. Because the type identifier is not evaluated in
- &cl;, the expression must be backquoted for effect. For
- example:
- </para>
+ This is used wherever a &cl; <function>deftype</function>
+ expression can be placed. Used to declare types to
+the compiler for optimization. Currently, on &cmucl; takes advantage
+of this. </para>
<para>
<programlisting>
-(eval
- `(defclass a-class ()
- ((char-ptr :type ,(uffi:slot-type (* :char))))))
+(uffi:def-type my-struct-def my-struct-foreign-type)
</programlisting>
</para>
</sect2>
</sect1>
<sect1>
- <title>Immediate Types</title>
+ <title>Primitive Types</title>
<sect2>
<title>Overview</title>
<para>
- Immediate types have a single value, these include
+ Primitive types have a single value, these include
characters, numbers, and pointers. They are all symbols in
the keyword package.
</para>
</refpurpose>
<refclass>Macro</refclass>
</refnamediv>
- <refsect1>
+ <refsynopsisdiv>
<title>Syntax</title>
-<synopsis>
+ <synopsis>
<function>def-function</function> <replaceable>name args &key module returning</replaceable>
-</synopsis>
- </refsect1>
+ </synopsis>
+ </refsynopsisdiv>
<refsect1>
<title>Arguments and Values</title>
<variablelist>
<refsect1>
<title>Syntax</title>
<synopsis>
- <function>load-foreign-library</function> <replaceable>filename module supporting-libraries</replaceable> => <returnvalue>success</returnvalue>
+ <function>load-foreign-library</function> <replaceable>filename &key module supporting-libraries</replaceable> => <returnvalue>success</returnvalue>
</synopsis>
</refsect1>
<refsect1>
<term><parameter>filename</parameter></term>
<listitem>
<para>A string or pathname specifying the library location
-in the filesystem.
+in the filesystem. At least one implementation (&lw;) can not
+accept a logical pathname.
</para>
</listitem>
</varlistentry>
<refsect1>
<title>Examples</title>
<programlisting>
- (load-foreign-library #p"/usr/lib/libmysqlclient.so" "mysql" '("c"))
+ (load-foreign-library #p"/usr/lib/libmysqlclient.so"
+ :module "mysql"
+ :supporting-libraries '("c"))
=> T
</programlisting>
</refsect1>