X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fnetdb.psi;h=3eca2915c84438512c427f93d9e109c102814be5;hp=259fcec6f436372c8ab3a23f8b5e1e1bb27f43d7;hb=c9b3436bd51a4dcf7d6cc6817d4c7a8ad99538d4;hpb=7ecbe886921997a9ea3c990071c2efb97f13ac21 diff --git a/psi.d/netdb.psi b/psi.d/netdb.psi index 259fcec..3eca291 100644 --- a/psi.d/netdb.psi +++ b/psi.d/netdb.psi @@ -29,7 +29,7 @@ function psi\setservent(bool $stayopen) : void { } function psi\gethostent() : array { - return to_array(gethostent, + return to_array(*gethostent, to_string(h_name), to_array(h_aliases, to_string(h_aliases)), to_int(h_addrtype), @@ -47,7 +47,7 @@ function psi\gai_strerror(int $errcode) : string { function psi\getaddrinfo(string $node, string $service, array $hints, object &$res = NULL) : int { let node = strval($node); let service = strval($service); - let hints = arrval($hints); + let hints = &arrval($hints); let res = &NULL; return to_int(getaddrinfo); set $res = to_array(**res, @@ -60,7 +60,7 @@ function psi\getaddrinfo(string $node, string $service, array $hints, object &$r to_string(ai_canonname), to_array(*ai_next, ...) ); - free freeaddrinfo(res); + free freeaddrinfo(*res); } // extern int getnameinfo(struct sockaddr *sa, socklen_t salen, char *host, socklen_t hostlen, char *serv, socklen_t servlen, int flags)