X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=buffer.h;h=c3992590e8cb3469e2c0ba2a267835f0cce72ca1;hb=75e665838fab6bd7f579d8f2802b60435af1c783;hp=6c546d9596bf2cedd0863538e2078668f1fa2794;hpb=fe76e81ddfdc066e5b20c2f02cbcaf70fb4f0cd2;p=apps%2Fpfixtools.git diff --git a/buffer.h b/buffer.h index 6c546d9..c399259 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 POSTLICYD_BUFFER_H -#define POSTLICYD_BUFFER_H +#ifndef PFIXTOOLS_BUFFER_H +#define PFIXTOOLS_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 /* POSTLICYD_BUFFER_H */ +ssize_t buffer_read(buffer_t *buf, int fd, ssize_t count); + +#endif /* PFIXTOOLS_BUFFER_H */