Lines Matching refs:ch
75 * Returns interger corresponding to the input if input "ch" is
79 static int tryGetISODigit (char ch)
81 if ('0' <= ch && ch <= '9') {
82 return ch - '0';
89 * True if ch is ISO-LATIN characters 0-9, *, # , +
92 static bool isDialable(char ch)
94 return ('0' <= ch && ch <= '9') || ch == '*' || ch == '#' || ch == '+';
97 /** Returns true if ch is not dialable or alpha char */
98 static bool isSeparator(char ch)
100 return !isDialable(ch) && (isalpha(ch) == 0);
118 char ch = str[i];
119 if (tryGetISODigit(ch) >= 0) {
127 } else if (isDialable(ch)) {
154 char ch = str[i];
157 if (ch == '+') state = 1;
158 else if (ch == '0') state = 2;
159 else if (ch == '1') {
165 } else if (isDialable(ch)) return -1;
169 if (ch == '0') state = 3;
170 else if (ch == '1') state = 4;
171 else if (isDialable(ch)) return -1;
175 if (ch == '1') state = 5;
176 else if (isDialable(ch)) return -1;
185 int ret = tryGetISODigit(ch);
202 } else if (isDialable(ch)) {
208 if (ch == '6') state = 9;
209 else if (isDialable(ch)) return -1;
212 if (ch == '6') {
233 * Return true if the prefix of "ch" is "ignorable". Here, "ignorable" means
234 * that "ch" has only one digit and separater characters. The one digit is
237 static bool checkPrefixIsIgnorable(const char* ch, int i) {
240 if (tryGetISODigit(ch[i]) >= 0) {
249 } else if (isDialable(ch[i])) {