From Free Pascal wiki
Jump to navigationJump to search

Deutsch (de) English (en) español (es) français (fr) Bahasa Indonesia (id) 日本語 (ja) русский (ru)

Free Pascal Runtime Library (RTL)

A Run-Time Library is the set of source code files that are used to create the portion of the application which is generated or included by the compiler and used for the following purposes:

  • Initialization of the run-time-library itself prior to activation of the user's application
  • Initialization and startup of the application
  • providing standard Pascal services to the application (support for the Write and Writeln standard functions, for example)
  • providing any library functions which are not defined inline by the compiler such as mathematical routines
  • providing extended Pascal services to the application (support for the Assign extended function to assign a reference to an external file to a file variable).
  • providing a conversion for local equivalents for a standard or extended function into the local equivalent (for example, changing the Write or writeln statement to write to a window in a windowed environment if the file variable is pointing to a window, to write to the screen in a text environment if the file is pointing to the terminal, or to write to a file if the file variable is pointing to an external file.

RTL units

There are many different units with partly overlapping functionality. This is caused by different reasons, especially:

  • FPC tries to be compatible to two different compilers (Turbo Pascal/Borland Pascal and Delphi) with slightly different syntax and different sets of supplied units for two different paradigms (procedural and object oriented programming)
  • FPC supports many different platforms requiring support of both platform specific API functions and common routines available across all or at least most supported platforms.

A simplified overview can be found in this unit categorization. A detailed description of individual units and included routines is available in the RTL unit reference manual provided as part of the FPC documentation.

Using RTL

Some problems using the crt and the video units with unix terminals are described here: Terminal & Fonts

Read about the API units (Video/Mouse/Keyboard) and the Crt Unix, the bigger picture in KVM API and Crt future

The windows interface units have an own page here

Developing RTL

RTL development articles

See Also