Library: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: Library
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Back to [[Reserved words]]. | |
| 2 | + | ||
| 3 | + | The reserved word **library**: | |
| 4 | + | ||
| 5 | + | - belongs to shared library programming; | |
| 6 | + | - identifies a unit as a shared library (DLL); | |
| 7 | + | - replaces the reserved word [[Unit|unit]] in shared library units. | |
| 8 | + | ||
| 9 | + | Example of the basic structure of a shared library: | |
| 10 | + | ||
| 11 | + | ``` pascal | |
| 12 | + | library TestLibrary; | |
| 13 | + | ||
| 14 | + | {$mode objfpc} {$H+} | |
| 15 | + | ||
| 16 | + | uses | |
| 17 | + | SysUtils; | |
| 18 | + | ||
| 19 | + | // library subroutine | |
| 20 | + | function cvtString(strIn : string) : PChar; cdecl; | |
| 21 | + | begin | |
| 22 | + | cvtString := PChar(UpperCase(strIn)); | |
| 23 | + | end; | |
| 24 | + | ||
| 25 | + | // exported subroutine(s) | |
| 26 | + | exports | |
| 27 | + | cvtString; | |
| 28 | + | end. | |
| 29 | + | ``` | |
| 30 | + | ||
| 31 | + | --- | |
| 32 | + | *From the Free Pascal wiki, page "Library", as it stood on 2020-02-14 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
