aboutsummaryrefslogtreecommitdiff
path: root/text-util.h
diff options
context:
space:
mode:
Diffstat (limited to 'text-util.h')
-rw-r--r--text-util.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/text-util.h b/text-util.h
new file mode 100644
index 0000000..d81c645
--- /dev/null
+++ b/text-util.h
@@ -0,0 +1,21 @@
+#ifndef TEXT_UTIL_H
+#define TEXT_UTIL_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include "text.h"
+
+/* test whether the given range is valid (start <= end) */
+bool text_range_valid(Filerange*);
+/* get the size of the range (end-start) or zero if invalid */
+size_t text_range_size(Filerange*);
+/* create an empty / invalid range of size zero */
+Filerange text_range_empty(void);
+/* merge two ranges into a new one which contains both of them */
+Filerange text_range_union(Filerange*, Filerange*);
+/* create new range [min(a,b), max(a,b)] */
+Filerange text_range_new(size_t a, size_t b);
+/* test whether two ranges overlap */
+bool text_range_overlap(Filerange*, Filerange*);
+
+#endif \ No newline at end of file