oki.h

来自「Linux下的无线网卡通用驱动程序」· C头文件 代码 · 共 59 行

H
59
字号
/* * Manifest constants for the ZjStream protocol (okidata flavor) */#include <inttypes.h>typedef uint32_t	DWORD;typedef uint16_t	WORD;typedef uint8_t		BYTE;typedef enum {    OKI_START_PAGE	= 0,    OKI_DATA		= 1,    OKI_END_PAGE	= 255,} OKI_RECTYPE;typedef union _SWAP_32{    char		byte[sizeof(uint32_t)];    uint32_t		dword;} SWAP_32;typedef union _SWAP_16{    char		byte[sizeof(uint16_t)];    uint16_t		word;} SWAP_16;static inline uint32_tbe32(uint32_t dword){    SWAP_32	swap;    uint32_t	probe = 1;    if (((char *)&probe)[0] == 1)    {	swap.byte[3] = (( SWAP_32 )dword).byte[0]; 	swap.byte[2] = (( SWAP_32 )dword).byte[1];	swap.byte[1] = (( SWAP_32 )dword).byte[2]; 	swap.byte[0] = (( SWAP_32 )dword).byte[3];	return swap.dword;    }    else	return dword;}static inline uint16_tbe16(uint16_t word){    SWAP_16	swap;    uint16_t	probe = 1;    if (((char *)&probe)[0] == 1)    {	swap.byte[1] = (( SWAP_16 )word).byte[0]; 	swap.byte[0] = (( SWAP_16 )word).byte[1];	return swap.word;    }    else	return word;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?