X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=sidebyside;f=buffer.h;h=816788a99af18a42a3a28f288acf336ea52638e7;hb=61c2720436d78e1ebd68def62cbdf67c5c21a7e9;hp=d0e1c578c1a70353e4129436f82c5cfe157ace79;hpb=b5fcb83a2555a4aac4d298e7ed5487b3416ef6f6;p=apps%2Fpfixtools.git diff --git a/buffer.h b/buffer.h index d0e1c57..816788a 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); @@ -103,5 +105,6 @@ static inline void buffer_addch(buffer_t *buf, int c) { void buffer_consume(buffer_t *buf, ssize_t len); ssize_t buffer_read(buffer_t *buf, int fd, ssize_t count); +ssize_t buffer_write(buffer_t *buf, int fd); -#endif /* POSTLICYD_BUFFER_H */ +#endif /* PFIXTOOLS_BUFFER_H */