📄 util.h
字号:
/* util.h - Nereid USB Monitor / Utility * Copyright (C) 2003 Tachibana Eriko * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */#ifndef util_h#define util_h#include <stdio.h>/* 16恑悢僟儞僾 */static __inline voidhexdump (unsigned char* buf, int len){ while (--len >= 0) printf (len ? "%02x " : "%02x", *buf++);}/* 2僶僀僩忋壓斀揮撉傒崬傒 */#define read_w(n) read_wp (&n)static __inline unsigned intread_wp (unsigned short* n){ unsigned char* p = (unsigned char*) n; return (p[1] << 8) + p[0];}/* 2僶僀僩忋壓斀揮 */static __inline unsigned intswap_w (unsigned short n){ return ((n << 8) + (n >> 8)) & 0xffff;}#endif /* !usbmon_h *//* EOF */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -