auxiliary function for binary search in interval table */
| 1421 | |
| 1422 | /* auxiliary function for binary search in interval table */ |
| 1423 | static inline int bisearch(wchar_t ucs, const struct interval *table, int max) { |
| 1424 | int min = 0; |
| 1425 | int mid; |
| 1426 | |
| 1427 | if (ucs < table[0].first || ucs > table[max].last) |
| 1428 | return 0; |
| 1429 | while (max >= min) { |
| 1430 | mid = (min + max) / 2; |
| 1431 | if (ucs > table[mid].last) |
| 1432 | min = mid + 1; |
| 1433 | else if (ucs < table[mid].first) |
| 1434 | max = mid - 1; |
| 1435 | else |
| 1436 | return 1; |
| 1437 | } |
| 1438 | |
| 1439 | return 0; |
| 1440 | } |
| 1441 | |
| 1442 | /* The following two functions define the column width of an ISO 10646 |
| 1443 | * character as follows: |
no outgoing calls
no test coverage detected