kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 5f7709211b6a66740fb4f930b51102e22411936e
parent 8a6f4a935eb44c6f96247625b07553ee631cec42
Author: Joris Vink <joris@coders.se>
Date:   Fri, 11 Dec 2015 23:41:52 +0100

Merge pull request #92 from PauloMelo/master

add kore_buf_reset
Diffstat:
includes/kore.h | 1+
src/buf.c | 6++++++
2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/includes/kore.h b/includes/kore.h @@ -576,6 +576,7 @@ void kore_buf_free(struct kore_buf *); struct kore_buf *kore_buf_create(u_int32_t); void kore_buf_append(struct kore_buf *, const void *, u_int32_t); u_int8_t *kore_buf_release(struct kore_buf *, u_int32_t *); +void kore_buf_reset(struct kore_buf *); void kore_buf_appendf(struct kore_buf *, const char *, ...); void kore_buf_appendv(struct kore_buf *, const char *, va_list); diff --git a/src/buf.c b/src/buf.c @@ -140,3 +140,9 @@ kore_buf_replace_string(struct kore_buf *b, char *src, void *dst, size_t len) off = off + len; } } + +void +kore_buf_reset(struct kore_buf *buf) +{ + buf->offset = 0; +}