… | |
… | |
80 | #define PKTCACHESIZE 16 // the size of the memory pool for packets |
80 | #define PKTCACHESIZE 16 // the size of the memory pool for packets |
81 | |
81 | |
82 | extern char *confbase; // directory in which all config files are |
82 | extern char *confbase; // directory in which all config files are |
83 | extern char *thisnode; // config for current node (TODO: remove) |
83 | extern char *thisnode; // config for current node (TODO: remove) |
84 | |
84 | |
|
|
85 | template<typename T, typename U> static inline T min (T a, U b) { return a < (T)b ? a : (T)b; } |
|
|
86 | template<typename T, typename U> static inline void min_it (T &a, U b) { a = a < (T)b ? a : (T)b; } |
|
|
87 | template<typename T, typename U> static inline T max (T a, U b) { return a > (T)b ? a : (T)b; } |
|
|
88 | template<typename T, typename U> static inline void max_it (T &a, U b) { a = a > (T)b ? a : (T)b; } |
|
|
89 | |
|
|
90 | template<typename T, typename U, typename V> static inline T clamp (T v, U a, V b) { return v < (T)a ? a : v >(T)b ? b : v; } |
|
|
91 | |
|
|
92 | template<typename T, typename U> static inline void swap (T& a, U& b) { T t=a; a=(T)b; b=(U)t; } |
|
|
93 | |
85 | #endif |
94 | #endif |
86 | |
95 | |