diff options
Diffstat (limited to 'src/misc.h')
-rw-r--r-- | src/misc.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/misc.h b/src/misc.h new file mode 100644 index 0000000..c97a59e --- /dev/null +++ b/src/misc.h @@ -0,0 +1,37 @@ +/** + * @file misc.h + * @author Joe Wingbermuehle + * @date 2004-2006 + * + * @brief Miscellaneous functions and macros. + * + */ + +#ifndef MISC_H +#define MISC_H + +/** Return the minimum of two values. */ +#define Min( x, y ) ( (x) > (y) ? (y) : (x) ) + +/** Return the maximum of two values. */ +#define Max( x, y ) ( (x) > (y) ? (x) : (y) ) + +/** Perform shell-like macro path expansion. + * @param path The path to expand (possibly reallocated). + */ +void ExpandPath(char **path); + +/** Trim leading and trailing whitespace from a string. + * @param str The string to trim. + */ +void Trim(char *str); + +/** Copy a string. + * Note that NULL is accepted. When provided NULL, NULL will be returned. + * @param str The string to copy. + * @return A copy of the string. + */ +char *CopyString(const char *str); + +#endif + |