8 /* test whether the given range is valid (start <= end) */
9 bool text_range_valid(Filerange
*);
10 /* get the size of the range (end-start) or zero if invalid */
11 size_t text_range_size(Filerange
*);
12 /* create an empty / invalid range of size zero */
13 Filerange
text_range_empty(void);
14 /* merge two ranges into a new one which contains both of them */
15 Filerange
text_range_union(Filerange
*, Filerange
*);
16 /* create new range [min(a,b), max(a,b)] */
17 Filerange
text_range_new(size_t a
, size_t b
);
18 /* test whether two ranges are equal */
19 bool text_range_equal(Filerange
*, Filerange
*);
20 /* test whether two ranges overlap */
21 bool text_range_overlap(Filerange
*, Filerange
*);
22 /* test whether a given position is within a certain range */
23 bool text_range_contains(Filerange
*, size_t pos
);
24 /* count the number of graphemes in data */
25 int text_char_count(const char *data
, size_t len
);