47 #define GetCurrentDir _getcwd
48 #define PATH_MAX MAX_PATH
51 #define GetCurrentDir getcwd
55 #define strcmpi strcasecmp
56 #define DIR_DELIMITER '/'
58 #ifdef HAVE_CXX11_FULL
59 #define OPERATOR_NEW_THROW_EXCEPTION
61 #define OPERATOR_NEW_THROW_EXCEPTION throw(std::bad_alloc)
100 #define xprintf(...) _xprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
102 int _xprintf(
const char *
const xprintf_file,
const char *
const xprintf_func,
const int xprintf_line,
MessageType type,
const char *
const fmt, ... );
104 void *
xrealloc(
void * ptr,
size_t size );
109 do { if (p) { free(p); (p)=NULL; } \
125 void operator delete(
void *p)
throw();
126 void operator delete[](
void *p)
throw();
133 int xmkdir(
const char *s );
134 int xchdir(
const char *s );
137 int xrename(
const char * oldname,
const char * newname );
142 char *
xstrtok(
char *s,
int position = -1);
143 char *
xstrtok(
char*,
const char* delim,
int position = -1);
149 if (ierr != 0)
THROW( ExcChkErr() << EI_ErrCode(ierr));
156 if (ierr != 0)
THROW( ExcChkErrAssert() << EI_ErrCode(ierr));
struct SystemInfo SystemInfo
System structure for various global variables.
#define OPERATOR_NEW_THROW_EXCEPTION
static const int debug_asserts_view
int xrename(const char *oldname, const char *newname)
Changes the name of the file or directory specified by oldname to newname.
int xremove(const char *fname)
DELETE a FILE with error handling.
void chkerr(unsigned int ierr)
char * xstrcpy(const char *src)
MAKE BRAND NEW COPY OF STRING.
char * get_log_file(void)
void * xrealloc(void *ptr, size_t size)
Reallocation of memory block with checking.
void resume_log_file(void)
System structure for various global variables.
int xchomp(char *s)
Delete trailing whitespace characters (space,tab,CR,NL).
Global macros to enhance readability and debugging, general constants.
int xmkdir(const char *s)
MKDIR WITH ERROR HANDLING.
int _xprintf(const char *const xprintf_file, const char *const xprintf_func, const int xprintf_line, MessageType type, const char *const fmt,...)
Multi-purpose printing routine: messages, warnings, errors.
char * get_log_fname(void)
void chkerr_assert(unsigned int ierr)
void * xmalloc(size_t size)
Memory allocation with checking.
MessageType
Identifiers for various output messages.
int xchdir(const char *s)
CHDIR WITH ERROR HANDLING.
char * xstrtok(char *s, int position)
STRTOK WITH ERROR HANDLING and whitespace delimiters.
char * xgetcwd(void)
GET CURRENT WORKING DIRECTORY with error handling.
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
int xsystem(const char *cmd)
SYSTEM with err handling.