⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 error.c

📁 ucOS 模拟环境
💻 C
字号:
//----------------------------------------------------------------------
// File Name :		giflzw.c
// Project   :		gsm_gprs
// Module    :
// Memo      :
//                Author       Date       Description
//              -----------------------------------------------
//				  dts			  2004.3.10
//               
//----------------------------------------------------------------------


#include "gif_error.h"
#include "gif_include.h"
NODE_TYPE* node;
int top;
int bottom;

//====================================================================================
// Function Name:	void InitErrorStack()
// Purpose      :	initialize error stack 
// Parameter    :	
// Return       :	the top error will be pop out
// Remarks      :	
// Change Log   :	
//                Author       Date       Description	
//              -----------------------------------------------	
//=====================================================================================
void InitErrorStack()
{
	top = bottom = 0 ;
	node = NULL;
	//node = (NODE_TYPE*)malloc(STACK_LEN);
}
//====================================================================================
// Function Name:	ulong Gif_GetLastError()
// Purpose      :	get the last error form error stack 
// Parameter    :	
// Return       :	the top error will be pop out
// Remarks      :	
// Change Log   :	
//                Author       Date       Description	
//              -----------------------------------------------	
//=====================================================================================
ulong Gif_GetLastError()
{
	if(top <= bottom)
	{
		return  STATCK_EMPTY;
	}
	if(node == NULL)
	{
		return ERROR_STACK_ACCESS_ERROR;
	}else
	{
		return node[top--];
	}
}
//====================================================================================
// Function Name:	Bool InsertError(NODE_TYPE e)
// Purpose      :	insert error into error stack
// Parameter    :	
// Return       :	true or false
// Remarks      :	
// Change Log   :	
//                Author       Date       Description	
//              -----------------------------------------------	
//=====================================================================================
Bool InsertError(NODE_TYPE e)
{
	if(top >= STACK_MAXLEN -1)
	{
		return FALSE;
	}
	top++;
	node[top] = e;
	return TRUE;
}
//====================================================================================
// Function Name:	Bool EmptyError()
// Purpose      :	set error stack to empty
// Parameter    :	
// Return       :	none
// Remarks      :	
// Change Log   :	
//                Author       Date       Description	
//              -----------------------------------------------	
//=====================================================================================
Bool EmptyError()
{
	top = bottom = 0 ;
	//free(node);
	return TRUE;
}
//====================================================================================
// Function Name:	void ErrorExit(ulong ErrorHandle)	
// Purpose      :	save error and exit processor
// Parameter    :	
// Return       :	none
// Remarks      :	
// Change Log   :	
//                Author       Date       Description	
//              -----------------------------------------------	
//=====================================================================================
void ErrorExit(NODE_TYPE  ErrorHandle)
{
	InsertError(ErrorHandle);
	exit(EXIT_FAILURE);
}


		



⌨️ 快捷键说明

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