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

« back to all changes in this revision

Viewing changes to fpcsrc/packages/base/libc/netdbh.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
 
 
3
const
 
4
   _PATH_HEQUIV = '/etc/hosts.equiv';
 
5
   _PATH_HOSTS = '/etc/hosts';
 
6
   _PATH_NETWORKS = '/etc/networks';
 
7
   _PATH_NSSWITCH_CONF = '/etc/nsswitch.conf';
 
8
   _PATH_PROTOCOLS = '/etc/protocols';
 
9
   _PATH_SERVICES = '/etc/services';
 
10
 
 
11
var
 
12
   h_errno : longint;cvar;external;
 
13
 
 
14
function __h_errno_location:Plongint;cdecl;external clib name '__h_errno_location';
 
15
 
 
16
const
 
17
  NETDB_INTERNAL = -(1);
 
18
  NETDB_SUCCESS = 0;
 
19
  HOST_NOT_FOUND = 1;
 
20
  TRY_AGAIN = 2;
 
21
  NO_RECOVERY = 3;
 
22
  NO_DATA = 4;
 
23
  NO_ADDRESS = NO_DATA;
 
24
  SCOPE_DELIMITER = '%';
 
25
 
 
26
procedure herror(__str:Pchar);cdecl;external clib name 'herror';
 
27
function hstrerror(__err_num:longint):Pchar;cdecl;external clib name 'hstrerror';
 
28
 
 
29
type
 
30
  Phostent = ^hostent;
 
31
  hostent = record
 
32
    h_name: PChar;
 
33
    h_aliases: PPChar;
 
34
    h_addrtype: Integer;
 
35
    h_length: socklen_t;
 
36
    case Byte of
 
37
      0: (h_addr_list: PPChar);
 
38
      1: (h_addr: PPChar);
 
39
  end;
 
40
  PPhostent = ^Phostent;
 
41
 
 
42
procedure sethostent(__stay_open:longint);cdecl;external clib name 'sethostent';
 
43
procedure endhostent;cdecl;external clib name 'endhostent';
 
44
function gethostent:Phostent;cdecl;external clib name 'gethostent';
 
45
function gethostbyaddr(__addr:pointer; __len:__socklen_t; __type:longint):Phostent;cdecl;external clib name 'gethostbyaddr';
 
46
function gethostbyname(__name:Pchar):Phostent;cdecl;external clib name 'gethostbyname';
 
47
function gethostbyname2(__name:Pchar; __af:longint):Phostent;cdecl;external clib name 'gethostbyname2';
 
48
function gethostent_r(__result_buf:Phostent; __buf:Pchar; __buflen:size_t; __result:PPhostent; __h_errnop:Plongint):longint;cdecl;external clib name 'gethostent_r';
 
49
function gethostbyaddr_r(__addr:pointer; __len:__socklen_t; __type:longint; __result_buf:Phostent; __buf:Pchar;
 
50
               __buflen:size_t; __result:PPhostent; __h_errnop:Plongint):longint;cdecl;external clib name 'gethostbyaddr_r';
 
51
function gethostbyname_r(__name:Pchar; __result_buf:Phostent; __buf:Pchar; __buflen:size_t; __result:PPhostent;
 
52
               __h_errnop:Plongint):longint;cdecl;external clib name 'gethostbyname_r';
 
53
function gethostbyname2_r(__name:Pchar; __af:longint; __result_buf:Phostent; __buf:Pchar; __buflen:size_t;
 
54
               __result:PPhostent; __h_errnop:Plongint):longint;cdecl;external clib name 'gethostbyname2_r';
 
55
procedure setnetent(__stay_open:longint);cdecl;external clib name 'setnetent';
 
56
procedure endnetent;cdecl;external clib name 'endnetent';
 
57
function getnetent:Pnetent;cdecl;external clib name 'getnetent';
 
58
function getnetbyaddr(__net:uint32_t; __type:longint):Pnetent;cdecl;external clib name 'getnetbyaddr';
 
59
function getnetbyname(__name:Pchar):Pnetent;cdecl;external clib name 'getnetbyname';
 
60
function getnetent_r(__result_buf:Pnetent; __buf:Pchar; __buflen:size_t; __result:PPnetent; __h_errnop:Plongint):longint;cdecl;external clib name 'getnetent_r';
 
61
function getnetbyaddr_r(__net:uint32_t; __type:longint; __result_buf:Pnetent; __buf:Pchar; __buflen:size_t;
 
62
               __result:PPnetent; __h_errnop:Plongint):longint;cdecl;external clib name 'getnetbyaddr_r';
 
63
function getnetbyname_r(__name:Pchar; __result_buf:Pnetent; __buf:Pchar; __buflen:size_t; __result:PPnetent;
 
64
               __h_errnop:Plongint):longint;cdecl;external clib name 'getnetbyname_r';
 
