X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=doc%2Fref_primitive.xml;h=79003698666d8ac462b6f70f4c4bd108ce2f3766;hb=HEAD;hp=2f4395529d03249d69a19a2d6bec6d5c642b1d0f;hpb=6be0cb84dd1fc6a0ae9410f7ccdc34ac21ae4377;p=uffi.git diff --git a/doc/ref_primitive.xml b/doc/ref_primitive.xml index 2f43955..7900369 100644 --- a/doc/ref_primitive.xml +++ b/doc/ref_primitive.xml @@ -1,272 +1,295 @@ - + + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ + %myents; ]> - Primitive Types - - Overview - - Primitive types have a single value, these include - characters, numbers, and pointers. They are all symbols in - the keyword package. + Primitive Types + + Overview + + Primitive types have a single value, these include + characters, numbers, and pointers. They are all symbols in + the keyword package. + + + + :char - Signed 8-bits. A + dereferenced :char pointer returns an character. - - - :char - Signed 8-bits. A -dereferenced :char pointer returns an character. - - - :unsigned-char - Unsigned 8-bits. A dereferenced :unsigned-char -pointer returns an character. - - - :byte - Signed 8-bits. A -dereferenced :byte pointer returns an integer. - - - :unsigned-byte - Unsigned 8-bits. A -dereferenced :unsigned-byte pointer returns an integer. - - - :short - Signed 16-bits. - - - :unsigned-short - Unsigned 16-bits. - - - :int - Signed 32-bits. - - - :unsigned-int - Unsigned 32-bits. - - - :long - Signed 32 or 64 bits, depending upon the platform. - + + + :unsigned-char - Unsigned 8-bits. A dereferenced :unsigned-char + pointer returns an character. + + + + :byte - Signed 8-bits. A + dereferenced :byte pointer returns an integer. + + + + :unsigned-byte - Unsigned 8-bits. A + dereferenced :unsigned-byte pointer returns an integer. + + + + :short - Signed 16-bits. + + + + :unsigned-short - Unsigned 16-bits. + + + + :int - Signed 32-bits. + + + :unsigned-int - Unsigned 32-bits. + + + :long - Signed 32 or 64 bit integer, + depending upon the platform. + + + :unsigned-long - Unsigned 32 or 64 + bit integer, depending upon the platform. + + + :long-long - Signed 64 bits integer + for implementations that support this. If implementation + does not support + this, 'uffi:no-long-long is pushed on + the cl:*features* list. + + + :unsigned-long-long - Unsigned 64 + bits integer for implementations that support this. If + implementation does not support + this, 'uffi:no-long-long is pushed on + the cl:*features* list. + + + :float - 32-bit floating point. + + + :double - 64-bit floating point. + + + :cstring - + A &null; terminated string used for passing and returning characters strings with a &c; function. + + + + :void - + 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 + + + + + + + def-constant + Binds a symbol to a constant. + + Macro + + + Syntax + + def-constant name value &key export + + + + Arguments and Values + + + name - :unsigned-long - Unsigned 32 or 64 bits, depending upon the platform. + A symbol that will be bound to the value. + + + + value - :float - 32-bit floating point. + An evaluated form that is bound the the name. + + + + export - :double - 64-bit floating point. + When &t;, the name is exported from the current package. The default is &nil; + + + + + Description + This is a thin wrapper around defconstant. It evaluates at + compile-time and optionally exports the symbol from the package. + + + + Examples + +(def-constant pi2 (* 2 pi)) +(def-constant exported-pi2 (* 2 pi) :export t) + + + + Side Effects + Creates a new special variable.. + + + Affected by + None. + + + Exceptional Situations + None. + + + + + + def-foreign-type + Defines a new foreign type. + + Macro + + + Syntax + + def-foreign-type name type + + + + Arguments and Values + + + name - :cstring - -A &null; terminated string used for passing and returning characters strings with a &c; function. + A symbol naming the new foreign type. + + + value - :void - -The absence of a value. Used to indicate that a function does not return a value. + A form that is not evaluated that defines the new + foreign type. + + + + + + Description + Defines a new foreign type. + + + + Examples + +(def-foreign-type my-generic-pointer :pointer-void) +(def-foreign-type a-double-float :double-float) +(def-foreign-type char-ptr (* :char)) + + + + Side Effects + Defines a new foreign type. + + + + Affected by + None. + + + Exceptional Situations + None. + + + + + + null-char-p + Tests a character for &null; value. + + Macro + + + Syntax + + null-char-p char => is-null + + + + Arguments and Values + + + char - :pointer-void - -Points to a generic object. + A character or integer. + + + + is-null - * - Used to declare a pointer to an object + A boolean flag indicating if char is a &null; value. + - - - - - - def-constant - Binds a symbol to a constant. - - Macro - - - Syntax - - def-constant name value &key export - - - - Arguments and Values - - - name - - A symbol that will be bound to the value. - - - - - value - - An evaluated form that is bound the the name. - - - - - export - - When &t;, the name is exported from the current package. The default is &nil; - - - - - - Description - - This is a thin wrapper around - defconstant. It evaluates at - compile-time and optionally exports the symbol from the package. - - - - Examples - -(def-constant pi2 (* 2 pi)) -(def-constant exported-pi2 (* 2 pi) :export t) - - - - Side Effects - Creates a new special variable.. - - - Affected by - None. - - - Exceptional Situations - None. - - - - - - def-foreign-type - Defines a new foreign type. - - Macro - - - Syntax - - def-foreign-type name type - - - - Arguments and Values - - - name - - A symbol naming the new foreign type. - - - - - value - - A form that is not evaluated that defines the new -foreign type. - - - - - - - Description - Defines a new foreign type. - - - - Examples - -(def-foreign-type my-generic-pointer :pointer-void) -(def-foreign-type a-double-float :double-float) -(def-foreign-type char-ptr (* :char)) - - - - Side Effects - Defines a new foreign type. - - - - Affected by - None. - - - Exceptional Situations - None. - - - - - - null-char-p - Tests a character for &null; value. - - Macro - - - Syntax - - null-char-p char => is-null - - - - Arguments and Values - - - char - - A character or integer. - - - - - is-null - - A boolean flag indicating if char is a &null; value. - - - - - - - Description - - A predicate testing if a character or integer is &null;. This -abstracts the difference in implementations where some return a -character and some return a -integer whence dereferencing a -C character pointer. - - - - Examples - + + + + + Description + + A predicate testing if a character or integer is &null;. This + abstracts the difference in implementations where some return a + character + and some return a + integer + whence dereferencing a + C + character pointer. + + + + Examples + (def-array-pointer ca :unsigned-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)))) + (values (null-char-p (deref-array fs 'ca 0)) + (null-char-p (deref-array fs 'ca 2)))) => &nil; &t; - - - - Side Effects - None. - - - - Affected by - None. - - - Exceptional Situations - None. - - - + + + + Side Effects + None. + + + + Affected by + None. + + + Exceptional Situations + None. + + +