#include	<stdio.h>
#include	<stdlib.h>
#include	<ctype.h>
#include	<string.h>
#include	"types.h"
#include	"struct.h"
#include	"const.h"

#include	"misc.h"
#include	"code.h"
#include	"codeset.h"
#include	"debug.h"

extern	int
ToDigit(
	Char	c)
{	int		ret;

	if		(  c  ==  Char_EOF  )	{
		ret = 0;
	} else
	if		(	(  SET_Char(c)  ==  SET_ASCII  )
			 &&	(  isdigit(CODE_Char(c))       ) )	{
		ret = CODE_Char(c) - '0';
	} else {
		ret = 0;
	}
	return	(ret);
}

extern	Bool
IsSpace(
	Char	c)
{	Bool	ret;

	if		(  c  ==  Char_EOF  )	{
		ret = FALSE;
	} else
	if		(	(  SET_Char(c)  ==  SET_ASCII  )
			 &&	(  isspace(CODE_Char(c))       ) )	{
		ret = TRUE;
	} else {
		ret = FALSE;
	}
	return	(ret);
}

extern	Bool
IsDigit(
	Char	c)
{	Bool	ret;

	if		(  c  ==  Char_EOF  )	{
		ret = FALSE;
	} else
	if		(	(  SET_Char(c)  ==  SET_ASCII  )
			 &&	(  isdigit(CODE_Char(c))       ) )	{
		ret = TRUE;
	} else {
		ret = FALSE;
	}
	return	(ret);
}

extern	Bool
IsAlnum(
	Char	c)
{	Bool	ret;

	if		(  c  ==  Char_EOF  )	{
		ret = FALSE;
	} else
	if		(	(  SET_Char(c)  ==  SET_ASCII  )
			 &&	(  isalnum(CODE_Char(c))       ) )	{
		ret = TRUE;
	} else {
		ret = FALSE;
	}
	return	(ret);
}
