diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2015-07-24 00:50:58 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2015-07-24 00:59:27 -0700 |
commit | b4f53143b0e05fd3061cdf2e65e17a6a2904090b (patch) | |
tree | 4785bf31f7b89fc2420aa740d9a6967dc6c6f9b1 /src/sanity.h | |
parent | 9c2fdc6da57032c4448b59de5872086eea626b74 (diff) |
Migrate source files into src/ directory
This change moves source files into a src/ directory,
and puts object files into an obj/ directory. The Makefile
and xcode project are updated accordingly.
Fixes #1866
Diffstat (limited to 'src/sanity.h')
-rw-r--r-- | src/sanity.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/sanity.h b/src/sanity.h new file mode 100644 index 00000000..6d8e293a --- /dev/null +++ b/src/sanity.h @@ -0,0 +1,29 @@ +/** \file sanity.h + Prototypes for functions for performing sanity checks on the program state +*/ + +#ifndef FISH_SANITY_H +#define FISH_SANITY_H + +#include <wchar.h> + +/** + Call this function to tell the program it is not in a sane state. +*/ +void sanity_lose(); + +/** + Perform sanity checks, return 1 if program is in a sane state 0 otherwise. +*/ +int sanity_check(); + +/** + Try and determine if ptr is a valid pointer. If not, loose sanity. + + \param ptr The pointer to validate + \param err A description of what the pointer refers to, for use in error messages + \param null_ok Wheter the pointer is allowed to point to 0 +*/ +void validate_pointer(const void *ptr, const wchar_t *err, int null_ok); + +#endif |