databuffer.h

changeset 41
47e686c96d8f
parent 40
9e4f785501db
child 42
5cd91fd1526c
equal deleted inserted replaced
40:9e4f785501db 41:47e686c96d8f
186 ScriptMark* m = new ScriptMark; 186 ScriptMark* m = new ScriptMark;
187 m->name = name; 187 m->name = name;
188 m->type = type; 188 m->type = type;
189 m->pos = writesize; 189 m->pos = writesize;
190 marks[u] = m; 190 marks[u] = m;
191 printf ("add mark %u at %d\n", u, m->pos);
191 return u; 192 return u;
192 } 193 }
193 194
194 unsigned int AddMarkReference (unsigned int marknum) { 195 unsigned int AddMarkReference (unsigned int marknum) {
195 unsigned int u; 196 unsigned int u;
231 232
232 // Adjusts a mark to the current position 233 // Adjusts a mark to the current position
233 void MoveMark (unsigned int mark) { 234 void MoveMark (unsigned int mark) {
234 if (!marks[mark]) 235 if (!marks[mark])
235 return; 236 return;
237 printf ("move mark %u from %d to %d\n", mark, marks[mark]->pos, writesize);
236 marks[mark]->pos = writesize; 238 marks[mark]->pos = writesize;
239 }
240
241 // Adjusts a mark to the current position
242 void OffsetMark (unsigned int mark, size_t offset) {
243 if (!marks[mark])
244 return;
245 printf ("move mark %u from %d to %d\n", mark, marks[mark]->pos, marks[mark]->pos+offset);
246 marks[mark]->pos += offset;
237 } 247 }
238 248
239 // Dump the buffer (for debugging purposes) 249 // Dump the buffer (for debugging purposes)
240 void Dump() { 250 void Dump() {
241 for (unsigned int x = 0; x < writesize; x++) 251 for (unsigned int x = 0; x < writesize; x++)

mercurial