📄 ht
字号:
@c ----------------------------------------------------------------------
@node htonl, misc
@heading @code{htonl}
@subheading Syntax
@example
u_long htonl(u_long val);
@end example
@subheading Description
This function converts from host formatted longs to network formatted
longs. For the i386 and higher processors, this means that the bytes
are swapped from 1234 order to 4321 order.
@subheading Return Value
The network-order value.
@subheading Example
@example
packet.ipaddr = htonl(ip);
@end example
@c ----------------------------------------------------------------------
@node htons, misc
@heading @code{htons}
@subheading Syntax
@example
u_short htonl(u_short val);
@end example
@subheading Description
This function converts from host formatted shorts to network formatted
shorts. For the i386 and higher processors, this means that the bytes
are swapped from 12 order to 21 order.
@subheading Return Value
The network-order value.
@subheading Example
@example
tcp.port = htons(port);
@end example
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -