📄 types.h
字号:
#ifndef _TYPES_H_#define _TYPES_H_/* * sizeof (int) == 4; * sizeof (short) == 2; * sizeof (char) == 1; *///* for windows data type compatible */#define _(text) text#define TEXT(text) texttypedef int LONG;typedef unsigned short WORD;typedef unsigned int DWORD;typedef unsigned char BYTE;typedef char TCHAR;typedef int INT32;typedef short INT16;typedef char INT8;typedef unsigned int UINT32;typedef unsigned short UINT16;typedef unsigned char UINT8;typedef int int32;typedef short int16;typedef char int8;typedef unsigned int uint32;typedef unsigned short uint16;typedef unsigned char uint8;typedef struct { const char *program_name; //* program name */ const char *package; //* package name */ const char *version; //* version */ const char *authors; //* authors */ INT32 reserved; //* reserved */} PACKAGE_INFO , *P_PACKAGE_INFO;typedef struct { INT32 debug; //* debug mode, 0: none, 1: debug */ INT32 echo; //* echo mode, 0: none, 1: echo */ INT32 baudrate; //* baudrate */ INT32 port; //* serial port no.: 0, 1, 2, 3, 4, 5, 6, 7 */ INT32 databit; //* data bits, 5, 6, 7, 8 */ INT32 fctrl; //* flow control, 0: None, 1: Hardware, 2: Software */ char parity; //* parity, 'N': none, 'E': even, 'O': odd */ char *stopbit; //* stop bits, 1, 1.5, 2 */ char *device; //* serial port, /dev/ttyS0,1,2,4,5,6,7 */ INT32 reserved; //* reserved */} PORT_INFO , *P_PORT_INFO;typedef struct { P_PACKAGE_INFO pPkgInfo; P_PORT_INFO pPortInfo;} ARGUMENTS , *P_ARGUMENTS;extern P_ARGUMENTS pArgs;#define DEBUG pArgs->pPortInfo->debug//* some useful macros */#ifndef MAX# define MAX(a, b) ((a) > (b) ? (a) : (b))#endif#ifndef MIN# define MIN(a,b) ((a) < (b) ? (a) : (b))#endif#endif //* types.h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -