projects
/
apps
/
pfixtools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
change guards.
[apps/pfixtools.git]
/
buffer.h
diff --git
a/buffer.h
b/buffer.h
index
e3075ba
..
6c546d9
100644
(file)
--- a/
buffer.h
+++ b/
buffer.h
@@
-33,8
+33,8
@@
* Copyright © 2006 Pierre Habouzit
*/
* Copyright © 2006 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"
#include "mem.h"
#include "str.h"
@@
-52,6
+52,10
@@
static inline void buffer_wipe(buffer_t *buf) {
DO_NEW(buffer_t, buffer);
DO_DELETE(buffer_t, buffer);
DO_NEW(buffer_t, buffer);
DO_DELETE(buffer_t, buffer);
+static inline void buffer_reset(buffer_t *buf) {
+ buf->data[buf->len = 0] = '\0';
+}
+
static inline char *buffer_unwrap(buffer_t **buf) {
char *res = (*buf)->data;
(*buf)->data = NULL;
static inline char *buffer_unwrap(buffer_t **buf) {
char *res = (*buf)->data;
(*buf)->data = NULL;
@@
-96,4
+100,6
@@
static inline void buffer_addch(buffer_t *buf, int c) {
buffer_extendch(buf, 1, c);
}
buffer_extendch(buf, 1, c);
}
-#endif /* MUTT_LIB_LIB_BUFFER_H */
+void buffer_consume(buffer_t *buf, ssize_t len);
+
+#endif /* POSTLICYD_BUFFER_H */