Next Previous Up Top Contents Index

5 Function and Macro Reference

incf-pointer

Function

Summary

Increases the address held by a pointer.
Package

fli

Signature

incf-pointer pointer &optional delta => bytes

Arguments

pointer

An FLI pointer.

delta

An integer. The default value is 1.

Values

bytes

The number of bytes the pointer address has increased by since it was created.

Description

The functionincf-pointer increases the address held by the pointer. If delta is not given the address is increased by the size of the type pointed to by the pointer. The address can be increased by a multiple of the size of the type by specifying a delta.
The functionincf-pointer is often used to move a pointer through an array of values.
Example

In the following example an array with 10 entries is defined. A copy of the pointer to the array is made, and is incremented and decremented.
(setq array-obj
      (fli:allocate-foreign-object :type :int
        :nelems 10
        :initial-contents '(0 1 2 3 4 5 6 7 8 9)))

(setq point1 (fli:copy-pointer array-obj))

(dotimes (x 9) (fli:incf-pointer point1) (print (fli:dereference point1)))

(dotimes (x 9) (fli:decf-pointer point1) (print (fli:dereference point1)))

See Also

decf-pointer

LispWorks Foreign Language Interface - 12 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker