/**************************************************************************** | | (C) Copyright 1985, 1991, 1993, 1996, 1997 Novell, Inc. | All Rights Reserved. | | This program is free software; you can redistribute it and/or | modify it under the terms of version 2 of the GNU General Public | License as published by the Free Software Foundation. | | This program is distributed in the hope that it will be useful, | but WITHOUT ANY WARRANTY; without even the implied warranty of | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | GNU General Public License for more details. | | You should have received a copy of the GNU General Public License | along with this program; if not, contact Novell, Inc. | | To contact Novell about this file by physical or electronic mail, | you may find current contact information at www.novell.com | |*************************************************************************** | | NetWare Advance File Services (NSS) Initialization module | |--------------------------------------------------------------------------- | | $Author: gpachner $ | $Date: 2006-09-14 03:22:08 +0530 (Thu, 14 Sep 2006) $ | | $RCSfile$ | $Revision: 1529 $ | |--------------------------------------------------------------------------- | This module is used to: | Internal modules that contains the macros and defines for NSS | error codes. | | WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! | | This header file should ONLY be used for NSS internal development. | This includes Semantic Agents (SA) and Loadable Storage Services (LSS). | Any other use may cause conflicts which NSS will NOT fix. +-------------------------------------------------------------------------*/ #ifndef _XERROR_H_ #define _XERROR_H_ #ifndef _ZOMNI_H_ # include #endif #ifdef __cplusplus extern "C" { #endif /* Pre-define struct(s) so Linux compiler doesn't complain */ struct GeneralMsg_s; /*--------------------------------------------------------------------- * Functions and macros used to Set, Clear and Transalte error values. *---------------------------------------------------------------------*/ extern void LB_SetErrno( struct GeneralMsg_s *msg, STATUS err, char *where); void LB_ForceSetErrnoWithWhere( struct GeneralMsg_s *genMsg, STATUS status, char *where ); #if 1 #define ForceSetErrno(_genMsg,_error) LB_ForceSetErrnoWithWhere( _genMsg, _error, WHERE ) #define ForceSetErrnoWithWhere(_genMsg,_error,_where) LB_ForceSetErrnoWithWhere( _genMsg, _error, _where ) #else #define ForceSetErrno(_genmsg,errval) ( ((_genmsg)->errStatus = (errval)), \ ((_genmsg)->errStatusSetter = (WHERE)) ) #define ForceSetErrnoWithWhere(_genmsg,errval,_where) ( ((_genmsg)->errStatus = (errval)), \ ((_genmsg)->errStatusSetter = (_where)) ) #endif #define SetErrno( _genMsg, _error ) LB_SetErrno( _genMsg, _error, WHERE ) #define ClearErrno(_genmsg) ( ((_genmsg)->errStatus = zOK), \ ((_genmsg)->errStatusSetter = (WHERE)) ) #define GetErrno(_genmsg) ((_genmsg)->errStatus) #define GetErrnoSetter(_genmsg) ((_genmsg)->errStatusSetter) extern void MSG_SetStatus( void *msg, STATUS status, char *where); #define ForceSetStatus(_msg, _err) (((_msg)->sys.status = (errval)), \ ((_msg)->sys.where = (WHERE))) #define SetStatus(_msg, _err) MSG_SetStatus((_msg), (_err), (WHERE)) #define ClearStatus(_msg) (((_msg)->sys.status = zOK), \ ((_msg)->sys.where = (WHERE))) #define GetStatus(_msg) ((_msg)->sys.status) #define GetStatusSetter(_msg) ((_msg)->sys.where) #define SetErrnoFromStatus(_genMsg, _msg) \ (((_genMsg)->errStatus = (_msg)->sys.status), \ ((_genMsg)->errStatusSetter = (_msg)->sys.where)) #define SetStatusFromErrno(_msg, _genMsg) \ (((_msg)->sys.status = (_genMsg)->errStatus), \ ((_msg)->sys.where = (_genMsg)->errStatusSetter)) /*--------------------------------------------------------------------- * Internal development-only error codes *---------------------------------------------------------------------*/ #define zERR_FAILURE 24999/* use this if you want * to return an error but * don't want to find the * exact error now. * These should all go * away before a release*/ /*------------------------------------------------------------------------- * Include the error codes *-------------------------------------------------------------------------*/ #ifndef _ZERROR_H_ # include #endif #ifdef __cplusplus } #endif #endif /* _XERROR_H_ */