summaryrefslogtreecommitdiffstats
path: root/lib/buffer.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-07-13 17:34:08 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-07-13 20:29:20 +0200
commit83eba583d7be5afaf2eba35ce4d391f645af4bfa (patch)
tree1dc80b60d845022589a592405e2d4bb7c1a392bd /lib/buffer.h
parentlib: vty: warn when using compatibility macros (diff)
downloadfrr-83eba583d7be5afaf2eba35ce4d391f645af4bfa.tar.xz
frr-83eba583d7be5afaf2eba35ce4d391f645af4bfa.zip
lib: move \n vs. \r\n handling into vty code
Instead of having an ?: expression embedded in every single caller of vty_out, just expand \n to \r\n in the vty code if neccessary. (Deprecation warnings will be enabled in the next commits which will do the search-and-replace over the codebase.) [This reverts commit 4d5f445 "lib: add vty_outln()"] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/buffer.h')
-rw-r--r--lib/buffer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/buffer.h b/lib/buffer.h
index 67ac71cad..059f2cf33 100644
--- a/lib/buffer.h
+++ b/lib/buffer.h
@@ -41,6 +41,8 @@ extern void buffer_put (struct buffer *, const void *, size_t);
extern void buffer_putc (struct buffer *, u_char);
/* Add a NUL-terminated string to the end of the buffer. */
extern void buffer_putstr (struct buffer *, const char *);
+/* Add given data, inline-expanding \n to \r\n */
+extern void buffer_put_crlf(struct buffer *b, const void *p, size_t size);
/* Combine all accumulated (and unflushed) data inside the buffer into a
single NUL-terminated string allocated using XMALLOC(MTYPE_TMP). Note