10 #include "pol_global_config.h" 24 #define EXPLICIT_CAST( totype, fromtype ) ( totype ) 26 #define ms_to_clocks( ms ) ( ms * CLOCKS_PER_SEC / 1000 ) 39 char*
strpcpy(
char* dest,
const char* src,
size_t maxlen );
42 char*
stracpy(
char* dest,
const char* src,
size_t maxlen );
46 int match(
char* a,
char* b );
49 char*
strip(
char* s );
54 FILE* uniqfile(
char* directory,
char* pathname );
57 int forspec(
const char* spec,
void ( *func )(
const char* pathname ) );
64 char**
decompose1(
char* cmdline,
int* pargc );
67 void legalize(
char* s,
const char* allowed );
70 int nwords(
const char* s );
73 char*
binary(
unsigned int val,
int nbits );
81 #define stricmp strcasecmp 82 #define strnicmp strncasecmp 86 #define stricmp _stricmp 87 #define strnicmp _strnicmp 100 template <
typename T>
106 template <
typename T>
112 template <
typename T>
117 else if ( *value < min )
128 void update(
double value );
147 localtime_s( &result, &t );
149 localtime_r( &t, &result );
154 #define strzcpy Clib::stracpy 156 #define STRCPY( a, b ) strncpy( a, b, sizeof a ) 157 #define STRNCPY( a, b ) strncpy( a, b, sizeof a ) 158 #define STRPCPY( a, b ) \ 160 strpcpy( a, b, sizeof a ) 161 #define STRACPY( a, b ) \ 163 stracpy( a, b, sizeof a ) 164 #define MEMCLR( a ) memset( &a, 0, sizeof a ) 165 #define MEMCPY( a, b ) memcpy( &a, &b, sizeof a ) 168 #endif // CLIB_CLIB_H
size_t getCurrentMemoryUsage()
returns the current process size in bytes
void update(double value)
void sanitize_bounds(T *value, const T min, const T max)
char * binary(unsigned int val, int nbits)
std::tm localtime(const std::time_t &t)
threadsafe version of localtime
int match(char *a, char *b)
char * strpcpy(char *dest, const char *src, size_t maxlen)
char ** decompose1(char *cmdline, int *pargc)
char * stracpy(char *dest, const char *src, size_t maxlen)
int nwords(const char *s)
void sanitize_upperlimit(T *value, const T max)
int forspec(const char *spec, void(*func)(const char *pathname))
void legalize(char *s, const char *allowed)
void sanitize_lowerlimit(T *value, const T min)