</para>
<itemizedlist>
<listitem>
- <para><constant>:char</constant> - Signed 8-bits</para>
+ <para><constant>:char</constant> - Signed 8-bits. A
+dereferenced :char pointer returns an character.</para>
</listitem>
<listitem>
- <para><constant>:unsigned-char</constant> - Unsigned 8-bits</para>
+ <para><constant>:unsigned-char</constant> - Unsigned 8-bits. A dereferenced :unsigned-char
+pointer returns an character.</para>
</listitem>
<listitem>
- <para><constant>:short</constant> - Signed 16-bits</para>
+ <para><constant>:byte</constant> - Unsigned 8-bits. A
+dereferenced :byte pointer returns an integer.</para>
</listitem>
<listitem>
- <para><constant>:unsigned-short</constant> - Unsigned 16-bits</para>
+ <para><constant>:short</constant> - Signed 16-bits.</para>
</listitem>
<listitem>
- <para><constant>:int</constant> - Signed 32-bits</para>
+ <para><constant>:unsigned-short</constant> - Unsigned 16-bits.</para>
</listitem>
<listitem>
- <para><constant>:unsigned-int</constant> - Unsigned 32-bits</para>
+ <para><constant>:int</constant> - Signed 32-bits.</para>
</listitem>
<listitem>
- <para><constant>:long</constant> - Signed 32-bits</para>
+ <para><constant>:unsigned-int</constant> - Unsigned 32-bits.</para>
</listitem>
<listitem>
- <para><constant>:unsigned-long</constant> - Unsigned 32-bits</para>
+ <para><constant>:long</constant> - Signed 32-bits.</para>
</listitem>
<listitem>
- <para><constant>:float</constant> - 32-bit floating point</para>
+ <para><constant>:unsigned-long</constant> - Unsigned 32-bits.</para>
</listitem>
<listitem>
- <para><constant>:double</constant> - 64-bit floating point</para>
+ <para><constant>:float</constant> - 32-bit floating point.</para>
+ </listitem>
+ <listitem>
+ <para><constant>:double</constant> - 64-bit floating point.</para>
</listitem>
<listitem>
<para><constant>:cstring</constant> -
-A null-terminated string used for passing and returning with a function.
+A &null; terminated string used for passing and returning characters strings with a &c; function.
</para>
</listitem>
<listitem>
<para><constant>:void</constant> -
-The absence of a value. Used in generic pointers and in return types from functions.</para>
+The absence of a value. Used to indicate that a function does not return a value.</para>
+ </listitem>
+ <listitem>
+ <para><constant>:pointer-void</constant> -
+Points to a generic object.</para>
</listitem>
<listitem>
<para><constant>*</constant> - Used to declare a pointer to an object</para>
<para>None.</para>
</refsect1>
</refentry>
+ </reference>
- <refentry id="ensure-char">
- <refnamediv>
- <refname>ensure-char</refname>
- <refpurpose>Ensures value is a character.
- </refpurpose>
- <refclass>Macro</refclass>
- </refnamediv>
- <refsynopsisdiv>
- <title>Syntax</title>
- <synopsis>
- <function>ensure-char</function> <replaceable>obj</replaceable> => <returnvalue>char</returnvalue>
- </synopsis>
- </refsynopsisdiv>
- <refsect1>
- <title>Arguments and Values</title>
- <variablelist>
- <varlistentry>
- <term><parameter>obj</parameter></term>
- <listitem>
- <para>A character or integer.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><parameter>char</parameter></term>
- <listitem>
- <para>A character value.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- </refsect1>
- <refsect1>
- <title>Description</title>
- <para>
- Enscapsulates the fact that some implementations return a character
-and others return an integer when dereferencing a character pointer.
- </para>
- </refsect1>
- <refsect1>
- <title>Examples</title>
- <para>
-<programlisting>
-(let ((fs (convert-to-foreign-string "a")))
- (prog1
- (ensure-char (deref-pointer fs :char))
- (free-foreign-object fs)))
-=> #\a
-</programlisting>
- </para>
- </refsect1>
- <refsect1>
- <title>Side Effects</title>
- <para>None.</para>
- </refsect1>
- <refsect1>
- <title>Affected by</title>
- <para>None.</para>
- </refsect1>
- <refsect1>
- <title>Exceptional Situations</title>
- <para>Signals an error if <parameter>obj</parameter> is not
-an integer or character.</para>
- </refsect1>
- </refentry>
-</reference>
-
-<reference>
- <title>Aggregate Types</title>
+ <reference>
+ <title>Aggregate Types</title>
<partintro>
<title>Overview</title>
<para>
Aggregate types are comprised of one or more primitive types.
</para>
-</partintro>
+ </partintro>
- <refentry id="def-enum">
- <refnamediv>
- <refname>def-enum</refname>
+ <refentry id="def-enum">
+ <refnamediv>
+ <refname>def-enum</refname>
<refpurpose>Defines a &c; enumeration.
</refpurpose>
<refclass>Macro</refclass>
<refentry id="get-slot-value">
<refnamediv>
- <refname>def-slot-value</refname>
+ <refname>get-slot-value</refname>
<refpurpose>Retrieves a value from a slot of a structure.
</refpurpose>
<refclass>Macro</refclass>
<title>Examples</title>
<programlisting>
(def-struct ab (a :int) (b :double))
-(allocate-foreign-object 'ab)
+(allocate-foreign-object ab)
=> #<ptr>
</programlisting>
</refsect1>
<refsynopsisdiv>
<title>Syntax</title>
<synopsis>
- <function>def-pointer</function> <replaceable>ptr type</replaceable> => <returnvalue>value</returnvalue>
+ <function>deref-pointer</function> <replaceable>ptr type</replaceable> => <returnvalue>value</returnvalue>
</synopsis>
</refsynopsisdiv>
<refsect1>
<varlistentry>
<term><parameter>unsigned</parameter></term>
<listitem>
- <para>A boolean flag with a default value of &nil;. When true,
+ <para>A boolean flag with a default value of &t;. When true,
marks the pointer as an <constant>:unsigned-char</constant>.
</para>
</listitem>
<varlistentry>
<term><parameter>args</parameter></term>
<listitem>
- <para>A list of argument declarations. Use &nil; to specify no arguments.
+ <para>A list of argument declarations. If &nil;, indicates that the function does not take any arguments.
</para>
</listitem>
</varlistentry>
<term><returnvalue>returning</returnvalue></term>
<listitem>
<para>A declaration specifying the result type of the
-foreign function.
+foreign function. If <constant>:void</constant> indicates module does not return any value.
</para>
</listitem>
</varlistentry>