All Manuals > Foreign Language Interface User Guide and Reference Manual > 7 Function, Macro and Variable Reference

define-c-typedef Macro

Summary

Defines FLI type specifiers corresponding to type specifiers defined using the C typedef command.

Package

fli

Signature

define-c-typedef name-and-options type-description => name

name-and-options ::= name | (name option*)

option ::= (:foreign-name foreign-name)

Arguments
type-description
An FLI type descriptor.
name
A symbol naming the new FLI type.
foreign-name
A string specifying the foreign name of the type.
Values
name
The name of the new FLI type.
Description

The macro define-c-typedef is used to define FLI type specifiers, which corresponds to those defined using the C function typedef. It is a convenience function, as types can also be defined using define-foreign-type.

The FLI type specifier is named by name, with optional foreign name foreign-name.

type-description is not evaluated and the FLI type name will have no parameters.

Notes

foreign-name, specifying the foreign name, is supported only for documentation purposes.

Examples

In the following example three types are defined using the FLI function define-c-typedef, and the corresponding C definitions are then given.

(fli:define-c-typedef intptr (:pointer :int))
(fli:define-c-typedef bar (:struct (one :int)))

These are the corresponding C typedef definitions:

typedef int *intptr;
typedef struct (int one;) bar;
See also

define-c-enum
define-c-struct
define-c-union
define-foreign-type
2 FLI Types


Foreign Language Interface User Guide and Reference Manual - 01 Dec 2021 19:34:58