X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/2ee9276d97f15ea965fb8a88f2aa184355b9903a..57fb77134b319c6f7eaf262c561082fcae49c1a3:/src/pulsecore/strbuf.c?ds=sidebyside diff --git a/src/pulsecore/strbuf.c b/src/pulsecore/strbuf.c index 540faef9..4fc82ded 100644 --- a/src/pulsecore/strbuf.c +++ b/src/pulsecore/strbuf.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published - by the Free Software Foundation; either version 2 of the License, + by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but @@ -113,6 +113,13 @@ void pa_strbuf_puts(pa_strbuf *sb, const char *t) { pa_strbuf_putsn(sb, t, strlen(t)); } +/* Append a character to the string buffer */ +void pa_strbuf_putc(pa_strbuf *sb, char c) { + pa_assert(sb); + + pa_strbuf_putsn(sb, &c, 1); +} + /* Append a new chunk to the linked list */ static void append(pa_strbuf *sb, struct chunk *c) { pa_assert(sb); @@ -180,3 +187,9 @@ size_t pa_strbuf_printf(pa_strbuf *sb, const char *format, ...) { size *= 2; } } + +pa_bool_t pa_strbuf_isempty(pa_strbuf *sb) { + pa_assert(sb); + + return sb->length <= 0; +}