X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=buffer.h;h=c94714dabac842b3daaff32efbd7bb466b657efa;hb=1ff926eac33152aee930a454ac1d3dec6e6e5faf;hp=87c0ad204805ed7bd23f2dad54482e08ff9f2131;hpb=42ea2884f2b8a1b7cb940f4e07d22444c6f61cc6;p=apps%2Fpfixtools.git diff --git a/buffer.h b/buffer.h index 87c0ad2..c94714d 100644 --- a/buffer.h +++ b/buffer.h @@ -1,5 +1,5 @@ /******************************************************************************/ -/* postlicyd: a postfix policy daemon with a lot of features */ +/* pfixtools: a collection of postfix related tools */ /* ~~~~~~~~~ */ /* ________________________________________________________________________ */ /* */ @@ -30,11 +30,11 @@ /******************************************************************************/ /* - * Copyright © 2006 Pierre Habouzit + * Copyright © 2006-2007 Pierre Habouzit */ -#ifndef MUTT_LIB_LIB_BUFFER_H -#define MUTT_LIB_LIB_BUFFER_H +#ifndef POSTLICYD_BUFFER_H +#define POSTLICYD_BUFFER_H #include "mem.h" #include "str.h" @@ -45,6 +45,8 @@ typedef struct buffer_t { ssize_t size; } buffer_t; +#define BUFFER_INIT {NULL, 0, 0} + DO_INIT(buffer_t, buffer); static inline void buffer_wipe(buffer_t *buf) { p_delete(&buf->data); @@ -102,4 +104,6 @@ static inline void buffer_addch(buffer_t *buf, int c) { void buffer_consume(buffer_t *buf, ssize_t len); -#endif /* MUTT_LIB_LIB_BUFFER_H */ +ssize_t buffer_read(buffer_t *buf, int fd, ssize_t count); + +#endif /* POSTLICYD_BUFFER_H */