📄 _define.h
字号:
/**********************************************************************
Project: UT28
File Name: _Define.H
Author: Indy Yang
Date: 1. 2001
Compiler: TLCS--900 or Microsoft Visual C++ 5.0
Module: Common header definition file
Description: The first header file to be included
Copyright (C) 2001 UTStarcom (Hangzhou) Telecom Co., Ltd.
All rights reserved.
***********************************************************************/
/* Provent from multi-include*/
#ifndef __DEFINE_H_
#define __DEFINE_H_
#ifdef __cplusplus
extern "C" {
#endif
#define _ASSERT_ON //open the assert
#define _ARM_ 1
/* T900 C Compiler support far pointer only*/
#ifdef _T900_
#define _NEAR
#define _FAR
#define _TINY
#endif
/* ON PC, the platform is 32 bit */
#ifdef _ONPC_
#define _NEAR
#define _FAR
#define _TINY
#endif
#ifdef _ARM_
#define _NEAR
#define _FAR
#define _TINY
#endif
#define _CONST const
/* To support both PC Platform (32 bit int) and T900 platform (16 bit int), DO please use following data type */
/* Typedef */
typedef void _VOID;
typedef char _CHAR;
typedef unsigned char _BYTE;
typedef unsigned short _WORD;
typedef short _INT;
typedef unsigned short _UINT;
typedef long _LONG;
typedef unsigned long _ULONG;
typedef _BYTE _BOOL;
typedef _ULONG _DWORD;
typedef short _SHORT;
typedef volatile unsigned char _VBYTE;
typedef volatile unsigned short _VWORD;
typedef volatile short _VDWORD;
/* NEAR Pointer */
typedef _VOID _NEAR * _PVOID;
typedef _CHAR _NEAR * _PCHAR;
typedef _PCHAR _PSTR;
typedef _BYTE _NEAR *_PBYTE;
typedef _WORD _NEAR *_PWORD;
typedef _INT _NEAR *_PINT;
typedef _UINT _NEAR *_PUINT;
typedef _LONG _NEAR *_PLONG;
typedef _ULONG _NEAR *_PULONG;
typedef _BOOL _NEAR *_PBOOL;
typedef _DWORD _NEAR *_PDWORD;
/* FAR Pointer */
typedef _VOID _FAR *_LPVOID;
typedef _CHAR _FAR *_LPCHAR;
typedef _LPCHAR _LPSTR;
typedef _CONST _LPSTR _LPCTSTR;
typedef _BYTE _FAR *_LPBYTE;
typedef _WORD _FAR *_LPWORD;
typedef _INT _FAR *_LPINT;
typedef _UINT _FAR *_LPUINT;
typedef _LONG _FAR *_LPLONG;
typedef _ULONG _FAR *_LPULONG;
typedef _BOOL _FAR *_LPBOOL;
typedef _DWORD _FAR *_LPDWORD;
/* Define for _HANDLE */
typedef _LPVOID _HANDLE;
/* Define for _mallocate */
typedef unsigned int _SIZE_T;
/* POINT TYPE */
typedef struct _tagPOINT
{
_SHORT x; /* X coordinate */
_SHORT y; /* Y coordinate */
} _POINT, _NEAR *_PPOINT, _FAR *_LPPOINT;
#define MAKEPOINT(l) (*((_POINT _FAR *)&(l)))
/* RECT TYPE */
#ifdef _ARM607_
__packed
#endif
typedef struct _tagRECT
{
_SHORT Left; /* left coordinate */
_SHORT Top; /* right coordinate */
_SHORT Right; /* right coordinate */
_SHORT Bottom; /* bottom coordinate */
} _RECT, _NEAR *_PRECT, _FAR *_LPRECT;
/* macro for GetRectWidth and get rect height */
#define _GetRectWidth(x) _max( 0, ((x)->Right-(x)->Left)+1 )
#define _GetRectHeight(x) _max( 0, ((x)->Bottom-(x)->Top)+1 )
/* Define no parameter call back function */
typedef _VOID ( _FAR * _NOPARAMPROC )( _VOID );
/* define */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#undef NULL // Yang yajiang
#define NULL 0
#ifndef ON
#define ON 1
#endif
#ifndef OFF
#define OFF 0
#endif
#if 0
/* Define bit0 to bit15 */
#define BIT0 0x01
#define BIT1 0x02
#define BIT2 0x04
#define BIT3 0x08
#define BIT4 0x10
#define BIT5 0x20
#define BIT6 0x40
#define BIT7 0x80
#define BIT8 0x0100
#define BIT9 0x0200
#define BIT10 0x0400
#define BIT11 0x0800
#define BIT12 0x1000
#define BIT13 0x2000
#define BIT14 0x4000
#define BIT15 0x8000
#endif
/* Macro for MAKEWORD */
#ifndef MAKEWORD
#define MAKEWORD(a, b) ((_WORD)(((_BYTE)(a)) | ((_WORD)((_BYTE)(b))) << 8))
#define MAKELONG(a, b) ((_LONG)(((_WORD)(a)) | ((_DWORD)((_WORD)(b))) << 16))
#endif
/* Macro for LOWORD */
#ifndef LOWORD
#define LOWORD(l) ((_WORD)(l))
#define HIWORD(l) ((_WORD)(((_DWORD)(l) >> 16) & 0xFFFF))
#define LOBYTE(w) ((_BYTE)(w))
#define HIBYTE(w) ((_BYTE)(((_WORD)(w) >> 8) & 0xFF))
#endif
/* Macro for _max */
#ifndef _max
#define _max(a,b) (((a) > (b)) ? (a) : (b))
#endif
/* Macro for _min */
#ifndef _min
#define _min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifdef _DEBUG /* If define _DEBUG, enalbe assert function ON */
#define __ASSERT(x) _DebugAssert(((_LONG)(x)),(_LPSTR)__FILE__, (_INT)__LINE__)
extern void _DebugAssert( _LONG condition, _LPSTR inFile, _INT inLine );
#else
#define __ASSERT(x) /* else, disable assert function */
#endif
#ifdef __cplusplus
}
#endif
#endif /* END of __DEFINE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -