35 #define GetCurrentDir _getcwd 36 #define PATH_MAX MAX_PATH 39 #define GetCurrentDir getcwd 43 #define strcmpi strcasecmp 44 #define DIR_DELIMITER '/' 48 #define OPERATOR_NEW_THROW_EXCEPTION 87 #define xprintf(...) _xprintf(__FILE__, __func__, __LINE__, __VA_ARGS__) 89 int _xprintf(
const char *
const xprintf_file,
const char *
const xprintf_func,
const int xprintf_line,
MessageType type,
const char *
const fmt, ... );
91 void *
xrealloc(
void * ptr,
size_t size );
96 do { if (p) { free(p); (p)=NULL; } \ 112 void operator delete(
void *p)
throw();
113 void operator delete[](
void *p)
throw();
120 int xmkdir(
const char *s );
121 int xchdir(
const char *s );
124 int xrename(
const char * oldname,
const char * newname );
129 char *
xstrtok(
char *s,
int position = -1);
130 char *
xstrtok(
char*,
const char* delim,
int position = -1);
138 if (ierr != 0)
THROW( ExcChkErr() << EI_ErrCode(ierr));
148 #ifdef FLOW123D_DEBUG_ASSERTS
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)
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 <unistd.h>)
char * xgetcwd(void)
Get current working directory (GLIBC function, original in <unistd.h>)
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.