Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 3666 → Rev 3846

/branches/network/uspace/srv/net/err.h
31,6 → 31,7
*/
 
/** @file
* Common error processing codes and routines.
*/
 
#ifndef __NET_ERR_H__
38,9 → 39,25
#include <errno.h>
 
/** An actual stored error code.
*/
#define ERROR_CODE error_check_return_value
 
/** An error processing routines declaration.
* This has to be declared in the block where the error processing is desired.
*/
#define ERROR_DECLARE int ERROR_CODE
 
/** Stores the value as an error code and checks if an error occured.
* @param value The value to be checked. May be a function call. Input parameter.
* @returns FALSE if the value indicates success (EOK).
* @returns TRUE otherwise.
*/
#define ERROR_OCCURED( value ) (( ERROR_CODE = ( value )) != EOK )
 
/** Checks if an error occured and immediatelly exits the actual function returning the error code.
* @param value The value to be checked. May be a function call. Input parameter.
*/
#define ERROR_PROPAGATE( value ) if( ERROR_OCCURED( value )) return ERROR_CODE
 
#endif