projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
#pragma lib
[m6w6/ext-psi]
/
psi.d
/
arpa_inet.psi
diff --git
a/psi.d/arpa_inet.psi
b/psi.d/arpa_inet.psi
index a9dbfbc2ab6a4608abe28fde4d33f419bdc0880a..b38fc3d77a6479dfc2a794fee555587e9fcec699 100644
(file)
--- a/
psi.d/arpa_inet.psi
+++ b/
psi.d/arpa_inet.psi
@@
-1,3
+1,5
@@
+#include <arpa/inet.h>
+
function psi\htonl(int $l) : int {
let l = intval($l);
return htonl(l) as to_int(htonl);
function psi\htonl(int $l) : int {
let l = intval($l);
return htonl(l) as to_int(htonl);
@@
-32,7
+34,7
@@
function psi\inet_ntoa(array $in) : string {
function psi\inet_ntop(int $af, string $src) : string {
let af = intval($af);
let src = strval($src);
function psi\inet_ntop(int $af, string $src) : string {
let af = intval($af);
let src = strval($src);
- let size =
psi\SIZEOF_STRUCT_SOCKADDR_STORAGE
;
+ let size =
sizeof(struct sockaddr_storage)
;
let dst = calloc(1, size);
return inet_ntop(af, src, dst, size) as to_string(inet_ntop);
}
let dst = calloc(1, size);
return inet_ntop(af, src, dst, size) as to_string(inet_ntop);
}
@@
-40,7
+42,7
@@
function psi\inet_ntop(int $af, string $src) : string {
function psi\inet_pton(int $af, string $src, string &$dst) : int {
let af = intval($af);
let src = strval($src);
function psi\inet_pton(int $af, string $src, string &$dst) : int {
let af = intval($af);
let src = strval($src);
- let dst = calloc(1,
psi\SIZEOF_STRUCT_SOCKADDR_STORAGE
);
+ let dst = calloc(1,
sizeof(struct sockaddr_storage)
);
return inet_pton(af, src, dst) as to_int(inet_pton);
return inet_pton(af, src, dst) as to_int(inet_pton);
- set $dst = to_string(dst, psi\SIZEOF_STRUCT_SOCKADDR_STORAGE);
-}
\ No newline at end of file
+ set $dst = to_string(dst, sizeof(struct sockaddr_storage));
+}