2016-05-04 03:31:07 +08:00
|
|
|
// Prototypes for functions for performing sanity checks on the program state.
|
2005-10-04 23:11:39 +08:00
|
|
|
#ifndef FISH_SANITY_H
|
|
|
|
#define FISH_SANITY_H
|
|
|
|
|
2016-05-04 03:31:07 +08:00
|
|
|
/// Call this function to tell the program it is not in a sane state.
|
2005-09-20 21:26:39 +08:00
|
|
|
void sanity_lose();
|
|
|
|
|
2016-05-04 03:31:07 +08:00
|
|
|
/// Perform sanity checks, return 1 if program is in a sane state 0 otherwise.
|
2005-09-20 21:26:39 +08:00
|
|
|
int sanity_check();
|
|
|
|
|
2016-05-04 03:31:07 +08:00
|
|
|
/// 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
|
2012-11-19 08:30:30 +08:00
|
|
|
void validate_pointer(const void *ptr, const wchar_t *err, int null_ok);
|
2005-10-04 23:11:39 +08:00
|
|
|
|
|
|
|
#endif
|