65
type
 
66
  Pservent = ^servent;
 
67
  servent = record
 
68
       s_name : Pchar;
 
69
       s_aliases : ^Pchar;
 
70
       s_port : longint;
 
71
       s_proto : Pchar;
 
72
    end;
 
73
  PPservent = ^Pservent;
 
74
 
 
75
procedure setservent(__stay_open:longint);cdecl;external clib name 'setservent';
 
76
procedure endservent;cdecl;external clib name 'endservent';
 
77
function getservent:Pservent;cdecl;external clib name 'getservent';
 
78
function getservbyname(__name:Pchar; __proto:Pchar):Pservent;cdecl;external clib name 'getservbyname';
 
79
function getservbyport(__port:longint; __proto:Pchar):Pservent;cdecl;external clib name 'getservbyport';
 
80
function getservent_r(__result_buf:Pservent; __buf:Pchar; __buflen:size_t; __result:PPservent):longint;cdecl;external clib name 'getservent_r';
 
81
function getservbyname_r(__name:Pchar; __proto:Pchar; __result_buf:Pservent; __buf:Pchar; __buflen:size_t;
 
82
               __result:PPservent):longint;cdecl;external clib name 'getservbyname_r';
 
83
function getservbyport_r(__port:longint; __proto:Pchar; __result_buf:Pservent; __buf:Pchar; __buflen:size_t;
 
84
               __result:PPservent):longint;cdecl;external clib name 'getservbyport_r';
 
85
type
 
86
  Pprotoent = ^protoent;
 
87
  protoent = record
 
88
       p_name : Pchar;
 
89
       p_aliases : ^Pchar;
 
90
       p_proto : longint;
 
91
    end;
 
92
  PPprotoent =  ^Pprotoent;
 
93
 
 
94
procedure setprotoent(__stay_open:longint);cdecl;external clib name 'setprotoent';
 
95
procedure endprotoent;cdecl;external clib name 'endprotoent';
 
96
function getprotoent:Pprotoent;cdecl;external clib name 'getprotoent';
 
97
function getprotobyname(__name:Pchar):Pprotoent;cdecl;external clib name 'getprotobyname';
 
98
function getprotobynumber(__proto:longint):Pprotoent;cdecl;external clib name 'getprotobynumber';
 
99
function getprotoent_r(__result_buf:Pprotoent; __buf:Pchar; __buflen:size_t; __result:PPprotoent):longint;cdecl;external clib name 'getprotoent_r';
 
100
function getprotobyname_r(__name:Pchar; __result_buf:Pprotoent; __buf:Pchar; __buflen:size_t; __result:PPprotoent):longint;cdecl;external clib name 'getprotobyname_r';
 
101
function getprotobynumber_r(__proto:longint; __result_buf:Pprotoent; __buf:Pchar; __buflen:size_t; __result:PPprotoent):longint;cdecl;external clib name 'getprotobynumber_r';
 
102
function setnetgrent(__netgroup:Pchar):longint;cdecl;external clib name 'setnetgrent';
 
103
procedure endnetgrent;cdecl;external clib name 'endnetgrent';
 
104
function getnetgrent(__hostp:PPchar; __userp:PPchar; __domainp:PPchar):longint;cdecl;external clib name 'getnetgrent';
 
105
function innetgr(__netgroup:Pchar; __host:Pchar; __user:Pchar; domain:Pchar):longint;cdecl;external clib name 'innetgr';
 
106
function getnetgrent_r(__hostp:PPchar; __userp:PPchar; __domainp:PPchar; __buffer:Pchar; __buflen:size_t):longint;cdecl;external clib name 'getnetgrent_r';
 
107
 
 
108
function rcmd(__ahost:PPchar; __rport:word; __locuser:Pchar; __remuser:Pchar; __cmd:Pchar;
 
109
               __fd2p:Plongint):longint;cdecl;external clib name 'rcmd';
 
110
function rcmd_af(__ahost:PPchar; __rport:word; __locuser:Pchar; __remuser:Pchar; __cmd:Pchar;
 
111
               __fd2p:Plongint; __af:sa_family_t):longint;cdecl;external clib name 'rcmd_af';
 
112
function rexec(__ahost:PPchar; __rport:longint; __name:Pchar; __pass:Pchar; __cmd:Pchar;
 
113
               __fd2p:Plongint):longint;cdecl;external clib name 'rexec';
 
114
function rexec_af(__ahost:PPchar; __rport:longint; __name:Pchar; __pass:Pchar; __cmd:Pchar;
 
115
               __fd2p:Plongint; __af:sa_family_t):longint;cdecl;external clib name 'rexec_af';
 
