X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fref_aggregate.xml;h=c1892648ad5ef60af4fb3d818ce902af752f3fec;hb=54929de80ac68bb7ef45a28e70945c7243d39c82;hp=401c28186400a71b62b417ed648a0d84a8efccb4;hpb=c5115898210dbfa357c208c1bfe58049f7d6ff6d;p=uffi.git diff --git a/doc/ref_aggregate.xml b/doc/ref_aggregate.xml index 401c281..c189264 100644 --- a/doc/ref_aggregate.xml +++ b/doc/ref_aggregate.xml @@ -1,7 +1,7 @@ - + + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + %myents; ]> @@ -70,7 +70,7 @@ a foreign type with the name name of type Examples - + (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 @@ -78,7 +78,7 @@ a foreign type with the name name of type (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 - + Side Effects @@ -138,12 +138,12 @@ structure. It's type is :pointer-self. Examples - + (def-struct foo (a :unsigned-int) (b (* :char)) (c (:array :int 10)) (next :pointer-self)) - + Side Effects @@ -209,14 +209,16 @@ structure. It's type is :pointer-self. Description - Accesses a slot value from a structure. + Accesses a slot value from a structure. This is generalized + and can be used with setf. Examples - + (get-slot-value foo-ptr 'foo-structure 'field-name) - +(setf (get-slot-value foo-ptr 'foo-structure 'field-name) 10) + Side Effects @@ -287,9 +289,9 @@ structure. It's type is :pointer-self. Examples - + (get-slot-pointer foo-ptr 'foo-structure 'my-char-ptr) - + Side Effects @@ -346,9 +348,9 @@ structure. It's type is :pointer-self. Examples - + (def-array-pointer byte-array-pointer :unsigned-char) - + Side Effects @@ -375,7 +377,7 @@ structure. It's type is :pointer-self. Syntax - deref-array array type positon => value + deref-array array type position => value @@ -420,14 +422,14 @@ the array. Examples - + (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; - + Notes @@ -491,7 +493,7 @@ the array. Examples - + (def-union test-union (a-char :char) (an-int :int)) @@ -502,7 +504,7 @@ the array. (ensure-char-character (get-slot-value u 'test-union 'a-char)) (free-foreign-object u))) => #\A - + Side Effects