byteorder.3n
来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 3N 代码 · 共 43 行
3N
43 行
.\" SCCSID: @(#)byteorder.3n 8.2 11/5/90.TH byteorder 3n.SH Namehtonl, htons, ntohl, ntohs \- convert values between host and network byte order.SH Syntax.nf.B #include <sys/types.h>.B #include <netinet/in.h>.PP.B netlong = htonl(hostlong);.B u_long netlong, hostlong;.PP.B netshort = htons(hostshort);.B u_short netshort, hostshort;.PP.B hostlong = ntohl(netlong);.B u_long hostlong, netlong;.PP.B hostshort = ntohs(netshort);.B u_short hostshort, netshort;.fi.SH Description.NXR "byteorder keyword".NXR "htonl subroutine".NXR "htons subroutine".NXR "ntohl subroutine".NXR "ntohs subroutine"These routines convert 16-bit and 32-bit quantities between networkbyte order and host byte order. On some non-ULTRIX machinesthese routines are defined as null macros in the include file<netinet/in.h>..PPThese routines are most often used with Internetaddresses and ports as returned by .MS gethostent 3nand .MS getservent 3n ..SH RestrictionsDigital's systems handle bytes in the reverse of most UNIX-based systems..SH See Alsogethostent(3n), getservent(3n)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?