~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to fpcsrc/rtl/os2/dynlibs.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{
 
2
    This file is part of the Free Pascal run time library.
 
3
    Copyright (c) 1999-2000 by the Free Pascal development team
 
4
 
 
5
    Implements OS dependent part for loading of dynamic libraries.
 
6
 
 
7
    See the file COPYING.FPC, included in this distribution,
 
8
    for details about the copyright.
 
9
 
 
10
    This program is distributed in the hope that it will be useful,
 
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
13
 
 
14
 **********************************************************************}
 
15
 
 
16
 
 
17
{$ifdef readinterface}
 
18
 
 
19
{ ---------------------------------------------------------------------
 
20
    Interface declarations
 
21
  ---------------------------------------------------------------------}
 
22
 
 
23
type
 
24
 TLibHandle = longint;
 
25
 
 
26
const
 
27
 NilHandle = 0;
 
28
 
 
29
{$else}
 
30
 
 
31
{ ---------------------------------------------------------------------
 
32
    Implementation section
 
33
  ---------------------------------------------------------------------}
 
34
 
 
35
uses
 
36
 DosCalls;
 
37
 
 
38
function LoadLibrary (Name: AnsiString): TLibHandle;
 
39
var
 
40
 ErrPath: array [0..259] of char;
 
41
 Handle: longint;
 
42
begin
 
43
 if DosLoadModule (@ErrPath, SizeOf (ErrPath), PChar (Name), Handle) = 0
 
44
                                then Result := Handle else Result := NilHandle;
 
45
end;
 
46
 
 
47
function GetProcedureAddress (Lib: TLibHandle; ProcName: AnsiString): pointer;
 
48
var
 
49
 P: pointer;
 
50
begin
 
51
 if DosQueryProcAddr (Lib, 0, PChar (ProcName), P) = 0 then Result := P
 
52
                                                            else Result := nil;
 
53
end;
 
54
 
 
55
function UnloadLibrary (Lib: TLibHandle): boolean;
 
56
begin
 
57
 Result := DosFreeModule (Lib) = 0;
 
58
end;
 
59
 
 
60
{$endif}
 
61