Mercurial > hg > nnchat
diff libnnchat.c @ 89:c2d916b340bf
Change some typedef names; Add struct for user list handling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 06 May 2009 05:05:02 +0300 |
parents | e36df57c5b0f |
children | 1e0bf7b4fd41 |
line wrap: on
line diff
--- a/libnnchat.c Mon Apr 27 07:31:10 2009 +0300 +++ b/libnnchat.c Wed May 06 05:05:02 2009 +0300 @@ -365,9 +365,9 @@ } -ringbuf_t * newRingBuf(const size_t size) +nn_ringbuf_t * newRingBuf(const size_t size) { - ringbuf_t *res = th_calloc(1, sizeof(ringbuf_t)); + nn_ringbuf_t *res = th_calloc(1, sizeof(nn_ringbuf_t)); res->data = (char **) th_malloc(size * sizeof(char *)); res->size = size; @@ -377,7 +377,7 @@ } -void freeRingBuf(ringbuf_t *buf) +void freeRingBuf(nn_ringbuf_t *buf) { size_t i; @@ -389,7 +389,7 @@ } -void addRingBuf(ringbuf_t *buf, const char *str) +void addRingBuf(nn_ringbuf_t *buf, const char *str) { if (buf->n < buf->size) { buf->data[buf->n] = th_strdup(str); @@ -402,7 +402,7 @@ } -int writeBuf(editbuf_t *buf, ssize_t pos, int ch) +int writeBuf(nn_editbuf_t *buf, ssize_t pos, int ch) { /* Check arguments */ if (buf->len+1 >= buf->size) return -3; @@ -418,7 +418,7 @@ } -int insertBuf(editbuf_t *buf, ssize_t pos, int ch) +int insertBuf(nn_editbuf_t *buf, ssize_t pos, int ch) { /* Check arguments */ if (buf->len+1 >= buf->size) return -3; @@ -436,7 +436,7 @@ } -int deleteBuf(editbuf_t *buf, ssize_t pos) +int deleteBuf(nn_editbuf_t *buf, ssize_t pos) { /* Check arguments */ if (pos < 0) @@ -450,16 +450,16 @@ } -void clearBuf(editbuf_t *buf) +void clearBuf(nn_editbuf_t *buf) { buf->len = 0; buf->pos = 0; } -editbuf_t * newBuf(ssize_t n) +nn_editbuf_t * newBuf(ssize_t n) { - editbuf_t *res = th_calloc(1, sizeof(editbuf_t)); + nn_editbuf_t *res = th_calloc(1, sizeof(nn_editbuf_t)); res->data = (char *) th_malloc(n); res->size = n; @@ -468,7 +468,7 @@ } -void freeBuf(editbuf_t *buf) +void freeBuf(nn_editbuf_t *buf) { if (buf) { th_free(buf->data); @@ -477,9 +477,9 @@ } -editbuf_t * copyBuf(editbuf_t *src) +nn_editbuf_t * copyBuf(nn_editbuf_t *src) { - editbuf_t *res; + nn_editbuf_t *res; assert(src != NULL); @@ -495,7 +495,7 @@ } -void setBufPos(editbuf_t *buf, ssize_t pos) +void setBufPos(nn_editbuf_t *buf, ssize_t pos) { /* Check arguments */ if (pos < 0)