diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-22 14:36:20 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-22 18:11:04 +0100 |
| commit | c6d76158b597d6c9bcfe222129d2897fececc45f (patch) | |
| tree | 6aae2f997b019d51dc8916b8c08007e28d91ef11 /text.h | |
| parent | 0f15c4af6c68edb3fa8e3331260e1da43121827f (diff) | |
| download | vis-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.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |
