
/***************************************************************************
**
**    $Header:   D:/ECB2S/SRC/LOG/ERROR/HOSTERRS.H__   1.0.1.1.1.5   17 Apr 1997 16:29:52   ZJRD  $
**
**    $Log:   D:/ECB2S/SRC/LOG/ERROR/HOSTERRS.H__  $
** 
**    Rev 1.0.1.1.1.5   17 Apr 1997 16:29:52   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.4   16 Apr 1997 11:08:36   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.3   10 Apr 1997 15:55:16   ZJRD
** 2.09F
** 
**    Rev 1.0.1.1.1.1   03 Apr 1997 15:32:28   ZJRD
** No change.
** 
**    Rev 1.0.1.1.1.0   28 Mar 1997 10:36:34   ZJRD
** easy pack sld 2.09d
** 
**    Rev 1.0.1.0   19 Mar 1997 11:46:26   ZJRD
** No change.
** 
**    Rev 1.0   12 Mar 1997 15:00:26   ZJRD
** Initial revision.
** 
**    Rev 1.0   09 Dec 1996 10:24:14   ZJRD
** Initial revision.
** 
**    Rev 1.7   11 Jun 1996 10:28:50   ZJRD
** EasyPack/SLD Version 1.97
** 
**    Rev 1.5   05 Jun 1996 14:57:28   ZJRD
** No change.
** 
**    Rev 1.4   29 May 1996 09:35:08   ZJRD
** EasyPack/SLD Version 1.95
** 
**    Rev 1.3   16 May 1996 09:08:10   ZJRD
** No change.
** 
**    Rev 1.2   10 May 1996 09:08:42   ZJRD
** No change.
** 
**    Rev 1.1   02 May 1996 10:24:38   ZJRD
** EasyPack/SLD Version 1.92
** 
**    Rev 1.31   18 Apr 1996 13:00:20   Shirley
** EasyPack/SLD Version 1.91
** 
**    Rev 1.30   12 Apr 1996 10:39:30   Shirley
** EasyPack/SLD Version 1.90
** 
**    Rev 1.0   07 Sep 1995 09:55:40   Shirley
** Initial revision.
**
****************************************************************************/

/****************************************************************************
**
**  Name:  hosterrs.h
**
**  Description:
**     Host system errors are defined here, along with typical masks.
**
**  Status:  CODED
**
**  Date:	3/20/96 	by:  Jamoon
**
**  Copyright (C) 1996 Microtek International.  All rights reserved.
**
*****************************************************************************/

#ifndef _HOSTERRS_

                       /****************************
                        *                          *
                        *       INCLUDE FILES      *
                        *                          *
                        ****************************/
#include "basictyp.h" 

                       /****************************
                        *                          *
                        *        DEFINITIONS       *
                        *                          *
                        ****************************/
#define E_ERRSIZE           256     // maximum size of error text


// E_SEVERITY_MASK mask out the error property 
#define E_SEVERITY_MASK    	0xFF000000L
#define E_UNKNOWN         	0x00000000L
#define E_INFORMATIVE       0x10000000L
#define E_WARNING          	0x01000000L
#define E_ERROR				0x02000000L
#define E_FATAL            	0x04000000L
#define E_SEVERE           	0x08000000L
#define E_SEVERITYID(x) 	( (x) & E_SEVERITY_MASK )

// use E_COMPONET_MASK to mask out the componet that send the error
// detecting component id is upper 2 bytes less top 8 bits 
#define E_COMPONENT_MASK   	0x00FF0000L
#define E_MODULEID(x)  		( (x) & E_COMPONENT_MASK )

// module id define
#define MOD_UNKNOWN			0x00000000L

// error number is lower 2 bytes 
#define E_ERROR_NUMBER_MASK   0x0000FFFFL
#define E_ERRORID(x)  (U16) ((x) & E_ERROR_NUMBER_MASK)


#define E_DIALOG	0
#define E_SHELL		1

// error id and recovery id in errcodec.h
#include "errcodec.h"


                       /****************************
                        *                          *
                        *        PROTOTYPES        *
                        *                          *
                        ****************************/



/*****************************************************************************
** ErrGetErrorText
**
** Description:
**   Retrieve error text or recover text and plug in optional arguments.  
**	 The *caller* is expected to have allocated storage for the return 
**	 string of size E_ERRSIZE if LPSTR is used. 
**	 Optional arguments must fit with the error format string. Refer to 
**	 wvsprintf() window function for the format-control character sequences.
**
** Parameters:
**    input :
**       errCode :   error type, and error number 
**					 or recover type, and recover number
**    output :
**       lpszError : error string
**       strError 
** Return :
**		GOOD(0) for success    FAILURE(-1) for failure	
*****************************************************************************/
RETCODE EXPORT ErrGetErrorText(U32 errorCode, LPSTR lpszError ...);
RETCODE EXPORT ErrGetErrorText(U32 errorCode, CString& strError ...);


/*****************************************************************************
** ErrGetErrorText
**
** Description:
**   Retrieve error text and recover text and plug in optional arguments.  
**	 The *caller* is expected to have allocated storage for the return 
**	 string of size E_ERRSIZE if LPSTR is used
**	 Optional arguments must fit with the error format string. Refer to 
**	 wvsprintf() window function for the format-control character sequences.
**
** Parameters:
**    input :
**       errCode :   error type, and error number 
**		 recCode :	 recover type, and recover number
**    output :
**       lpszError : error string 
**		 lpszRecov : recover string
**       strError  : error CString
**		 strRecov  : recover CString
** Return :
**		GOOD(0) for success    FAILURE(-1) for failure	
*****************************************************************************/
RETCODE EXPORT ErrGetErrorText(U32 errCode,U32 recCode,
				LPSTR lpszError, LPSTR lpszRecov ...);
RETCODE EXPORT ErrGetErrorText(U32 errCode,U32 recCode,
				CString& strError, CString& strRecov ...);



/****************************************************************************
**
**  ErrDisplayError
**
**  Description:
**     Obtain and display the error text corresponding to the given error code
**     with MessageBox, optional arguments must fit with the error  format  
**     string. Refer to wvsprintf() window function for the format-control  
**     character sequences.
**
**  Parameters:
**     input:
**        errCode          error code
**        recCode          recovery code, recCode = 0 for no recovery
**     output:
**
*****************************************************************************/
RETCODE EXPORT ErrDisplayError(U32 errCode, U32 recCode ...);
RETCODE EXPORT ErrDisplayError(U32 errCode);


#define _HOSTERRS_
#endif
/******************************** E O F ***********************************/
