#include <ncbi.h>
#include <dfa.h>

/*************************************************************************
 * dfa_errstr(DFA_Error)
 *
 *	Return a pointer to a short error message that describes errnum
 *************************************************************************/
char * _cdecl
dfa_errstr(errnum)
	DFA_Error	errnum;
{
	switch (errnum) {
	case dfaErrNone:
		return "no DFA error";
	case dfaErrBadPtr:
		return "null DFA pointer";
	case dfaErrIncompat:
		return "function is incompatible with the type of DFA";
	case dfaErrBadParm:
		return "bad parameter passed";
	case dfaErrMemincrTooSml:
		return "memincr is too small";
	case dfaErrNoMem:
		return "insufficient memory";
	case dfaErrPatlen:
		return "pattern has zero-length";
	case dfaErrOpstate:
		return "DFA is in wrong operational state";
	case dfaErrNonAlpha:
		return "undefined letter in pattern";
	case dfaErrNullParm:
		return "required parameter is NULL";
	case dfaErrAlphaSize:
		return "size of alphabet is greater than available precision";
	case dfaErrFileIO:
		return "file I/O error";
	case dfaErrNotFound:
		return "pattern not found";
	case dfaErrReport:
		return "report() returned non-zero value";
	case dfaErrUnknown:
		return "non-specific DFA error";
	default:
		if (errnum >= dfaErrMax || errnum < dfaErrNone)
			return "DFA error appears invalid (no description available)";
		return "DFA error description is missing";
	}
	/*NOTREACHED*/
}
