aboutsummaryrefslogtreecommitdiff
path: root/text.h
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-13 22:25:06 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-13 22:29:36 +0200
commitc17ca10e11db30f4b4924b69dbf3b1693025d4dc (patch)
treedb8f9ed1b95d895e111f68181ab8433b6349639b /text.h
parentc94579526c082e75b9ee8ec2fc189540884ac039 (diff)
downloadvis-c17ca10e11db30f4b4924b69dbf3b1693025d4dc.tar.gz
vis-c17ca10e11db30f4b4924b69dbf3b1693025d4dc.tar.xz
Introduce and use EPOS instead of (size_t)-1
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 0dadbb6..f8b66ee 100644
--- a/text.h
+++ b/text.h
@@ -4,6 +4,8 @@
#include <stdbool.h>
#include <stddef.h>
+#define EPOS ((size_t)-1) /* invalid position */
+
typedef size_t Filepos;
typedef struct {
@@ -36,7 +38,7 @@ bool text_insert_raw(Text*, size_t pos, const char *data, size_t len);
bool text_delete(Text*, size_t pos, size_t len);
void text_snapshot(Text*);
/* undo/redos to the last snapshoted state. returns the position where
- * the change occured or (size_t)-1 if nothing could be undo/redo. */
+ * the change occured or EPOS if nothing could be undo/redo. */
size_t text_undo(Text*);
size_t text_redo(Text*);