2005-07-29 17:01:00 +02:00
|
|
|
/**CFile****************************************************************
|
|
|
|
|
|
|
|
|
|
FileName [vec.h]
|
|
|
|
|
|
|
|
|
|
SystemName [ABC: Logic synthesis and verification system.]
|
|
|
|
|
|
|
|
|
|
PackageName [Resizable arrays.]
|
|
|
|
|
|
|
|
|
|
Synopsis [External declarations.]
|
|
|
|
|
|
|
|
|
|
Author [Alan Mishchenko]
|
|
|
|
|
|
|
|
|
|
Affiliation [UC Berkeley]
|
|
|
|
|
|
|
|
|
|
Date [Ver. 1.0. Started - June 20, 2005.]
|
|
|
|
|
|
|
|
|
|
Revision [$Id: vec.h,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
|
|
|
|
|
|
|
|
|
|
***********************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef __VEC_H__
|
|
|
|
|
#define __VEC_H__
|
|
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#define inline __inline // compatible with MS VS 6.0
|
|
|
|
|
#pragma warning(disable : 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression
|
|
|
|
|
#pragma warning(disable : 4244) // warning C4244: '+=' : conversion from 'int ' to 'unsigned short ', possible loss of data
|
|
|
|
|
#pragma warning(disable : 4514) // warning C4514: 'Vec_StrPop' : unreferenced inline function has been removed
|
|
|
|
|
#pragma warning(disable : 4710) // warning C4710: function 'Vec_PtrGrow' not inlined
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef SINT64
|
|
|
|
|
#define SINT64
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
typedef signed __int64 sint64; // compatible with MS VS 6.0
|
|
|
|
|
#else
|
|
|
|
|
typedef long long sint64;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-07-29 17:01:00 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// INCLUDES ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
// this include should be the first one in the list
|
|
|
|
|
// it is used to catch memory leaks on Windows
|
|
|
|
|
#include "leaks.h"
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// MACRO DEFINITIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
#ifndef ABS
|
|
|
|
|
#define ABS(a) ((a) < 0 ? -(a) : (a))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef MAX
|
|
|
|
|
#define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef MIN
|
|
|
|
|
#define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef ALLOC
|
|
|
|
|
#define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef FREE
|
|
|
|
|
#define FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef REALLOC
|
|
|
|
|
#define REALLOC(type, obj, num) \
|
|
|
|
|
((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
|
|
|
|
|
((type *) malloc(sizeof(type) * (num))))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef PRT
|
|
|
|
|
#define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef PRTP
|
|
|
|
|
#define PRTP(a,t,T) printf("%s = ", (a)); printf("%6.2f sec (%6.2f %%)\n", (float)(t)/(float)(CLOCKS_PER_SEC), (T)? 100.0*(t)/(T) : 0.0)
|
2007-09-26 17:01:00 +02:00
|
|
|
#endif
|
|
|
|
|
|
2005-07-29 17:01:00 +02:00
|
|
|
#include "vecInt.h"
|
2008-01-31 05:01:00 +01:00
|
|
|
#include "vecFlt.h"
|
2005-07-29 17:01:00 +02:00
|
|
|
#include "vecStr.h"
|
2005-08-17 17:01:00 +02:00
|
|
|
#include "vecPtr.h"
|
|
|
|
|
#include "vecVec.h"
|
2008-01-31 05:01:00 +01:00
|
|
|
#include "vecAtt.h"
|
2005-07-29 17:01:00 +02:00
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// PARAMETERS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// BASIC TYPES ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2008-01-30 17:01:00 +01:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// FUNCTION DECLARATIONS ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
2006-03-03 17:01:00 +01:00
|
|
|
|
2008-01-31 05:01:00 +01:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2005-07-29 17:01:00 +02:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/// END OF FILE ///
|
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|