32 #include <vapor/common.h>
36 void *
operator new (
size_t sz);
37 void *
operator new[] (
size_t sz);
43 #pragma warning(disable : 4251)
71 typedef void (*ErrMsgCB_T) (
const char *msg,
int err_code);
72 typedef void (*DiagMsgCB_T) (
const char *msg);
87 static void SetErrMsg(
const char *format, ...);
99 static void SetErrMsg(
int errcode,
const char *format, ...);
180 static void SetDiagMsg(
const char *format, ...);
243 bool prev = Enabled; Enabled = enable;
return (prev);
265 static void _SetErrMsg(
char **msg,
int *sz,
const char *format, va_list args);
324 const std::string &s,
char delim, std::vector<std::string> &elems
327 const std::string &s,
char delim, std::vector<size_t> &elems
330 const std::string &s,
char delim, std::vector<int> &elems
333 const std::string &s,
char delim, std::vector<float> &elems
336 const std::string &s,
char delim, std::vector<double> &elems
351 unsigned long long targ,
366 unsigned long long targ,
369 unsigned long long src
374 return ((X)>0)?((int)(X+0.5)):((
int)(X-0.5));
396 #define FSEEK64 fseek
399 #if defined(Linux) || defined(AIX)
400 #define FSEEK64 fseeko64
404 #define FSEEK64 fseeko
408 #define FSEEK64 fseek64
418 #if defined(WIN32) || defined(Darwin)
419 #define FOPEN64 fopen
423 #define FOPEN64 fopen64
438 #define STAT64_T _stat
443 #define STAT64_T stat
448 #define STAT64_T stat64
449 #define STAT64 stat64
455 #define TIME64_T __int64
457 #define TIME64_T int64_t
static const char * GetDiagMsg()
static FILE * ErrMsgFilePtr
static bool EnableErrMsg(bool enable)
static void SetDiagMsgCB(DiagMsgCB_T cb)
COMMON_API void StrRmWhiteSpace(string &s)
Remove white space from a string.
const string & getClassName() const
COMMON_API int IsPowerOfTwo(unsigned int x)
Return true if power of two.
COMMON_API double ran1(long *)
COMMON_API double LogBaseN(double x, double n)
COMMON_API unsigned long long SetBits64(unsigned long long targ, int pos, int n, unsigned long long src)
static DiagMsgCB_T DiagMsgCB
COMMON_API double Max(double a, double b)
static const char * GetErrMsg()
COMMON_API int StrCmpNoCase(const string &s, const string &t)
Case-insensitive string comparison.
COMMON_API unsigned long long GetBits64(unsigned long long targ, int pos, int n)
static const FILE * SetErrMsgFilePtr()
COMMON_API void StrToWordVec(const string &s, vector< string > &v)
Parse a string, returning a vector of words.
static ErrMsgCB_T ErrMsgCB
COMMON_API double Min(double a, double b)
COMMON_API int IsOdd(int x)
static void SetDiagMsgFilePtr(FILE *fp)
static int GetErrCode()
Retrieve the current error code.
void SetClassName(const string &name)
COMMON_API int ILog2(int n)
static DiagMsgCB_T GetDiagMsgCB()
static FILE * DiagMsgFilePtr
static void SetErrMsgFilePtr(FILE *fp)
static void SetErrCode(int err_code)
Record an error code.
static void SetErrMsgCB(ErrMsgCB_T cb)
std::vector< double > & SplitString(const std::string &s, char delim, std::vector< double > &elems)
static ErrMsgCB_T GetErrMsgCB()