~ubuntu-branches/ubuntu/lucid/fpc/lucid-proposed

« back to all changes in this revision

Viewing changes to fpcsrc/packages/fcl-net/src/unix/resolve.inc

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-10-09 23:29:00 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20081009232900-553f61m37jkp6upv
Tags: 2.2.2-4
[ Torsten Werner ]
* Update ABI version in fpc-depends automatically.
* Remove empty directories from binary package fpc-source.

[ Mazen Neifer ]
* Removed leading path when calling update-alternatives to remove a Linitian
  error.
* Fixed clean target.
* Improved description of packages. (Closes: #498882)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
uses
 
2
  initc;
 
3
 
 
4
const
 
5
  { Net type }
 
6
  socklib = 'c';
 
7
  AF_INET = 2;
 
8
 
 
9
  { Error constants. Returned by LastError method of THost, TNet}
 
10
 
 
11
  NETDB_INTERNAL= -1;       { see errno }
 
12
  NETDB_SUCCESS = 0;        { no problem }
 
13
  HOST_NOT_FOUND= 1;        { Authoritative Answer Host not found }
 
14
  TRY_AGAIN     = 2;        { Non-Authoritive Host not found, or SERVERFAIL }
 
15
  NO_RECOVERY   = 3;        { Non recoverable errors, FORMERR, REFUSED, NOTIMP }
 
16
  NO_DATA       = 4;        { Valid name, no data record of requested type }
 
17
  NO_ADDRESS    = NO_DATA;  { no address, look for MX record }
 
18
 
 
19
 
 
20
Type
 
21
 
 
22
  { THostEnt Object }
 
23
  THostEnt = record
 
24
    H_Name     : pchar;   { Official name }
 
25
    H_Aliases  : ppchar;  { Null-terminated list of aliases}
 
26
    H_Addrtype : longint;   { Host address type }
 
27
    H_length  : longint;   { Length of address }
 
28
    H_Addr : ppchar;    { null-terminated list of adresses }
 
29
  end;
 
30
  PHostEntry = ^THostEnt;
 
31
 
 
32
  { TNetEnt object }
 
33
  TNetEnt = record
 
34
    N_Name     : pchar;   { Official name }
 
35
    N_Aliases  : ppchar;  { Nill-terminated alias list }
 
36
    N_AddrType : longint; { Net address type }
 
37
    N_net      : Cardinal; { Network number }
 
38
  end;
 
39
  PNetEntry = ^TNetEnt;
 
40
 
 
41
  TServEnt = record
 
42
    s_name    : pchar;    { Service name }
 
43
    s_aliases : ppchar;   { Null-terminated alias list }
 
44
    s_port    : longint;  { Port number }
 
45
    s_proto   : pchar;    { Protocol to use }
 
46
  end;
 
47
  PServEntry = ^TServEnt;
 
48
 
 
49
{ C style calls, linked in from Libc }
 
50
 
 
51
function gethostent : PHostEntry; cdecl; external socklib;
 
52
procedure sethostent (stayopen : longint); cdecl; external socklib;
 
53
procedure endhostent; cdecl; external socklib;
 
54
 
 
55
function getnetent : PNetEntry; cdecl; external socklib;
 
56
procedure setnetent ( Stayopen : Longint);  cdecl; external socklib;
 
57
procedure endnetent; cdecl; external socklib;
 
58
 
 
59
function getservent : PServEntry; cdecl; external socklib;
 
60
procedure setservent (StayOpen : longint); cdecl; external socklib;
 
61
procedure endservent; cdecl; external socklib;
 
62
 
 
63
function getnetbyaddr ( Net : Longint; nettype : Longint) : PNetEntry; cdecl; external socklib;
 
64
function gethostbyname ( Name : Pchar) : PHostEntry; cdecl; external socklib;
 
65
function gethostbyaddr ( Addr : PChar; Len : Longint; HType : Longint) : PHostentry ; cdecl; external socklib;
 
66
function getnetbyname ( Name : pchar) : PNetEntry; cdecl; external socklib;
 
67
function getservbyname (name : pchar  ; protocol : pchar) : PServEntry; cdecl; external socklib;
 
68
function getservbyport (port : longint; protocol : pchar) : PServEntry; cdecl; external socklib;
 
69
 
 
70
function  GetDNSError : libcint;
 
71
 
 
72
begin
 
73
  GetDNSError:=fpgetCerrno;
 
74
end;
 
75
 
 
76
Function InitResolve : Boolean;
 
77
 
 
78
begin
 
79
  Result:=True;
 
80
end;
 
81
 
 
82
Function FinalResolve : Boolean;
 
83
 
 
84
begin
 
85
  Result:=True;
 
86
end;