116
function ruserok(__rhost:Pchar; __suser:longint; __remuser:Pchar; __locuser:Pchar):longint;cdecl;external clib name 'ruserok';
 
117
function ruserok_af(__rhost:Pchar; __suser:longint; __remuser:Pchar; __locuser:Pchar; __af:sa_family_t):longint;cdecl;external clib name 'ruserok_af';
 
118
function rresvport(__alport:Plongint):longint;cdecl;external clib name 'rresvport';
 
119
function rresvport_af(__alport:Plongint; __af:sa_family_t):longint;cdecl;external clib name 'rresvport_af';
 
120
 
 
121
type
 
122
  Paddrinfo = ^addrinfo;
 
123
  addrinfo = record
 
124
       ai_flags : longint;
 
125
       ai_family : longint;
 
126
       ai_socktype : longint;
 
127
       ai_protocol : longint;
 
128
       ai_addrlen : socklen_t;
 
129
       ai_addr : Psockaddr;
 
130
       ai_canonname : Pchar;
 
131
       ai_next : Paddrinfo;
 
132
    end;
 
133
  PPaddrinfo = ^Paddrinfo;
 
134
 
 
135
  Pgaicb = ^gaicb;
 
136
  gaicb = record
 
137
       ar_name : Pchar;
 
138
       ar_service : Pchar;
 
139
       ar_request : Paddrinfo;
 
140
       ar_result : Paddrinfo;
 
141
       __return : longint;
 
142
       __unused : array[0..4] of longint;
 
143
    end;
 
144
  PPgaicb = ^Pgaicb;
 
145
 
 
146
 
 
147
const
 
148
  GAI_WAIT = 0;
 
149
  GAI_NOWAIT = 1;
 
150
 
 
151
  AI_PASSIVE = $0001;
 
152
  AI_CANONNAME = $0002;
 
153
  AI_NUMERICHOST = $0004;
 
154
  EAI_BADFLAGS = -(1);
 
155
  EAI_NONAME = -(2);
 
156
  EAI_AGAIN = -(3);
 
157
  EAI_FAIL = -(4);
 
158
  EAI_NODATA = -(5);
 
159
  EAI_FAMILY = -(6);
 
160
  EAI_SOCKTYPE = -(7);
 
161
  EAI_SERVICE = -(8);
 
162
  EAI_ADDRFAMILY = -(9);
 
163
  EAI_MEMORY = -(10);
 
164
  EAI_SYSTEM = -(11);
 
165
 
 
166
  EAI_INPROGRESS = -(100);
 
167
  EAI_CANCELED = -(101);
 
168
  EAI_NOTCANCELED = -(102);
 
169
  EAI_ALLDONE = -(103);
 
170
  EAI_INTR = -(104);
 
171
 
 
172
  NI_MAXHOST = 1025;
 
173
  NI_MAXSERV = 32;
 
174
  NI_NUMERICHOST = 1;
 
175
  NI_NUMERICSERV = 2;
 
176
  NI_NOFQDN = 4;
 
177
  NI_NAMEREQD = 8;
 
178
  NI_DGRAM = 16;
 
179
 
 
180
function getaddrinfo(__name:Pchar; __service:Pchar; __req:Paddrinfo; __pai:PPaddrinfo):longint;cdecl;external clib name 'getaddrinfo';
 
181
procedure freeaddrinfo(__ai:Paddrinfo);cdecl;external clib name 'freeaddrinfo';
 
182
function gai_strerror(__ecode:longint):Pchar;cdecl;external clib name 'gai_strerror';
 
183
function getnameinfo(__sa:Psockaddr; __salen:socklen_t; __host:Pchar; __hostlen:socklen_t; __serv:Pchar;
 
184
               __servlen:socklen_t; __flags:dword):longint;cdecl;external clib name 'getnameinfo';
 
185
function getaddrinfo_a(__mode:longint; __list: PPgaicb; __ent:longint; __sig:Psigevent):longint;cdecl;external clib name 'getaddrinfo_a';
 
186
function gai_suspend(__list:array of Pgaicb; __ent:longint; __timeout:Ptimespec):longint;cdecl;external clib name 'gai_suspend';
 
187
function gai_error(__req:Pgaicb):longint;cdecl;external clib name 'gai_error';
 
188
function gai_cancel(__gaicbp:Pgaicb):longint;cdecl;external clib name 'gai_cancel';
 
189
 
 
190
{ ---------------------------------------------------------------------
 
191
    Borland compatibility types
 
192
  ---------------------------------------------------------------------}
 
193
 
 
194
Type
 
195
  THostEnt = hostent;
 
196
  TServEnt = servent;
 
197
  TProtoEnt = protoent;
 
198
  TAddressInfo = addrinfo;
 
199