Convert call sites of text_line_char_{get,set} to text_line_width_{get,set}
[vis.git] / text-util.h
blob9bfa705dd4bc393bbaea1a9c19b87b3f74bafcae
1 #ifndef TEXT_UTIL_H
2 #define TEXT_UTIL_H
4 #include <stdbool.h>
5 #include <stddef.h>
6 #include "text.h"
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);
27 #endif