#ifndef _DWC_ERR_H
#define _DWC_ERR_H

/*--------------------------------------------------------------------------
 *  Copyright (c) 2001-2004 Igor Daniloff. 
 *	All rights reserved.
 *
 * By using this file, you agree to the terms and conditions set
 * forth in the LICENSE file which can be found at this directory.
 *------------------------------------------------------------------------*/
 
/* $Id: dwc_err.h,v 1.20 2005/09/21 09:20:43 asv Exp $ */

/* Internal error codes -- DWC_error_code_t */
#define DWC_NOERROR         (0)    /* no error */
#define DWC_COMMONERROR     (-1)   /* system error or more that one error */
#define DWC_NOMEMORY        (-2)   /* no memory for operation */
#define DWC_BADIPC          (-4)   /* invalid IPC descriptor */
#define DWC_NOTSUPPORTED    (-5)   /* this service not supported */
#define DWC_BADPARAMS       (-6)   /* bad parameters passed */
#define DWC_INVALIDADDR     (-7)   /* invalid transport address for IPC */
#define DWC_ALREADYPERFORM  (-8)   /* operation cannot performed twice */
#define DWC_NOTREADY        (-9)   /* service not ready */
#define DWC_NORESOURCE      (-10)  /* no resources */
#define DWC_IPCSYSTEM       (-11)  /* error in transport subsystem */
#define DWC_TOOLONG         (-12)  /* string too long or value too big */
#define DWC_TIMED           (-13)  /* operation timeouted */
#define DWC_NODATA          (-14)  /* no more data in socket (connection closed) */

#include "dwc_macro.h"
#include "dwc_mutex.h"

#ifdef __cplusplus
extern "C" {
#endif

extern DWC_mutex_t          err_mutex;

extern dwc_string_t         stdlib_error(int code);
#if defined(DW_DEBUGMALLOC)
extern dwc_string_t         dw_strdup( char* str, char* file, int line );
extern dwc_pointer_t        dw_malloc( int size, char* file, int line );
extern dwc_void_t           dw_free( void* ptr, char* file, int line );
#endif /* DEBUGMALLOC */

#ifdef __cplusplus
}
#endif

#endif /* _DWC_ERR_H */
