From: Kevin M. Rosenberg Date: Sun, 10 Mar 2002 12:00:07 +0000 (+0000) Subject: r1534: *** empty log message *** X-Git-Tag: v1.6.1~614 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;h=737a3e3a8d18dd80f4cda0d93bc20a3b5677dbee;hp=ce76fe27cbbb4f6bac18a0ffd7bd4f454f7d4a02;p=uffi.git r1534: *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index 6ed9d59..ab61ff2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 9 Mar 2002 + + * Added to documentation * Made Allegro CL array access more efficient diff --git a/doc/intro.sgml b/doc/intro.sgml index a42cc8d..d432b9f 100644 --- a/doc/intro.sgml +++ b/doc/intro.sgml @@ -58,7 +58,7 @@ directory containing &uffi; into mk:*central-registry*. Whenever you want to load the &uffi; package, use the function - (mk:oos :uffi 'load). + (mk:load-system :uffi). diff --git a/doc/ref.sgml b/doc/ref.sgml index 5eb4f9e..0bc5b47 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -62,12 +62,74 @@ Immediate Types + + Overview + + Immediate types have a single value, these include + characters, numbers, and pointers. They are all symbols in + the keyword package. + + + + :byte - Unsigned 8-bit + + + :char - Signed 8-bits + + + :unsigned-char - Unsigned 8-bits + + + :short - Signed 16-bits + + + :unsigned-short - Unsigned 16-bits + + + :int - Signed 32-bits + + + :unsigned-int - Unsigned 32-bits + + + :long - Signed 32-bits + + + :unsigned-long - Unsigned 32-bits + + + :single-float - 32-bit floating point + + + :double-float - 64-bit floating point + + + + + :cstring + + - A null-terminated string used for passing and returning with a function. + + + + + + :void + + - An absence of a value. Used in generic pointers and in + return types from functions. + + + * - Used to declare a pointer to an object + + + def-constant This is a thin wrapper around - defconstant. It also exports the symbol - from the package. + defconstant. It evaluates at + compile-time and exports the symbol from the package. @@ -75,6 +137,16 @@ This is the main function for creating new types. + + Examples + + +(def-type my-generic-pointer (* :void)) +(def-type a-double-float :double-float) +(def-type char-ptr (* :char)) + + + null-char-p @@ -96,8 +168,18 @@ def-struct - Declares a structure. + Declares a structure. A special type is available as a slot in the field. It is + a pointer that points to an instance of the parent structure. It's type is + :pointer-self. + + Examples + + +(def-struct foo (a :unsigned-int) (b :array 10) (next :pointer-self)) + + + get-slot-value @@ -131,7 +213,7 @@ allocate-foreign-object - Allocates an instance of a foreign object. + Allocates an instance of a foreign object. It returns a pointer to the object. @@ -167,13 +249,24 @@ +null-cstring-pointer+ - A constant returning a &null; character pointer; + A constant &null; character pointer. Strings + + Overview + + &uffi; has functions to two types of C-compatible + strings, cstring and foreign strings. +cstrings are used as parameters to and from functions. An implementation, such as CMUCL, +may not convert these to a foreign type for efficiency sake. Thus, it is not +possible to "allocate" a cstring. In contrast, foreign strings +always need to have memory for them. + + convert-from-cstring @@ -230,7 +323,7 @@ def-function - This macro generates a &c; routine definition. + This macro generates a &c; function definition.