Common Lisp Package: UFFI

README:

FUNCTION

Public

DEFAULT-FOREIGN-LIBRARY-TYPE

Returns string naming default library type for platform

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.

FOREIGN-ENCODED-OCTET-COUNT (STR &KEY ENCODING)

Returns the octets required to represent the string when passed to a ~ foreign function.

FOREIGN-LIBRARY-TYPES

Returns list of string naming possible library types for platform, sorted by preference

GETENV (VAR)

Return the value of the environment variable.

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.

Undocumented

CONVERT-FROM-FOREIGN-USB8 (S LEN)

FOREIGN-STRING-LENGTH (FOREIGN-STRING)

LOAD-FOREIGN-LIBRARY (FILENAME &KEY MODULE SUPPORTING-LIBRARIES FORCE-LOAD)

SIZE-OF-FOREIGN-TYPE (TYPE)

Private

%CONVERT-FROM-UFFI-TYPE (TYPE CONTEXT)

Converts from a uffi type to an implementation specific type

Undocumented

%CONVERT-TO-FOREIGN-STRING (STR ENCODING)

ALLEGRO-CONVERT-RETURN-TYPE (TYPE)

BASIC-CONVERT-FROM-UFFI-TYPE (TYPE)

CONVERT-FROM-UFFI-TYPE (TYPE CONTEXT)

CONVERT-LISPWORKS-ARGS (ARGS)

CONVERT-SUPPORTING-LIBRARIES-TO-STRING (LIBS)

FUNCALLABLE-LAMBDA-LIST (ARGS)

LOOKUP-FOREIGN-ENCODING (NORMALIZED)

MAKE-LISP-NAME (NAME)

PREPROCESS-ARGS (ARGS)

PREPROCESS-NAMES (NAMES)

PROCESS-FUNCTION-ARGS (ARGS)

PROCESS-ONE-FUNCTION-ARG (ARG)

PROCESS-STRUCT-FIELDS (NAME FIELDS &OPTIONAL (VARIANT NIL))

STRLEN (STR)

MACRO

Public

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.

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.

DEF-CONSTANT (NAME VALUE &KEY (EXPORT NIL))

Macro to define a constant and to export it

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

DEF-TYPE (NAME TYPE)

Generates a (deftype) statement for CL. Currently, only CMUCL supports takes advantage of this optimization.

DEREF-ARRAY (OBJ TYPE I)

Returns a field from a row

DEREF-POINTER (PTR TYPE)

Returns a object pointed

NULL-CHAR-P (VAL)

Returns T if character is NULL

OCTETS-TO-STRING (OCTETS &KEY ENCODING)

Converts a vector of octets to a Lisp string.

Undocumented

ALLOCATE-FOREIGN-STRING (SIZE &KEY (UNSIGNED T))

CHAR-ARRAY-TO-POINTER (OBJ)

CONVERT-FROM-FOREIGN-STRING (OBJ &KEY LENGTH ENCODING (NULL-TERMINATED-P T))

CONVERT-TO-CSTRING (OBJ)

CONVERT-TO-FOREIGN-STRING (OBJ &OPTIONAL ENCODING)

DEF-ARRAY-POINTER (NAME-ARRAY TYPE)

DEF-FOREIGN-TYPE (NAME TYPE)

DEF-FOREIGN-VAR (NAMES TYPE MODULE)

DEF-FUNCTION (NAMES ARGS &KEY MODULE RETURNING)

DEF-POINTER-VAR (NAME VALUE &OPTIONAL DOC)

DEF-STRUCT (NAME &REST FIELDS)

DEF-UNION (NAME &REST FIELDS)

ENSURE-CHAR-CHARACTER (OBJ)

ENSURE-CHAR-INTEGER (OBJ)

ENSURE-CHAR-STORABLE (OBJ)

FREE-CSTRING (OBJ)

FREE-FOREIGN-OBJECT (OBJ)

GET-SLOT-POINTER (OBJ TYPE SLOT)

GET-SLOT-VALUE (OBJ TYPE SLOT)

MAKE-NULL-POINTER (TYPE)

MAKE-POINTER (ADDR TYPE)

NULL-POINTER-P (OBJ)

POINTER-ADDRESS (OBJ)

STRING-TO-OCTETS (STR &KEY ENCODING NULL-TERMINATE)

WITH-CAST-POINTER ((BINDING-NAME POINTER TYPE) &BODY BODY)

WITH-CSTRING ((CSTRING LISP-STRING) &BODY BODY)

WITH-CSTRINGS (BINDINGS &REST BODY)

WITH-FOREIGN-OBJECT ((VAR TYPE) &REST BODY)

WITH-FOREIGN-OBJECTS (BINDINGS &REST BODY)

WITH-FOREIGN-STRING ((FOREIGN-STRING LISP-STRING &OPTIONAL ENCODING) &BODY BODY)

WITH-FOREIGN-STRINGS (BINDINGS &BODY BODY)

Private

Undocumented

%DEF-FUNCTION (NAMES ARGS &KEY MODULE RETURNING)

VARIABLE

Public

*DEFAULT-FOREIGN-ENCODING*

Normalized name of default external character format to use for foreign string conversions. nil means use implementation default encoding.

*FOREIGN-ENCODINGS*

List of normalized names of external formats support by underlying implementation.

Undocumented

+NULL-CSTRING-POINTER+

Private

*CMU-SBCL-DEF-TYPE-LIST*

Conversions in SBCL for def-foreign-type are different than in def-function

*FOREIGN-ENCODING-MAPPING*

Mapping between normalized external format name and implementation name.

*LOADED-LIBRARIES*

List of foreign libraries loaded. Used to prevent reloading a library

Undocumented

*CMU-DEF-TYPE-HASH*

*SYSTEM-COPY-FN*

*TYPE-CONVERSION-LIST*

+TYPE-CONVERSION-HASH+

CONSTANT

Private

Undocumented

+SYSTEM-COPY-MULTIPLIER+

+SYSTEM-COPY-OFFSET+