📄 byteorder.h
字号:
#ifndef _MAIN_H#define _MAIN_H// Byte swapping.#define swap8(A) (A)#define swap16(A) ((((A)&0x00ff)<<8) | ((A)>>8))#define swap32(A) ((((A)&0x000000ff)<<24) | (((A)&0x0000ff00)<<8) | (((A)&0x00ff0000)>>8) | (((A)&0xff000000)>>24))#define htonl(x) swap32(x) // host to network, long#define ntohl(x) swap32(x) // network to host, long#define htons(x) swap16(x) // host to network, short#define ntohs(x) swap16(x) // network to host, short#define htobl(x) swap32(x) // host to big endian, long#define btohl(x) swap32(x) // big endian to host, long#define htobs(x) swap32(x) // host to big endian, short#define btohs(x) swap32(x) // big endian to host, short#define htoll(x) (x) // host to little endian, long#define ltohl(x) (x) // little endian to host, long#define htols(x) (x) // host to little endian, short#define ltohs(x) (x) // little endian to host, short#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -