int encode_index_from_char(char c) { int result = NEUTRAL_CHAR_INDEX; if (IS_UPPER_CASE(c)) { result = c - UPPER_CASE_ASCII + UPPER_CASE_SUBSTR_OFFSET; } else if (IS_LOWER_CASE(c)) { result = c - LOWER_CASE_ASCII + LOWER_CASE_SUBSTR_OFFSET; } return result; }
int getEncodedCharIndex(char c) { int result = -1; if (IS_UPPER_CASE(c)) { result = c - UPPER_OFFSET; } else if (IS_LOWER_CASE(c)) { result = c - LOWER_OFFSET; } return result; }
static int is_valid_char_in_short_name (unsigned char ch) { if (ch > 0x7F) return 0; if (IS_UPPER_CASE(ch) || IS_LOWER_CASE(ch) || IS_DIGITS(ch)) { return 1; } switch (ch) { case '$': case '%': case '\'': case '-': case '_': case '@': case '~': case '`': case '!': case '(': case ')': case '{': case '}': case '^': case '#': case '&': return 1; default: return 0; } }