aboutsummaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-12-22 14:36:20 +0100
committerMarc André Tanner <mat@brain-dump.org>2016-12-22 18:11:04 +0100
commitc6d76158b597d6c9bcfe222129d2897fececc45f (patch)
tree6aae2f997b019d51dc8916b8c08007e28d91ef11 /text.h
parent0f15c4af6c68edb3fa8e3331260e1da43121827f (diff)
downloadvis-c6d76158b597d6c9bcfe222129d2897fececc45f.tar.gz
vis-c6d76158b597d6c9bcfe222129d2897fececc45f.tar.xz
text: introduce EMARK to denote an invalid mark
Technically this macro name is in the reserved namespace of errno.h. The same is true for EPOS. Maybe we should rename them at some point, but for now the short names are convenient. Fix #443 Close #444
Diffstat (limited to 'text.h')
-rw-r--r--text.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/text.h b/text.h
index 3a5baa8..fbd06b9 100644
--- a/text.h
+++ b/text.h
@@ -9,6 +9,9 @@
#include <sys/types.h>
#include <sys/stat.h>
+typedef uintptr_t Mark;
+
+#define EMARK ((Mark)0) /* invalid mark */
#define EPOS ((size_t)-1) /* invalid position */
typedef size_t Filepos;
@@ -100,7 +103,6 @@ bool text_iterator_codepoint_prev(Iterator *it, char *c);
bool text_iterator_char_next(Iterator*, char *c);
bool text_iterator_char_prev(Iterator*, char *c);
-typedef uintptr_t Mark;
/* mark position `pos', the returned mark can be used to later retrieve
* the same text segment */
Mark text_mark_set(Text*, size_t pos);