Lines Matching refs:iter

43 void interval_tree_span_iter_first(struct interval_tree_span_iter *iter,  in interval_tree_span_iter_first()  argument
48 iter->first_index = first_index; in interval_tree_span_iter_first()
49 iter->last_index = last_index; in interval_tree_span_iter_first()
50 iter->nodes[0] = NULL; in interval_tree_span_iter_first()
51 iter->nodes[1] = in interval_tree_span_iter_first()
53 if (!iter->nodes[1]) { in interval_tree_span_iter_first()
55 iter->start_hole = first_index; in interval_tree_span_iter_first()
56 iter->last_hole = last_index; in interval_tree_span_iter_first()
57 iter->is_hole = 1; in interval_tree_span_iter_first()
60 if (iter->nodes[1]->start > first_index) { in interval_tree_span_iter_first()
62 iter->start_hole = first_index; in interval_tree_span_iter_first()
63 iter->last_hole = iter->nodes[1]->start - 1; in interval_tree_span_iter_first()
64 iter->is_hole = 1; in interval_tree_span_iter_first()
65 interval_tree_span_iter_next_gap(iter); in interval_tree_span_iter_first()
70 iter->start_used = first_index; in interval_tree_span_iter_first()
71 iter->is_hole = 0; in interval_tree_span_iter_first()
72 interval_tree_span_iter_next_gap(iter); in interval_tree_span_iter_first()
73 iter->last_used = iter->nodes[0]->last; in interval_tree_span_iter_first()
74 if (iter->last_used >= last_index) { in interval_tree_span_iter_first()
75 iter->last_used = last_index; in interval_tree_span_iter_first()
76 iter->nodes[0] = NULL; in interval_tree_span_iter_first()
77 iter->nodes[1] = NULL; in interval_tree_span_iter_first()
82 void interval_tree_span_iter_next(struct interval_tree_span_iter *iter) in interval_tree_span_iter_next() argument
84 if (!iter->nodes[0] && !iter->nodes[1]) { in interval_tree_span_iter_next()
85 iter->is_hole = -1; in interval_tree_span_iter_next()
89 if (iter->is_hole) { in interval_tree_span_iter_next()
90 iter->start_used = iter->last_hole + 1; in interval_tree_span_iter_next()
91 iter->last_used = iter->nodes[0]->last; in interval_tree_span_iter_next()
92 if (iter->last_used >= iter->last_index) { in interval_tree_span_iter_next()
93 iter->last_used = iter->last_index; in interval_tree_span_iter_next()
94 iter->nodes[0] = NULL; in interval_tree_span_iter_next()
95 iter->nodes[1] = NULL; in interval_tree_span_iter_next()
97 iter->is_hole = 0; in interval_tree_span_iter_next()
101 if (!iter->nodes[1]) { in interval_tree_span_iter_next()
103 iter->start_hole = iter->nodes[0]->last + 1; in interval_tree_span_iter_next()
104 iter->last_hole = iter->last_index; in interval_tree_span_iter_next()
105 iter->nodes[0] = NULL; in interval_tree_span_iter_next()
106 iter->is_hole = 1; in interval_tree_span_iter_next()
111 iter->start_hole = iter->nodes[0]->last + 1; in interval_tree_span_iter_next()
112 iter->last_hole = iter->nodes[1]->start - 1; in interval_tree_span_iter_next()
113 iter->is_hole = 1; in interval_tree_span_iter_next()
114 interval_tree_span_iter_next_gap(iter); in interval_tree_span_iter_next()
124 void interval_tree_span_iter_advance(struct interval_tree_span_iter *iter, in interval_tree_span_iter_advance() argument
128 if (iter->is_hole == -1) in interval_tree_span_iter_advance()
131 iter->first_index = new_index; in interval_tree_span_iter_advance()
132 if (new_index > iter->last_index) { in interval_tree_span_iter_advance()
133 iter->is_hole = -1; in interval_tree_span_iter_advance()
138 if (iter->start_hole <= new_index && new_index <= iter->last_hole) { in interval_tree_span_iter_advance()
139 iter->start_hole = new_index; in interval_tree_span_iter_advance()
142 if (new_index == iter->last_hole + 1) in interval_tree_span_iter_advance()
143 interval_tree_span_iter_next(iter); in interval_tree_span_iter_advance()
145 interval_tree_span_iter_first(iter, itree, new_index, in interval_tree_span_iter_advance()
146 iter->last_index); in interval_tree_span_iter_advance()