Mercurial > hg > nnchat
changeset 492:73f8df0ecffe
Add dirty flag to editbuf struct and handling functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 27 May 2012 10:06:42 +0300 |
parents | 942446795978 |
children | 56689f94e827 |
files | util.c util.h |
diffstat | 2 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util.c Sun May 27 09:23:36 2012 +0300 +++ b/util.c Sun May 27 10:06:42 2012 +0300 @@ -322,6 +322,7 @@ else buf->data[pos] = ch; + buf->dirty = TRUE; return 0; } @@ -340,6 +341,8 @@ buf->data[pos] = ch; } buf->len++; + + buf->dirty = TRUE; return 0; } @@ -350,6 +353,7 @@ { memmove(&(buf->data[pos]), &(buf->data[pos+1]), buf->len - pos); buf->len--; + buf->dirty = TRUE; return 0; } else @@ -361,6 +365,7 @@ { buf->len = 0; buf->pos = 0; + buf->dirty = TRUE; } @@ -370,6 +375,7 @@ res->data = (char *) th_malloc(n); res->size = n; + res->dirty = TRUE; return res; } @@ -398,6 +404,7 @@ memcpy(res->data, src->data, src->size); res->pos = res->len = src->len; + res->dirty = TRUE; return res; } @@ -437,6 +444,8 @@ buf->pos = buf->len; else buf->pos = pos; + + buf->dirty = TRUE; }