Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

sanity.c File Reference

Functions for performing sanity checks on the program state. More...

#include "config.h"
#include <stdlib.h>
#include <wchar.h>
#include <stdio.h>
#include <errno.h>
#include <termios.h>
#include <unistd.h>
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include "fallback.h"
#include "util.h"
#include "common.h"
#include "sanity.h"
#include "proc.h"
#include "history.h"
#include "reader.h"
#include "kill.h"
#include "wutil.h"

Functions

void sanity_lose ()
 Call this function to tell the program it is not in a sane state.
int sanity_check ()
 Perform sanity checks, return 1 if program is in a sane state 0 otherwise.
void validate_pointer (const void *ptr, const wchar_t *err, int null_ok)
 Try and determine if ptr is a valid pointer.

Variables

static int insane
 Status from earlier sanity checks.


Detailed Description

Functions for performing sanity checks on the program state.


Function Documentation

void validate_pointer const void *  ptr,
const wchar_t *  err,
int  null_ok
 

Try and determine if ptr is a valid pointer.

If not, loose sanity.

Parameters:
ptr The pointer to validate
err A description of what the pointer refers to, for use in error messages
null_ok Wheter the pointer is allowed to point to 0


Generated on Sun Jan 13 02:53:09 2008 for fish by  doxygen 1.4.4