Lines Matching defs:ranges
65 * The set of code points is represented by an array of code point ranges.
66 * In the building phase, specified ranges by 'idn_ucsset_add' or
69 * merges any intersecting ranges. Since the array is sorted, a binary
87 int range_start; /* index of ucsset.ranges */
118 int size; /* allocated size of 'ranges' */
119 int nranges; /* num of ranges */
120 range_t *ranges;
141 bm->ranges = NULL;
155 if (ctx->ranges != NULL)
156 free(ctx->ranges);
194 range_t *ranges;
203 ranges = ctx->ranges;
221 /* Sort ranges. */
222 qsort(ranges, nranges, sizeof(range_t), comp_range);
224 /* Merge overlapped/continuous ranges. */
226 if (ranges[i].to + 1 >= ranges[j].from) {
228 if (ranges[i].to < ranges[j].to) {
229 ranges[i].to = ranges[j].to;
234 ranges[i] = ranges[j];
242 int fidx = SEG_INDEX(ranges[i].from);
243 int tidx = SEG_INDEX(ranges[i].to);
258 ctx->ranges = realloc(ctx->ranges, ctx->nranges * sizeof(range_t));
290 range_t *ranges = ctx->ranges;
294 if (v < ranges[mid].from) {
296 } else if (v > ranges[mid].to) {
335 /* Append the specified range to the 'ranges' array. */
342 newbuf = realloc(ctx->ranges, ctx->size * sizeof(range_t));
345 ctx->ranges = newbuf;
347 ctx->ranges[ctx->nranges].from = from;
348 ctx->ranges[ctx->nranges].to = to;