/*
** SellaNMS
** $Id: defines.h,v 1.3 2006/01/24 07:08:09 sella Exp $
** Copyright (c) 2001-2005 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef __DGS_INCLUDE_DEFS_H
#define __DGS_INCLUDE_DEFS_H

#ifdef HAVE_CONFIG_H
	#include "config.h"
#endif

#define DGS_PROJECT "SellaNMS"
#define DGS_VERSION "2.0.0"

typedef unsigned long RESULT;
typedef unsigned long STATUS;

#define SUCCESS 0
#define FAILURE 1

#define LIBRARY_COMMON		1
#define LIBRARY_POLICY		2
#define LIBRARY_STORAGE		3

#define USLEEP_FASTLOOP_TIME 1000	/* 1/1000 sec wait in tight loops. */
#define USLEEP_NORMLOOP_TIME 250000	/* 1/4 sec wait in wait loops. */
#define USLEEP_LONGLOOP_TIME 750000	/* 3/4 sec wait in long loops. */

#ifdef USE_CONCEPT_CHECKS
	#define _GLIBCPP_CONCEPT_CHECKS /* GCC 3.0, 3.1, 3.2 and 3.3 */
	#define _GLIBCXX_CONCEPT_CHECKS /* GCC 3.4 and higher */
#endif

#define SAFE_FREE(x) if (x != 0) { free(x); x = 0; }
#define SAFE_DELETE(x) if (x != 0) { delete x; x = 0; }
#define SAFE_DELETE_ARRAY(x) if (x != 0) { delete[] x; x = 0; }
#define SAFE_REGFREE(x) if (x->buffer != NULL) { regfree(x); bzero(x, sizeof(regex_t)); } else { abort(); }
#define SAFE_SNMP_FREE_PDU(x) if (x != 0) { snmp_free_pdu(x); x = 0; }

#define BUFSET(x, y, z) memset(x, y, z); x += z;
#define BUFCPY(x, y, z) memcpy(x, &(y), z); x += z;

#endif /* __DGS_DEFS_H */

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim:
** vim: noet ts=3 sw=3
*/
