src/z-dice.c
static dice_input_t dice_input_for_char(char c)
{
	/* Catch specific characters before checking bigger char categories. */
	switch (c) {
		case '&':
			return DICE_INPUT_AMP;
		case '-':
			return DICE_INPUT_MINUS;
		case '+':
			return DICE_INPUT_BASE;
		case 'd':
			return DICE_INPUT_DICE;
		case 'M':
		case 'm':
			return DICE_INPUT_BONUS;
		case '$':
			return DICE_INPUT_VAR;
		case '\0':
			return DICE_INPUT_NULL;
		default:
			break;
	}

	if (isdigit(c))
		return DICE_INPUT_DIGIT;

	if (isupper(c))
		return DICE_INPUT_UPPER;

	return DICE_INPUT_MAX;
}
/**
 * Return the appropriate input type based on the given character.
 */
Return the appropriate input type based on the given character.
Return the appropriate input type based on the given character .
static dice_input_t dice_input_for_char(char c)
{
	switch (c) {
		case '&':
			return DICE_INPUT_AMP;
		case '-':
			return DICE_INPUT_MINUS;
		case '+':
			return DICE_INPUT_BASE;
		case 'd':
			return DICE_INPUT_DICE;
		case 'M':
		case 'm':
			return DICE_INPUT_BONUS;
		case '$':
			return DICE_INPUT_VAR;
		case '\0':
			return DICE_INPUT_NULL;
		default:
			break;
	}
	if (isdigit(c))
		return DICE_INPUT_DIGIT;
	if (isupper(c))
		return DICE_INPUT_UPPER;
	return DICE_INPUT_MAX;
}
static dice_input_t dice_input_for_char ( char c ) { switch ( c ) { case ' ' : return DICE_INPUT_AMP ; case ' ' : return DICE_INPUT_MINUS ; case ' ' : return DICE_INPUT_BASE ; case ' ' : return DICE_INPUT_DICE ; case ' ' : case ' ' : return DICE_INPUT_BONUS ; case ' ' : return DICE_INPUT_VAR ; case ' \0 ' : return DICE_INPUT_NULL ; default : break ; } if ( isdigit ( c ) ) return DICE_INPUT_DIGIT ; if ( isupper ( c ) ) return DICE_INPUT_UPPER ; return DICE_INPUT_MAX ; }
Return the appropriate input type based on the given character.
Return the appropriate input type based on the given character .
/* Catch specific characters before checking bigger char categories. */