df3454768b0b19ff987c5680a5f792e95b04497b
[m6w6/ext-psi] / psi.d / netdb.psi
1 function psi\endhostent() : void {
2 return void(endhostent);
3 }
4 function psi\endnetend() : void {
5 return void(endnetent);
6 }
7 function psi\endprotoent() : void {
8 return void(endprotoent);
9 }
10 function psi\endservent() : void {
11 return void(endservent);
12 }
13
14 function psi\gai_strerror(int $errcode) : string {
15 let errcode = intval($errcode);
16 return to_string(gai_strerror);
17 }
18
19 function psi\getaddrinfo(string $node, string $service, array $hints, object &$res = NULL) : int {
20 let node = strval($node);
21 let service = strval($service);
22 let hints = arrval($hints);
23 let res = &NULL;
24 return to_int(getaddrinfo);
25 set $res = to_array(*res,
26 to_int(ai_flags),
27 to_int(ai_family),
28 to_int(ai_socktype),
29 to_int(ai_protocol),
30 to_int(ai_addrlen),
31 to_string(ai_addr, ai_addrlen),
32 to_string(ai_canonname),
33 to_array(ai_next, ...)
34 );
35 }