/* returns the corresponding base64 code for the given ascii symbol  */
static int getcode(char symbol)
/* returns the corresponding base64 code for the given ascii symbol  */
static int getcode(char symbol)
{
    if (symbol == '/') {
        return BASE64_SLASH;
    }
    if (symbol == '+') {
        return BASE64_PLUS;
    }
    if (symbol == '=') {
        return BASE64_EQUALS;
    }
    if (symbol < '0') {
        return BASE64_NOT_DEFINED;
    }
    if (symbol <= '9' && symbol >= '0') {
        return (symbol + (BASE64_NUMBER_UPPER_BOUND - '9'));
    }
    if (symbol <= 'Z' && symbol >= 'A') {
        return (symbol - 'A');
    }
    if (symbol <= 'z' && symbol >= 'a') {
        return (symbol + (BASE64_SMALL_UPPER_BOUND - 'z'));
    }
    return BASE64_NOT_DEFINED;
}