📄 ttype.h
字号:
/*
* File: ttype.h
*
* Purpose: Define basic common types, macros and compiler directives
*/
#ifndef __TTYPE_H__
#define __TTYPE_H__
/******* Common definitions and typedefs *************************************/
//--------------------------------------
// Define data types
//--------------------------------------
typedef signed int INT; // int (size depend on platform)
typedef signed char INT8; // 8-bit int
typedef signed short INT16; // 16-bit int
typedef signed long INT32; // 32-bit int
typedef unsigned int UINT; // unsigned int (size depend on platform)
typedef unsigned char UINT8; // 8-bit value
typedef unsigned short UINT16; // 16-bit value
typedef unsigned long UINT32; // 32-bit value
typedef char CHAR; // 8-bit
typedef INT BOOL; // int (size depend on platform)
typedef INT FLAG; // int
typedef UINT BITS8; // < 8-bit bit field
typedef void VOID;
//--------------------------------------
// Define pointer types
//--------------------------------------
typedef INT* PINT;
typedef INT8* PINT8;
typedef INT16* PINT16;
typedef INT32* PINT32;
typedef UINT* PUINT;
typedef UINT8* PUINT8;
typedef UINT16* PUINT16;
typedef UINT32* PUINT32;
typedef CHAR* PCHAR;
typedef CHAR* PSTR;
typedef BOOL* PBOOL;
typedef void* PVOID;
typedef const INT* PCINT;
typedef const INT8* PCINT8;
typedef const INT16* PCINT16;
typedef const INT32* PCINT32;
typedef const UINT* PCUINT;
typedef const UINT8* PCUINT8;
typedef const UINT16* PCUINT16;
typedef const UINT32* PCUINT32;
typedef const CHAR* PCCHAR;
typedef const CHAR* PCSTR;
typedef const BOOL* PCBOOL;
typedef const void* PCVOID;
//--------------------------------------
// Define frequently used constants
//--------------------------------------
#if !defined(NULL)
#ifdef __cplusplus
#define NULL (0)
#else
#define NULL ((void*)0)
#endif // __cplusplus
#endif // !NULL
#if !defined(TRUE)
#define TRUE (1)
#endif
#if !defined(FALSE)
#define FALSE (0)
#endif
#if !defined(SUCCESS)
#define SUCCESS (0)
#endif
#if !defined(FAILED)
#define FAILED (-1)
#endif
#if !defined(ENABLE)
#define ENABLE (1)
#endif
#if !defined(DISABLE)
#define DISABLE (0)
#endif
/****** Misc definitions, types, macros **************************************/
//--------------------------------------
// Max value for various types
//--------------------------------------
#if !defined(UINT8_MAX)
#define UINT8_MAX (0xFF)
#endif
#if !defined(UINT16_MAX)
#define UINT16_MAX (0xFFFF)
#endif
#if !defined(UINT32_MAX)
#define UINT32_MAX (0xFFFFFFFFUL)
#endif
// null function
#if !defined(FUNC_NULL)
#define FUNC_NULL() do {} while (0)
#endif
// volatile pointer for memory-mapped register access
#define VPUINT32 (volatile UINT32*)
// pointer to hook function
typedef void (* PFN_HOOK )(void);
// pointer to hook function with one argument
typedef void (* PFN_HOOK_PV )(void*);
#endif /* __TTYPE_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -