Subsections


9 Units that come with Free Pascal

Here we list the units that come with the Free Pascal distribution. Since there is a difference in the supplied units per operating system, we first describe the generic ones, then describe those which are operating specific.

1 Standard units

The following units are standard and are meant to be ported to all supported platforms by Free Pascal. A brief description of each unit is also given.

crt
This unit is similar to the unit of the same name of Turbo Pascal. It implements writing to the console in color, moving the text cursor around and reading from the keyboard.
dos
This unit provides basic routines for accessing the operating system. This includes file searching, environment variables access, getting the operating system version, getting and setting the system time. It is to note that some of these routines are duplicated in functionality in the sysutils unit.
getopts
This unit gives you the GNU getopts command-line arguments handling mechanism. It also supports long options.
graph
This unit provides basic graphics handling, with routines to draw lines on the screen, display texts etc. It provides the same functions as the Turbo Pascal unit.
keyboard
provides basic keyboard handling routines in a platform independent way, and supports writing custom drivers.
math
This unit contains common mathematical routines (trigonometric functions, logarithms, etc.) as well as more complex ones (summations of arrays, normalization functions, etc.).
mmx
This unit provides support for mmx extensions in your code.
mouse
provides basic mouse handling routines in a platform independent way, and supports writing custom drivers.
objects
This unit provides the base object for standard Turbo Pascal objects. It also implements File and Memory stream objects, as well as sorted and non-sorted collections, and string streams.
objpas
is used for Delphi compatibility; you should never load this unit explicitly; it is automatically loaded if you request Delphi mode.
printer
This unit provides all you need for rudimentary access to the printer using standard I/O routines.
sockets
This gives the programmer access to sockets and TCP/IP programming.
strings
This unit provides basic string handling routines for the pchar type, comparable to similar routines in standard C libraries.
system
This unit is available for all supported platforms, even though the unit name may be different (e.g : syslinux, sysos2). It includes among others, basic file I/O routines, memory management routines, all compiler helper routines, and directory services routines.
sysutils
is an alternative implementation of the sysutils unit of Delphi. It includes file I/O access routines which takes care of file locking, date and string handling routines, file search, date and string conversion routines.
typinfo
Provides functions to acces Run-Time Type Information, just like Delphi.
video
provides basic screen handling in a platform independent way, and supports writing custom drivers.

2 Under DOS

emu387
This unit provides support for the coprocessor emulator.
go32
This unit provides access to possibilities of the GO32 DOS extender.

3 Under Windows

wincrt
This implements a console in a standard GUI window, contrary to the crt unit which is for the Windows console only.
Windows
This unit provides access to al Win32 API calls. Effort has been taken to make sure that it is compatible to the Delphi version of this unit, so code for Delphi is easily ported to Free Pascal.
opengl
provides access to the low-level opengl functions in WINDOWS.
winmouse
provides access to the mouse in WINDOWS.
ole2
provides access to the OLE capabilities of WINDOWS.
winsock
provides acces to the WINDOWS sockets API Winsock.

4 Under Linux

linux
This unit provides access to the LINUX operating system. It provides most file and I/O handling routines that you may need. It implements most of the standard C library constructs that you will find on a Unix system. If you do a lot of disk/file operations, the use of this unit is recommended over the one you use under Dos.
graph
Is an implementation of Borlands graph unit, which works on the Linux console. Its implementation is as complete as on the other platforms (it shares the same code). It uses the libvga and libvgagl graphics libraries, so you need these installed for this unit to work. Also, programs using this library need to be run as root, or setuid root, and hence are a potential security risk.
ports
This implements the various port[] constructs. These are provided for compatibility only, and it is not recommended to use them extensively. Programs using this construct must be run as ruit or setuid root, and are a serious security risk on your system.

5 Under OS/2

doscalls
interface to doscalls.dll.
dive
interface to dive.dll
emx
provides access to the EMX extender.
pm*
interface units for the program manager functions.
viocalls
interface to viocalls.dll screen handling library.
moucalls
interface to moucalls.dll mouse handling library.
kbdcalls
interface to kbdcalls.dll keyboard handling library.
moncalls
interface to moncalls.dll monitoring handling library.

6 Unit availability

Standard unit availability for each of the supported platforms is given in the FAQ / Knowledge base.




2002-04-25