X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=psi.d%2Fnetdb.psi;h=f37476d186275cf701243b34c6db58e287700871;hp=2b74b2db2e6c9b768f048d32aca03d0d0b93c6fe;hb=3b0b651ea1b555d8d023e45b43e5eb93b23d00a1;hpb=77a446cbcdce6558c00066e5f13e43e8b1b18ff7 diff --git a/psi.d/netdb.psi b/psi.d/netdb.psi index 2b74b2d..f37476d 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), @@ -44,10 +44,15 @@ function psi\gai_strerror(int $errcode) : string { } // extern int getaddrinfo(const char *node, const char *service, const struct addrinfo *hints, struct addrinfo **res) -function psi\getaddrinfo(string $node, string $service, array $hints, object &$res = NULL) : int { +function psi\getaddrinfo(string $node, string $service, array $hints = NULL, object &$res = NULL) : int { let node = strval($node); let service = strval($service); - let hints = &arrval($hints); + let hints = &arrval($hints, + intval($ai_flags), + intval($ai_family), + intval($ai_socktype), + intval($ai_protocol) + ); let res = &NULL; return to_int(getaddrinfo); set $res = to_array(**res,