All Manuals > LispWorks Foreign Language Interface User Guide and Reference Manual

NextPrevTopIndex

Contents

Preface

1 Introduction to the FLI

1.1 An example of interfacing to a foreign function

1.1.1 Defining the FLI function

1.1.2 Loading foreign code

1.1.3 Calling foreign code

1.2 Using the FLI to get the cursor position

1.2.1 Defining FLI types

1.2.2 Defining a FLI function

1.2.3 Accessing the results

1.3 Using the FLI to set the cursor position

1.4 An example of dynamic memory allocation

1.5 Summary

2 FLI Types

2.1 Immediate types

2.1.1 Integral types

2.1.2 Floating point types

2.1.3 Character types

2.1.4 Boolean types

2.1.5 Pointer types

2.2 Aggregate types

2.2.1 Arrays

2.2.2 Strings

2.2.3 Structures and unions

2.3 Parameterized types

2.4 Encapsulated types

2.4.1 Passing Lisp objects to C

2.4.2 An example

2.5 The void type

2.6 Summary

3 FLI Pointers

3.1 Creating and copying pointers

3.1.1 Creating pointers

3.1.2 Copying pointers

3.1.3 Allocation of FLI memory

3.2 Pointer testing functions

3.3 Pointer dereferencing and coercing

3.4 An example of dynamic pointer allocation

3.5 More examples of allocation and pointer allocation

3.6 Summary

4 Advanced Uses of the FLI

4.1 Passing a string to a Windows function

4.2 Modifying, passing and returning strings

4.2.1 Use of Reference Arguments

4.2.2 Modifying a string in a C function

4.2.3 Passing a constant string

4.2.4 Returning a string via a buffer

4.2.5 Calling a C function that takes an array of strings

4.2.6 Foreign string encodings

4.2.7 Foreign string line terminators

4.2.8 Win32 API functions that handle strings

4.2.9 Mapping Nil to a Null Pointer

4.3 Lisp integers

4.4 Defining new types

4.5 Foreign callables and foreign functions

4.5.1 Strings and foreign callables

4.6 Using DLLs within the LispWorks FLI

4.6.1 Using C DLLs

4.6.1.1 Testing whether a function is defined

4.6.2 Using C++ DLLs

4.7 Incorporating a foreign module into a LispWorks image

4.8 Block objects in C (foreign blocks)

4.8.1 Calling foreign code that receives a block as argument

4.8.2 Operations on foreign blocks

4.8.3 Scope of invocation

4.9 Interfacing to graphics functions

4.10 Summary

5 Function and Macro Reference

align-of

alloca

allocate-dynamic-foreign-object

allocate-foreign-block

allocate-foreign-object

cast-integer

connected-module-pathname

convert-from-foreign-string

convert-integer-to-dynamic-foreign-object

convert-to-foreign-string

convert-to-dynamic-foreign-string

copy-pointer

decf-pointer

define-c-enum

define-c-struct

define-c-typedef

define-c-union

define-foreign-block-callable-type

define-foreign-block-invoker

define-foreign-callable

define-foreign-converter

define-foreign-forward-reference-type

define-foreign-funcallable

define-foreign-function

define-foreign-pointer

define-foreign-type

define-foreign-variable

define-opaque-pointer

dereference

disconnect-module

enum-symbol-value

enum-value-symbol

enum-values

enum-symbols

enum-symbol-value-pairs

fill-foreign-object

foreign-aref

foreign-array-dimensions

foreign-array-element-type

foreign-array-pointer

foreign-block-copy

foreign-block-release

foreign-slot-names

foreign-slot-offset

foreign-slot-pointer

foreign-slot-type

foreign-slot-value

foreign-type-equal-p

foreign-type-error

foreign-typed-aref

free

free-foreign-block

free-foreign-object

get-embedded-module

get-embedded-module-data

incf-pointer

install-embedded-module

*locale-external-formats*

make-integer-from-bytes

make-pointer

malloc

module-unresolved-symbols

*null-pointer*

null-pointer-p

pointer-address

pointer-element-size

pointer-element-type

pointer-element-type-p

pointer-eq

pointer-pointer-type

pointerp

print-collected-template-info

print-foreign-modules

register-module

replace-foreign-array

replace-foreign-object

set-locale

set-locale-encodings

setup-embedded-module

size-of

start-collecting-template-info

with-coerced-pointer

with-dynamic-foreign-objects

with-dynamic-lisp-array-pointer

with-foreign-block

with-foreign-slots

with-foreign-string

with-integer-bytes

with-local-foreign-block

6 Type Reference

:boolean

:byte

:c-array

:char

:const

:double

:ef-mb-string

:ef-wc-string

:enum

:enumeration

:fixnum

:float

:foreign-array

foreign-block-pointer

:function

:int

:int8

:int16

:int32

:int64

:intmax

:intptr

:lisp-array

:lisp-double-float

:lisp-float

:lisp-simple-1d-array

:lisp-single-float

:long

:long-long

:one-of

:pointer

:ptr

:ptrdiff-t

:reference

:reference-pass

:reference-return

:short

:signed

:size-t

:ssize-t

:struct

:time-t

:uint8

:uint16

:uint32

:uint64

:uintmax

:uintptr

:union

:unsigned

:void

:volatile

:wchar-t

:wrapper

7 The Foreign Parser

7.1 Introduction

7.1.1 Requirements

7.2 Loading the Foreign Parser

7.3 Using the Foreign Parser

7.4 Using the LispWorks Editor

7.4.1 Processing Foreign Code with the Editor

7.4.2 Compiling and Loading Foreign Code with the Editor

7.5 Foreign Parser Reference

*preprocessor*

*preprocessor-format-string*

*preprocessor-include-path*

*preprocessor-options*

process-foreign-file

Glossary

Index

 


LispWorks Foreign Language Interface User Guide and Reference Manual - 7 Dec 2011

NextPrevTopIndex