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));
char * xstrtok(char *s, int position=-1)
STRTOK WITH ERROR HANDLING and whitespace delimiters.
struct SystemInfo SystemInfo
System structure for various global variables.
#define OPERATOR_NEW_THROW_EXCEPTION
int xremove(const char *s)
Remove file or directory (function)
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.
void chkerr(unsigned int ierr)
char * get_log_file(void)
void resume_log_file(void)
System structure for various global variables.
Global macros to enhance readability and debugging, general constants.
char * get_log_fname(void)
void * xrealloc(void *ptr, size_t size)
Reallocation of memory block with checking.
void chkerr_assert(unsigned int ierr)
void * xmalloc(size_t size)
Memory allocation with checking.
MessageType
Identifiers for various output messages.
char * xstrcpy(const char *)
MAKE BRAND NEW COPY OF STRING.
int xsystem(const char *)
SYSTEM with err 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.
int xchdir(const char *s)
Change directory (GLIBC function, original in )
char * xgetcwd(void)
Get current working directory (GLIBC function, original in )
int xchomp(char *s)
Delete trailing whitespace characters (space,tab,CR,NL).
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
int xmkdir(const char *s)
Operations on files and directories.