#ifndef CHAR_H
#define CHAR_H

char char_to_upper(char c);
char char_to_lower(char c);

#if defined(CHAR_IMP) || defined(IMP)

#include <stdint.h>

char
char_to_upper(char c)
{
	int8_t cond = (c >= 'a' && c <= 'z');
	return (char)(cond * (c - 32) + (!cond) * c);
}

char
char_to_lower(char c)
{
	int8_t cond = (c >= 'A' && c <= 'Z');
	return (char)(cond * (c + 32) + (!cond) * c);
}

#endif /* defined(CHAR_IMP) || defined(IMP) */

#endif
