10 The external Library

10.1 Interfacing to C and Pascal

The external fragment contains a general interface to other programming languages. This interface is provided by the patterns external and cStruct. The external pattern is used to interface to procedures and functions written in other languages e.g. C or Pascal. The cStruct pattern is used to be able to create BETA objects with a structure similar to C structs or Pascal records. This interface is used heavily in the system, e.g. in the interface to UNIX and Macintosh, and in the user interface toolkit. The basic external and cStruct patterns are defined in betaenv and the external fragment defines the specific attributes of these patterns. Furthermore, the external fragment defines the externalRecord pattern, which is used for defining the BETA interface to data structures, allocated by the external language (e.g. C).

For passing strings to and from C programs you can use the CString pattern.

Basic Libraries - Reference Manual
© 1990-2002 Mjølner Informatics
[Modified: Friday October 6th 2000 at 12:00]