-<?xml version='1.0' ?> <!-- -*- DocBook -*- -->
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
- "file:///usr/share/sgml/docbook/dtd/xml/4.2/docbookx.dtd" [
-<!ENTITY % myents SYSTEM "entities.xml">
+ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+<!ENTITY % myents SYSTEM "entities.inc">
%myents;
]>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(def-enum abc (:a :b :c))
;; Creates constants abc#a (1), abc#b (2), abc#c (3) and defines
;; the foreign type "abc" to be :int
(def-enum efoo (:e1 (:e2 10) :e3) :separator-string "-")
;; Creates constants efoo-e1 (1), efoo-e2 (10), efoo-e3 (11) and defines
;; the foreign type efoo to be :int
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(def-struct foo (a :unsigned-int)
(b (* :char))
(c (:array :int 10))
(next :pointer-self))
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(get-slot-value foo-ptr 'foo-structure 'field-name)
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(get-slot-pointer foo-ptr 'foo-structure 'my-char-ptr)
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(def-array-pointer byte-array-pointer :unsigned-char)
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(def-array-pointer ca :char)
(let ((fs (convert-to-foreign-string "ab")))
(values (null-char-p (deref-array fs 'ca 0))
(null-char-p (deref-array fs 'ca 2))))
=> &nil;
&t;
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Notes</title>
</refsect1>
<refsect1>
<title>Examples</title>
- <programlisting>
+ <screen>
(def-union test-union
(a-char :char)
(an-int :int))
(ensure-char-character (get-slot-value u 'test-union 'a-char))
(free-foreign-object u)))
=> #\A
- </programlisting>
+ </screen>
</refsect1>
<refsect1>
<title>Side Effects</title>