2016-05-03 12:31:07 -07:00
|
|
|
// Prototypes for functions for performing sanity checks on the program state.
|
2005-10-05 01:11:39 +10:00
|
|
|
#ifndef FISH_SANITY_H
|
|
|
|
#define FISH_SANITY_H
|
|
|
|
|
2016-05-03 12:31:07 -07:00
|
|
|
/// Call this function to tell the program it is not in a sane state.
|
2005-09-20 23:26:39 +10:00
|
|
|
void sanity_lose();
|
|
|
|
|
2016-05-03 12:31:07 -07: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
|
2019-11-25 20:03:25 +09:00
|
|
|
/// \param null_ok Whether the pointer is allowed to point to 0
|
2012-11-18 16:30:30 -08:00
|
|
|
void validate_pointer(const void *ptr, const wchar_t *err, int null_ok);
|
2005-10-05 01:11:39 +10:00
|
|
|
|
|
|
|
#endif
|