uffi

API Reference

uffi

Universal Foreign Function Library for Common Lisp

UFFI

  • Variable *DEFAULT-FOREIGN-ENCODING*
    nil
    Normalized name of default external character format to use for foreign string conversions. nil means use implementation default encoding.
  • Variable *FOREIGN-ENCODINGS*
    (mapcar 'car uffi::*foreign-encoding-mapping*)
    List of normalized names of external formats support by underlying implementation.
  • Macro STRING-TO-OCTETS (str &key encoding null-terminate)
  • Macro OCTETS-TO-STRING (octets &key encoding)
    Converts a vector of octets to a Lisp string.
  • Function FOREIGN-ENCODED-OCTET-COUNT (str &key encoding)
    Returns the octets required to represent the string when passed to a ~ foreign function.
  • Macro DEF-CONSTANT (name value &key (export nil))
    Macro to define a constant and to export it
  • Macro DEF-TYPE (name type)
    Generates a (deftype) statement for CL. Currently, only CMUCL supports takes advantage of this optimization.
  • Macro NULL-CHAR-P (val)
    Returns T if character is NULL
  • Macro DEF-FOREIGN-TYPE (name type)
  • Function SIZE-OF-FOREIGN-TYPE (type)
  • Macro ALLOCATE-FOREIGN-OBJECT (type &optional (size :unspecified))
    Allocates an instance of TYPE. If size is specified, then allocate an array of TYPE with size SIZE. The TYPE parameter is evaluated.
  • Macro FREE-FOREIGN-OBJECT (obj)
  • Macro NULL-POINTER-P (obj)
  • Macro MAKE-NULL-POINTER (type)
  • Macro MAKE-POINTER (addr type)
  • Macro CHAR-ARRAY-TO-POINTER (obj)
  • Macro DEREF-POINTER (ptr type)
    Returns a object pointed
  • Macro ENSURE-CHAR-CHARACTER (obj)
  • Macro ENSURE-CHAR-INTEGER (obj)
  • Macro ENSURE-CHAR-STORABLE (obj)
  • Macro POINTER-ADDRESS (obj)
  • Macro WITH-FOREIGN-OBJECT ((var type) &rest body)
  • Macro WITH-FOREIGN-OBJECTS (bindings &rest body)
  • Macro WITH-CAST-POINTER ((binding-name pointer type) &body body)
  • Macro DEF-FOREIGN-VAR (names type module)
  • Macro DEF-POINTER-VAR (name value &optional doc)
  • Macro DEF-ENUM (enum-name args &key (separator-string "#"))
    Creates a constants for a C type enum list, symbols are created in the created in the current package. The symbol is the concatenation of the enum-name name, separator-string, and field-name
  • Macro DEF-ARRAY-POINTER (name-array type)
  • Macro DEF-STRUCT (name &rest fields)
  • Macro GET-SLOT-VALUE (obj type slot)
  • Macro GET-SLOT-POINTER (obj type slot)
  • Macro DEREF-ARRAY (obj type i)
    Returns a field from a row
  • Macro DEF-UNION (name &rest fields)
  • Function CONVERT-FROM-FOREIGN-USB8 (s len)
  • Variable +NULL-CSTRING-POINTER+
    nil
  • Macro CONVERT-FROM-CSTRING (obj)
    Converts a string from a c-call. Same as convert-from-foreign-string, except that LW/CMU automatically converts strings from c-calls.
  • Macro CONVERT-TO-CSTRING (obj)
  • Macro FREE-CSTRING (obj)
  • Macro WITH-CSTRING ((cstring lisp-string) &body body)
  • Macro WITH-CSTRINGS (bindings &rest body)
  • Macro CONVERT-TO-FOREIGN-STRING (obj &optional encoding)
  • Macro CONVERT-FROM-FOREIGN-STRING (obj &key length encoding (null-terminated-p t))
  • Macro ALLOCATE-FOREIGN-STRING (size &key (unsigned t))
  • Function FOREIGN-STRING-LENGTH (foreign-string)
  • Macro WITH-FOREIGN-STRING ((foreign-string lisp-string &optional encoding) &body body)
  • Macro WITH-FOREIGN-STRINGS (bindings &body body)
  • Macro DEF-FUNCTION (names args &key module returning)
  • Function DEFAULT-FOREIGN-LIBRARY-TYPE
    Returns string naming default library type for platform
  • Function FOREIGN-LIBRARY-TYPES
    Returns list of string naming possible library types for platform, sorted by preference
  • Function FIND-FOREIGN-LIBRARY (names directories &key types drive-letters)
    Looks for a foreign library. directories can be a single string or a list of strings of candidate directories. Use default library type if type is not specified.
  • Function LOAD-FOREIGN-LIBRARY (filename &key module supporting-libraries force-load)
  • Function GETENV (var)
    Return the value of the environment variable.
  • Function RUN-SHELL-COMMAND (control-string &rest args &key output)
    Interpolate ARGS into CONTROL-STRING as if by FORMAT, and synchronously execute the result using a Bourne-compatible shell, with output to *trace-output*. Returns the shell's exit code.

uffi-tests

REGRESSION-TEST

The MIT regression tester with pfdietz's modifications
  • Variable *TEST*
    nil
    Current test name
  • Variable *DO-TESTS-WHEN-DEFINED*
    nil
  • Function PENDING-TESTS
  • Function REM-ALL-TESTS
  • Function REM-TEST (&optional (name *test*))
  • Function GET-TEST (&optional (name *test*))
  • Macro DEFTEST (name form &rest values)
  • Function DO-TEST (&optional (name *test*))
  • Function CONTINUE-TESTING
  • Function DO-TESTS (&optional (out *standard-output*))

UFFI-TESTS

No exported symbols.