36void *
operator new(
size_t sz);
37void *
operator new[](
size_t sz);
42 #pragma warning(disable : 4251)
69 typedef void (*ErrMsgCB_T)(
const char *msg,
int err_code);
70 typedef void (*DiagMsgCB_T)(
const char *msg);
96 static void SetErrMsg(
int errcode,
const char *format, ...);
264 static void _SetErrMsg(
char **msg,
int *sz,
const char *format, va_list args);
280COMMON_API inline size_t Min(
size_t a,
size_t b) {
return (a < b ? a : b); };
281COMMON_API inline size_t Max(
size_t a,
size_t b) {
return (a > b ? a : b); };
286COMMON_API inline double Min(
double a,
double b) {
return (a < b ? a : b); };
287COMMON_API inline double Max(
double a,
double b) {
return (a > b ? a : b); };
363 #define FSEEK64 fseek
366#if defined(Linux) || defined(AIX)
367 #define FSEEK64 fseeko64
371 #define FSEEK64 fseeko
375 #define FSEEK64 fseek64
385#if defined(WIN32) || defined(Darwin)
386 #define FOPEN64 fopen
390 #define FOPEN64 fopen64
405 #define STAT64_T _stat
410 #define STAT64_T stat
414#if defined(__CYGWIN__)
415 #define STAT64_T stat
420 #define STAT64_T stat64
421 #define STAT64 stat64
426 #define TIME64_T __int64
428 #define TIME64_T int64_t
static const char * GetErrMsg()
static void SetDiagMsgCB(DiagMsgCB_T cb)
static ErrMsgCB_T ErrMsgCB
static void SetErrCode(int err_code)
Record an error code.
static void SetErrMsgCB(ErrMsgCB_T cb)
static void SetErrMsgFilePtr(FILE *fp)
static DiagMsgCB_T DiagMsgCB
void SetClassName(const string &name)
static int GetErrCode()
Retrieve the current error code.
static DiagMsgCB_T GetDiagMsgCB()
static ErrMsgCB_T GetErrMsgCB()
static const FILE * SetErrMsgFilePtr()
static FILE * DiagMsgFilePtr
static void SetErrMsg(int errcode, const char *format,...)
Record a formatted error message and an error code.
static void SetDiagMsg(const char *format,...)
Record a formatted diagnostic message.
const string & getClassName() const
static FILE * ErrMsgFilePtr
static bool EnableErrMsg(bool enable)
static void SetDiagMsgFilePtr(FILE *fp)
static const char * GetDiagMsg()
static void SetErrMsg(const char *format,...)
Record a formatted error message.
static bool GetEnableErrMsg()
COMMON_API void StrToWordVec(const string &s, vector< string > &v)
Parse a string, returning a vector of words.
COMMON_API int IsPowerOfTwo(unsigned int x)
Return true if power of two.
COMMON_API double LogBaseN(double x, double n)
COMMON_API int ILog2(int n)
COMMON_API unsigned long long GetBits64(unsigned long long targ, int pos, int n)
COMMON_API void StrRmWhiteSpace(string &s)
Remove white space from a string.
COMMON_API double ran1(long *)
COMMON_API std::vector< std::string > & SplitString(const std::string &s, char delim, std::vector< std::string > &elems)
COMMON_API int Max(int a, int b)
COMMON_API int Min(int a, int b)
COMMON_API int IsOdd(int x)
COMMON_API unsigned long long SetBits64(unsigned long long targ, int pos, int n, unsigned long long src)
COMMON_API int StrCmpNoCase(const string &s, const string &t)
Case-insensitive string comparison.