From c65669a785fba9b1f0f7539f47a677035ea06229 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 2 Dec 2017 01:07:20 +0100 Subject: Add some common utility functions Signed-off-by: pacien --- include/common/error.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/common/error.h (limited to 'include/common/error.h') diff --git a/include/common/error.h b/include/common/error.h new file mode 100644 index 0000000..522d646 --- /dev/null +++ b/include/common/error.h @@ -0,0 +1,24 @@ +#ifndef UPEM_MORPHING_ERROR +#define UPEM_MORPHING_ERROR + +/** + * File: error.h + */ + +/** + * Constants: Common errors + * + * OUT_OF_MEMORY_ERROR - when memory cannot be allocated for the program + */ +#define OUT_OF_MEMORY_ERROR "Out of memory" + +/** + * Function: rage quit + * Logs the supplied error message to stderr before exiting the program with an error status code. + * + * Parameters; + * *msg - error message to log + */ +void rage_quit(const char *msg); + +#endif -- cgit v1.2.3