00001
00021 #ifndef __VEC_H__
00022 #define __VEC_H__
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028 #ifdef _WIN32
00029 #define inline __inline // compatible with MS VS 6.0
00030 #pragma warning(disable : 4152) // warning C4152: nonstandard extension, function/data pointer conversion in expression
00031 #pragma warning(disable : 4244) // warning C4244: '+=' : conversion from 'int ' to 'unsigned short ', possible loss of data
00032 #pragma warning(disable : 4514) // warning C4514: 'Vec_StrPop' : unreferenced inline function has been removed
00033 #pragma warning(disable : 4710) // warning C4710: function 'Vec_PtrGrow' not inlined
00034 #endif
00035
00039
00040
00041
00042 #include "leaks.h"
00043
00047
00048 #ifndef ABS
00049 #define ABS(a) ((a) < 0 ? -(a) : (a))
00050 #endif
00051
00052 #ifndef MAX
00053 #define MAX(a,b) ((a) > (b) ? (a) : (b))
00054 #endif
00055
00056 #ifndef MIN
00057 #define MIN(a,b) ((a) < (b) ? (a) : (b))
00058 #endif
00059
00060 #ifndef ALLOC
00061 #define ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
00062 #endif
00063
00064 #ifndef FREE
00065 #define FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
00066 #endif
00067
00068 #ifndef REALLOC
00069 #define REALLOC(type, obj, num) \
00070 ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
00071 ((type *) malloc(sizeof(type) * (num))))
00072 #endif
00073
00074 #ifndef PRT
00075 #define PRT(a,t) printf("%s = ", (a)); printf("%6.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))
00076 #endif
00077
00078 #ifndef PRTP
00079 #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)
00080 #endif
00081
00082 #include "vecInt.h"
00083 #include "vecFlt.h"
00084 #include "vecStr.h"
00085 #include "vecPtr.h"
00086 #include "vecVec.h"
00087 #include "vecAtt.h"
00088
00092
00096
00100
00101 #ifdef __cplusplus
00102 }
00103 #endif
00104
00105 #endif
00106
00110