*
* (c) 1997--2011 Martin Mares <mj@ucw.cz>
* (c) 2004 Robert Spalek <robert@ucw.cz>
+ * (c) 2014 Pavel Charvat <pchar@ucw.cz>
*
* This software may be freely distributed and used according to the terms
* of the GNU Lesser General Public License.
#define fbmulti_append ucw_fbmulti_append
#define fbmulti_create ucw_fbmulti_create
#define fbmulti_remove ucw_fbmulti_remove
+#define fbnull_open ucw_fbnull_open
+#define fbnull_start ucw_fbnull_start
+#define fbnull_test ucw_fbnull_test
#define fbpar_cf ucw_fbpar_cf
#define fbpar_def ucw_fbpar_def
#define fbpool_end ucw_fbpool_end
fbatomic_internal_write(b);
}
+/*** === Null fastbufs ***/
+
+/**
+ * Creates a new "/dev/null"-like fastbuf.
+ * Any read attempt returns an EOF, any write attempt is silently ignored.
+ **/
+struct fastbuf *fbnull_open(uns bufsize);
+
+/**
+ * Can be used by any back-end to switch it to the null mode.
+ * You need to provide at least one byte long buffer for writing.
+ **/
+void fbnull_start(struct fastbuf *b, byte *buf, uns bufsize);
+
+/**
+ * Checks whether a fastbuf has been switched to the null mode.
+ **/
+bool fbnull_test(struct fastbuf *b);
+
/***
* === Fastbufs atop other fastbufs [[fbmulti]]
*