X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=doc%2Fref.sgml;h=2eb2e1c438ca9bae4c460e9b8b29afba26bcf5e0;hb=fb93b1923db347f01bdebc7226e5e1eaacacc9f9;hp=252bdc53c8894657887f6150a7155758dedb99de;hpb=d5d0bfb15f7a30ac5398211708f5f5d9d4a95e04;p=uffi.git diff --git a/doc/ref.sgml b/doc/ref.sgml index 252bdc5..2eb2e1c 100644 --- a/doc/ref.sgml +++ b/doc/ref.sgml @@ -88,43 +88,55 @@ - :char - Signed 8-bits + :char - Signed 8-bits. A +dereferenced :char pointer returns an character. + - :unsigned-char - Unsigned 8-bits + :unsigned-char - Unsigned 8-bits. A dereferenced :unsigned-char +pointer returns an character. - :short - Signed 16-bits + + :byte - Unsigned 8-bits. A +dereferenced :byte pointer returns an integer. + + + :short - Signed 16-bits. - :unsigned-short - Unsigned 16-bits + :unsigned-short - Unsigned 16-bits. - :int - Signed 32-bits + :int - Signed 32-bits. - :unsigned-int - Unsigned 32-bits + :unsigned-int - Unsigned 32-bits. - :long - Signed 32-bits + :long - Signed 32-bits. - :unsigned-long - Unsigned 32-bits + :unsigned-long - Unsigned 32-bits. - :float - 32-bit floating point + :float - 32-bit floating point. - :double - 64-bit floating point + :double - 64-bit floating point. :cstring - -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. :void - -The absence of a value. Used in generic pointers and in return types from functions. +The absence of a value. Used to indicate that a function does not return a value. + + + :pointer-void - +Points to a generic object. * - Used to declare a pointer to an object @@ -240,7 +252,7 @@ foreign type. Examples -(def-foreign-type my-generic-pointer (* :void)) +(def-foreign-type my-generic-pointer :pointer-void) (def-foreign-type a-double-float :double-float) (def-foreign-type char-ptr (* :char)) @@ -327,86 +339,20 @@ abstracts the difference in implementations where some return a None. + - - - ensure-char - Ensures value is a character. - - Macro - - - Syntax - - ensure-char obj => char - - - - Arguments and Values - - - obj - - A character or integer. - - - - - char - - A character value. - - - - - - - Description - - Enscapsulates the fact that some implementations return a character -and others return an integer when dereferencing a character pointer. - - - - Examples - - -(let ((fs (convert-to-foreign-string "a"))) - (prog1 - (ensure-char (deref-pointer fs :char)) - (free-foreign-object fs))) -=> #\a - - - - - Side Effects - None. - - - Affected by - None. - - - Exceptional Situations - Signals an error if obj is not -an integer or character. - - - - - - Aggregate Types + + Aggregate Types Overview Aggregate types are comprised of one or more primitive types. - + - - - def-enum + + + def-enum Defines a &c; enumeration. Macro @@ -1599,7 +1545,7 @@ Can translated ASCII and binary strings. unsigned - A boolean flag with a default value of &nil;. When true, + A boolean flag with a default value of &t;. When true, marks the pointer as an :unsigned-char. @@ -1665,7 +1611,7 @@ marks the pointer as an :unsigned-char. args - A list of argument declarations. Use &nil; to specify no arguments. + A list of argument declarations. If &nil;, indicates that the function does not take any arguments. @@ -1679,7 +1625,7 @@ marks the pointer as an :unsigned-char. returning A declaration specifying the result type of the -foreign function. +foreign function. If :void indicates module does not return any value.