databuffer.h

changeset 41
47e686c96d8f
parent 40
9e4f785501db
child 42
5cd91fd1526c
--- a/databuffer.h	Mon Jul 30 11:34:57 2012 +0300
+++ b/databuffer.h	Sat Aug 11 19:35:47 2012 +0300
@@ -188,6 +188,7 @@
 		m->type = type;
 		m->pos = writesize;
 		marks[u] = m;
+		printf ("add mark %u at %d\n", u, m->pos);
 		return u;
 	}
 	
@@ -233,9 +234,18 @@
 	void MoveMark (unsigned int mark) {
 		if (!marks[mark])
 			return;
+		printf ("move mark %u from %d to %d\n", mark, marks[mark]->pos, writesize);
 		marks[mark]->pos = writesize;
 	}
 	
+	// Adjusts a mark to the current position
+	void OffsetMark (unsigned int mark, size_t offset) {
+		if (!marks[mark])
+			return;
+		printf ("move mark %u from %d to %d\n", mark, marks[mark]->pos, marks[mark]->pos+offset);
+		marks[mark]->pos += offset;
+	}
+	
 	// Dump the buffer (for debugging purposes)
 	void Dump() {
 		for (unsigned int x = 0; x < writesize; x++)

mercurial