ass_defs.h

来自「澳洲人写的Cortex,包括uC_IP协议栈」· C头文件 代码 · 共 159 行

H
159
字号
<HTML><HEAD><TITLE>/home/asysweb/public_html/cortex/kernel/src/ass_defs.h</TITLE></HEAD><BODY><pre><font color="#6920ac">/*************************************************************************/</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/*     Copyright (c) 1997-1999 Australian Real Time Embedded Systems     */</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/* PROPRIETARY RIGHTS of Australian Real Time Embedded Systems           */</font><font color="#6920ac">/* are involved in the subject matter of this material. All reproduction,*/</font><font color="#6920ac">/* manufacturing, use, and sales rights pertaining to this subject matter*/</font><font color="#6920ac">/* are governed by the license agreement. The recipient of this software */</font><font color="#6920ac">/* implicitly accepts the terms of the license.                          */</font><font color="#6920ac">/*                                                                       */</font><font color="#6920ac">/*************************************************************************/</font><font color="#6920ac">/************************************************************************* * * FILE NAME * *      ass_defs.h * * SYSTEM COMPONENT * *      Assert and debug support component * * DESCRIPTION * *      This file contains data, constant and macto definitions for *      Debug Support Component. This package defines ASSERT macro *      internaly included into every single CORTEX system service *      to validate input arguments, execution contex and system *      integrity. * * SCCS HISTORY * *      @(#)ass_defs.h  1.7, 06/18/99, 20:45:49 * * AUTHOR * *      Vadim N. Azarovsky * * CREATED * *      07-Feb-1997         by Vadim N. Azarovsky * * REVISION HISTORY * *      NAME                DATE                    REMARKS * **************************************************************************/</font><b><font color='DarkGreen'>#ifndef</font></b><font color="maroon"> __ASS_DEFS__H</font><b><font color='DarkGreen'>#define</font></b> <font color="maroon"><a name="__ASS_DEFS__H">__ASS_DEFS__H</a></font><b><font color='DarkGreen'>#ifdef</font></b><font color="maroon">  __cplusplus</font><i>extern</i> <font color="DarkGreen">"C"</font> {<b><font color='DarkGreen'>#endif</font></b><font color="maroon">  <font color="#6920ac">/* __cplusplus */</font></font><b><font color='DarkGreen'>#include</font></b> <a href="crt_defs.h.FIND-INC"><font color="blue">"crt_defs.h"</font></a><b><font color='DarkGreen'>#include</font></b> <a href="exc_defs.h.FIND-INC"><font color="blue">"exc_defs.h"</font></a><font color="#6920ac">/*********************** *  GLOBAL CONSTANSTS  * ***********************/</font><font color="#6920ac">/******************* *  GLOBAL MACROS  * *******************/</font><font color="#6920ac">/* * ASSE_PRINT macro used internaly by asset component to print out * assertion message. The macro may be redefined by enviromental package * when application use no-standard formated print services */</font><b><font color='DarkGreen'>#ifndef</font></b><font color="maroon"> ASSE_PRINT</font><b><font color='DarkGreen'># define</font></b> <font color="maroon"><a name="ASSE_PRINT">ASSE_PRINT</a></font>(File_a, Line_a, TestCond_a)<b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* ASSE_PRINT */</font></font><font color="#6920ac">/* * ASSE_EXIT is used internaly by asse_Exit to stop application. * Application's environmental package may redifine this service * to provide additional handling. */</font><b><font color='DarkGreen'>#ifndef</font></b><font color="maroon"> ASSE_EXIT</font><b><font color='DarkGreen'># define</font></b> <font color="maroon"><a name="ASSE_EXIT">ASSE_EXIT</a></font> do { } while(1)<b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* ASSE_EXIT */</font></font><font color="#6920ac">/* * The assert test (asse_TestCond_a) should be TRUE in order not to cause * the test condition to fail. * * The following assertion levels are supported: * *      0 - no asserts compiled into the code; *      1 - assert prints file name and line number where *          assert occurred; *      2 - assert prints file name, line number and test condition; */</font><b><font color='DarkGreen'>#ifndef</font></b><font color="maroon"> CRTX_ASSERT     <font color="#6920ac">/* CRTX_ASSERT macro may be redefined on                           application level */</font></font><b><font color='DarkGreen'># if</font></b><font color="maroon"> (ENVI_CRTX_ASSERT_LEVEL == 0)</font><b><font color='DarkGreen'>#  define</font></b> <font color="maroon"><a name="CRTX_ASSERT">CRTX_ASSERT</a></font>(asse_TestCond_a)<b><font color='DarkGreen'># elif</font></b><font color="maroon"> (ENVI_CRTX_ASSERT_LEVEL == 1)</font><b><font color='DarkGreen'>#  define</font></b> <font color="maroon"><a name="CRTX_ASSERT">CRTX_ASSERT</a></font>(asse_TestCond_a) \    (<i>crtx_Void_t</i>)((asse_TestCond_a)?<a href="asse_Passed.FIND-FUNC">asse_Passed</a>() : \                  (<a href="asse_Failed.FIND-FUNC">asse_Failed</a>(<a href="__FILE__.FIND-DEF">__FILE__</a>, <a href="__LINE__.FIND-DEF">__LINE__</a>, <a href="CRTX_NULL.FIND-DEF">CRTX_NULL</a>), \                  <a href="EXCP_RAISE.FIND-DEF">EXCP_RAISE</a>(asse_Exception_g)));<b><font color='DarkGreen'># elif</font></b><font color="maroon"> (ENVI_CRTX_ASSERT_LEVEL &gt;= 2)</font><b><font color='DarkGreen'>#  define</font></b> <font color="maroon"><a name="CRTX_ASSERT">CRTX_ASSERT</a></font>(asse_TestCond_a) \    (<i>crtx_Void_t</i>)((asse_TestCond_a)?<a href="asse_Passed.FIND-FUNC">asse_Passed</a>() : \                  (<a href="asse_Failed.FIND-FUNC">asse_Failed</a>(<a href="__FILE__.FIND-DEF">__FILE__</a>, <a href="__LINE__.FIND-DEF">__LINE__</a>, #asse_TestCond_a), \                  <a href="EXCP_RAISE_SPECIFIC.FIND-DEF">EXCP_RAISE_SPECIFIC</a>(asse_Exception_g, #asse_TestCond_a)));<b><font color='DarkGreen'># endif</font></b><font color="maroon"> <font color="#6920ac">/* (ENVI_CRTX_ASSERT_LEVEL &gt;= 2) */</font></font><b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* CRTX_ASSERT */</font></font><font color="#6920ac">/*********************** *  GLOBAL DATA TYPES  * ***********************/</font><font color="#6920ac">/* None */</font><font color="#6920ac">/***************** *  GLOBAL DATA  * *****************/</font><i>extern</i> <i>excp_Descr_t</i> asse_Exception_g;<font color="#6920ac">/*************************** *  PROCEDURES PROTOTYPES  * ***************************/</font><font color="#6920ac">/* Assert test failed */</font><font size="+1"><i>crtx_Void_t</i> <a href="asse_Failed.FIND-FUNC">asse_Failed</a>(<i>crtx_Char_t</i> *pFile_a, <i>crtx_Int_t</i> Line_a,                        <i>crtx_Char_t</i> *pTestCond_a);</font><font color="#6920ac">/* Assert test passed */</font><font size="+1"><i>crtx_Void_t</i> <a href="asse_Passed.FIND-FUNC">asse_Passed</a>(<i>crtx_Void_t</i>);</font><font color="#6920ac">/* ===== END OF THE DEFINITION FILE ===== */</font><b><font color='DarkGreen'>#ifdef</font></b><font color="maroon">  __cplusplus</font>}<b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* __cplusplus */</font></font><b><font color='DarkGreen'>#endif</font></b><font color="maroon"> <font color="#6920ac">/* __ASS_DEFS__H */</font></font></pre></BODY></HTML>

⌨️ 快捷键说明

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